aboutsummaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2014-04-24 13:27:57 +0300
committerLeif Åstrand <leif@vaadin.com>2014-04-25 06:28:11 +0000
commit91fa89a9a384d64a953996efa6d6f42eff1f4c8a (patch)
tree408e8fbee4a554fbd100b4e3ef3923596f04af29 /shared
parent387603a6712a68c05fdb154824fe950b2df9c451 (diff)
parent0a5eeeca649676432a4166255a4aee0028a3adcc (diff)
downloadvaadin-framework-91fa89a9a384d64a953996efa6d6f42eff1f4c8a.tar.gz
vaadin-framework-91fa89a9a384d64a953996efa6d6f42eff1f4c8a.zip
Merge remote-tracking branch 'origin/master' into grid
Change-Id: I596407a5d5c28c6ec3fb27d443e6bf143bddee6c
Diffstat (limited to 'shared')
-rw-r--r--shared/src/com/vaadin/shared/ui/label/ContentMode.java10
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java137
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/NotificationRole.java25
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/UIClientRpc.java5
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/UIState.java83
-rw-r--r--shared/src/com/vaadin/shared/ui/window/WindowRole.java25
-rw-r--r--shared/src/com/vaadin/shared/ui/window/WindowState.java7
7 files changed, 107 insertions, 185 deletions
diff --git a/shared/src/com/vaadin/shared/ui/label/ContentMode.java b/shared/src/com/vaadin/shared/ui/label/ContentMode.java
index ed0c66bc62..f5b984d496 100644
--- a/shared/src/com/vaadin/shared/ui/label/ContentMode.java
+++ b/shared/src/com/vaadin/shared/ui/label/ContentMode.java
@@ -27,7 +27,7 @@ public enum ContentMode {
TEXT,
/**
- * Content mode, where the label contains pre formatted text. In this mode
+ * Content mode, where the label contains preformatted text. In this mode
* newlines are preserved when rendered on the screen.
*/
PREFORMATTED,
@@ -39,18 +39,18 @@ public enum ContentMode {
/**
* Content mode, where the label contains well-formed or well-balanced XML.
- * This is handled in the same way as {@link #XHTML}.
+ * This is handled in the same way as {@link #HTML}.
*
- * @deprecated Use {@link #XHTML} instead
+ * @deprecated Use {@link #HTML} instead
*/
@Deprecated
XML,
/**
* Legacy content mode, where the label contains RAW output. This is handled
- * in exactly the same way as {@link #XHTML}.
+ * in exactly the same way as {@link #HTML}.
*
- * @deprecated Use {@link #XHTML} instead
+ * @deprecated Use {@link #HTML} instead
*/
@Deprecated
RAW;
diff --git a/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java b/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java
deleted file mode 100644
index 6c8c743d57..0000000000
--- a/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * 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/NotificationRole.java b/shared/src/com/vaadin/shared/ui/ui/NotificationRole.java
new file mode 100644
index 0000000000..218e5e59e6
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/ui/NotificationRole.java
@@ -0,0 +1,25 @@
+/*
+ * 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;
+
+/**
+ * Available WAI-ARIA roles for a notification.
+ *
+ * @since 7.2
+ */
+public enum NotificationRole {
+ ALERT, STATUS
+}
diff --git a/shared/src/com/vaadin/shared/ui/ui/UIClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/UIClientRpc.java
index 3067b10e24..c63f5aa275 100644
--- a/shared/src/com/vaadin/shared/ui/ui/UIClientRpc.java
+++ b/shared/src/com/vaadin/shared/ui/ui/UIClientRpc.java
@@ -26,8 +26,11 @@ import com.vaadin.shared.communication.ClientRpc;
public interface UIClientRpc extends ClientRpc {
/**
- * @since
+ * Informs the client that the UI has been closed
+ *
* @param sessionExpired
+ * true if the ui was closed because the session expired, false
+ * otherwise
*/
void uiClosed(boolean sessionExpired);
diff --git a/shared/src/com/vaadin/shared/ui/ui/UIState.java b/shared/src/com/vaadin/shared/ui/ui/UIState.java
index d2e6f037e9..08fe3c7d64 100644
--- a/shared/src/com/vaadin/shared/ui/ui/UIState.java
+++ b/shared/src/com/vaadin/shared/ui/ui/UIState.java
@@ -23,17 +23,50 @@ 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
// is announced automatically and does not need to be navigated into
public String overlayContainerLabel = "This content is announced automatically and does not need to be navigated into.";
+ public Map<String, NotificationTypeConfiguration> notificationConfigurations = new HashMap<String, NotificationTypeConfiguration>();
+ {
+ notificationConfigurations.put("error",
+ new NotificationTypeConfiguration("Error: ",
+ " - close with ESC-key", NotificationRole.ALERT));
+ notificationConfigurations.put("warning",
+ new NotificationTypeConfiguration("Warning: ", null,
+ NotificationRole.ALERT));
+ notificationConfigurations.put("humanized",
+ new NotificationTypeConfiguration("Info: ", null,
+ NotificationRole.ALERT));
+ notificationConfigurations.put("tray",
+ new NotificationTypeConfiguration("Status: ", null,
+ NotificationRole.STATUS));
+ notificationConfigurations.put("assistive",
+ new NotificationTypeConfiguration("Note: ", null,
+ NotificationRole.STATUS));
+ }
+ /**
+ * State related to the Page class.
+ */
+ public PageState pageState = new PageState();
+ /**
+ * State related to the LocaleService class.
+ */
+ public LocaleServiceState localeServiceState = new LocaleServiceState();
+ /**
+ * Configuration for the push channel
+ */
+ public PushConfigurationState pushConfiguration = new PushConfigurationState();
+ {
+ primaryStyleName = "v-ui";
+ // Default is 1 for legacy reasons
+ tabIndex = 1;
+ }
public static class LoadingIndicatorConfigurationState implements
Serializable {
@@ -50,19 +83,19 @@ 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 NotificationTypeConfiguration implements Serializable {
+ public String prefix;
+ public String postfix;
+ public NotificationRole notificationRole = NotificationRole.ALERT;
+
+ public NotificationTypeConfiguration() {
+ }
+
+ public NotificationTypeConfiguration(String prefix, String postfix,
+ NotificationRole role) {
+ this.prefix = prefix;
+ this.postfix = postfix;
+ this.notificationRole = role;
}
}
@@ -80,26 +113,6 @@ public class UIState extends TabIndexState {
}
}
- /**
- * State related to the Page class.
- */
- public PageState pageState = new PageState();
- /**
- * State related to the LocaleService class.
- */
- public LocaleServiceState localeServiceState = new LocaleServiceState();
-
- /**
- * Configuration for the push channel
- */
- public PushConfigurationState pushConfiguration = new PushConfigurationState();
-
- {
- primaryStyleName = "v-ui";
- // Default is 1 for legacy reasons
- tabIndex = 1;
- }
-
public static class LocaleServiceState implements Serializable {
public List<LocaleData> localeData = new ArrayList<LocaleData>();
}
diff --git a/shared/src/com/vaadin/shared/ui/window/WindowRole.java b/shared/src/com/vaadin/shared/ui/window/WindowRole.java
new file mode 100644
index 0000000000..fc6b099620
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/window/WindowRole.java
@@ -0,0 +1,25 @@
+/*
+ * 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.window;
+
+/**
+ * Available WAI-ARIA roles for a window.
+ *
+ * @since 7.2
+ */
+public enum WindowRole {
+ ALERTDIALOG, DIALOG
+}
diff --git a/shared/src/com/vaadin/shared/ui/window/WindowState.java b/shared/src/com/vaadin/shared/ui/window/WindowState.java
index e27bf87e88..ebb1995287 100644
--- a/shared/src/com/vaadin/shared/ui/window/WindowState.java
+++ b/shared/src/com/vaadin/shared/ui/window/WindowState.java
@@ -23,13 +23,6 @@ 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;