diff options
Diffstat (limited to 'shared')
7 files changed, 184 insertions, 3 deletions
diff --git a/shared/src/com/vaadin/shared/Position.java b/shared/src/com/vaadin/shared/Position.java index cd34ee8b87..3df42d65d8 100755 --- a/shared/src/com/vaadin/shared/Position.java +++ b/shared/src/com/vaadin/shared/Position.java @@ -16,5 +16,10 @@ package com.vaadin.shared; public enum Position { - TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT; + TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, + /** + * Position that is only accessible for assistive devices, invisible for + * visual users. + **/ + ASSISTIVE; } diff --git a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java index 7eb23a9887..b7f337a5a8 100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java @@ -29,5 +29,7 @@ public class TabsheetBaseConstants implements Serializable { public static final String ATTRIBUTE_TAB_CAPTION = "caption"; @Deprecated public static final String ATTRIBUTE_TAB_ICON = "icon"; + @Deprecated + public static final String ATTRIBUTE_TAB_ICON_ALT = "iconalt"; } diff --git a/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java b/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java new file mode 100644 index 0000000000..05a1706763 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java @@ -0,0 +1,137 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * + */ +package com.vaadin.shared.ui.ui; + +import java.io.Serializable; + +/** + * Holds configuration information for a notification type. + * + * @author Vaadin Ltd + */ +public class NotificationConfigurationBean implements Serializable { + /** + * Available WAI-ARIA roles for a notification. + */ + public enum Role { + ALERT, STATUS + }; + + private String prefix; + private String postfix; + private Role role = Role.ALERT; + + public NotificationConfigurationBean() { + } + + public NotificationConfigurationBean(String prefix, String postfix, + Role role) { + this.prefix = prefix; + this.postfix = postfix; + this.role = role; + } + + /** + * Returns the accessibility prefix, which is placed before the notification + * content. + * + * @return the prefix + */ + public String getAssistivePrefix() { + return prefix; + } + + /** + * Sets the accessibility prefix, which is placed before the notification + * content. + * + * @param pefix + * the prefix to set + */ + public void setAssistivePrefix(String prefix) { + this.prefix = prefix; + } + + /** + * Checks if an accessibility prefix is set. + * + * @return true when assistivePrefix is not null and has a length > 0, false + * otherwise + */ + public boolean hasAssistivePrefix() { + return prefix != null && !prefix.isEmpty(); + } + + /** + * Returns the accessibility postfix, which is placed after the notification + * content. + * + * @return the postfix + */ + public String getAssistivePostfix() { + return postfix; + } + + /** + * Sets the accessibility postfix, which is placed after the notification + * content. + * + * @param postfix + * the postfix to set + */ + public void setAssistivePostfix(String postfix) { + this.postfix = postfix; + } + + /** + * Checks if an accessibility postfix is set. + * + * @return true when postfix is not null and has a length > 0, false + * otherwise + */ + public boolean hasAssistivePostfix() { + return postfix != null && !postfix.isEmpty(); + } + + /** + * Returns the WAI-ARIA role that defines how an assistive device will + * inform the user about a notification. + * + * @return the role + */ + public Role getAssistiveRole() { + return role; + } + + /** + * Sets the WAI-ARIA role that defines how an assistive device will inform + * the user about a notification. + * + * Available roles are alert, alertdialog and status (@see <a + * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles + * Model</a>). + * + * @param role + * the role to set + */ + public void setAssistiveRole(Role role) { + this.role = role; + } +} diff --git a/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java index eb847bacd0..76a3fbfdb6 100644 --- a/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java @@ -20,8 +20,6 @@ import com.vaadin.shared.communication.ClientRpc; public interface PageClientRpc extends ClientRpc { - public void setTitle(String title); - public void reload(); } diff --git a/shared/src/com/vaadin/shared/ui/ui/PageState.java b/shared/src/com/vaadin/shared/ui/ui/PageState.java index 0b51eb4bba..ded73d16d5 100644 --- a/shared/src/com/vaadin/shared/ui/ui/PageState.java +++ b/shared/src/com/vaadin/shared/ui/ui/PageState.java @@ -30,4 +30,9 @@ public class PageState implements Serializable { * True if the page has browser window resize listeners. */ public boolean hasResizeListeners = false; + + /** + * Non-null if the title is set. + */ + public String title = null; }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/ui/UIState.java b/shared/src/com/vaadin/shared/ui/ui/UIState.java index 8d042a835f..4cde452a2b 100644 --- a/shared/src/com/vaadin/shared/ui/ui/UIState.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIState.java @@ -23,10 +23,12 @@ import java.util.Map; import com.vaadin.shared.communication.PushMode; import com.vaadin.shared.ui.TabIndexState; +import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; public class UIState extends TabIndexState { public TooltipConfigurationState tooltipConfiguration = new TooltipConfigurationState(); public LoadingIndicatorConfigurationState loadingIndicatorConfiguration = new LoadingIndicatorConfigurationState(); + public NotificationConfigurationState notificationConfiguration = new NotificationConfigurationState(); public int pollInterval = -1; // Informing users of assistive devices, that the content of this container @@ -48,6 +50,22 @@ public class UIState extends TabIndexState { public int maxWidth = 500; } + public static class NotificationConfigurationState implements Serializable { + public Map<String, NotificationConfigurationBean> setup = new HashMap<String, NotificationConfigurationBean>(); + { + setup.put("error", new NotificationConfigurationBean("Error: ", + " - close with ESC-key", Role.ALERT)); + setup.put("warning", new NotificationConfigurationBean("Warning: ", + null, Role.ALERT)); + setup.put("humanized", new NotificationConfigurationBean("Info: ", + null, Role.ALERT)); + setup.put("tray", new NotificationConfigurationBean("Status: ", + null, Role.STATUS)); + setup.put("assistive", new NotificationConfigurationBean("Note: ", + null, Role.STATUS)); + }; + } + public static class PushConfigurationState implements Serializable { public static final String TRANSPORT_PARAM = "transport"; public static final String FALLBACK_TRANSPORT_PARAM = "fallbackTransport"; diff --git a/shared/src/com/vaadin/shared/ui/window/WindowState.java b/shared/src/com/vaadin/shared/ui/window/WindowState.java index 5a2d2b81b0..55a9b3ec55 100644 --- a/shared/src/com/vaadin/shared/ui/window/WindowState.java +++ b/shared/src/com/vaadin/shared/ui/window/WindowState.java @@ -15,6 +15,7 @@ */ package com.vaadin.shared.ui.window; +import com.vaadin.shared.Connector; import com.vaadin.shared.ui.panel.PanelState; public class WindowState extends PanelState { @@ -22,6 +23,13 @@ public class WindowState extends PanelState { primaryStyleName = "v-window"; } + /** + * Available WAI-ARIA roles for a window. + */ + public enum WindowRole { + ALERTDIALOG, DIALOG + }; + public boolean modal = false; public boolean resizable = true; public boolean resizeLazy = false; @@ -30,4 +38,12 @@ public class WindowState extends PanelState { public int positionX = -1; public int positionY = -1; public WindowMode windowMode = WindowMode.NORMAL; + + public String assistivePrefix = ""; + public String assistivePostfix = ""; + public Connector[] contentDescription; + public WindowRole role = WindowRole.DIALOG; + public boolean assistiveTabStop = false; + public String assistiveTabStopTopText = "Top of dialog"; + public String assistiveTabStopBottomText = "Bottom of Dialog"; }
\ No newline at end of file |