diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/ivy.xml | 14 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ApplicationConstants.java | 23 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/EventId.java | 2 | ||||
-rwxr-xr-x | shared/src/com/vaadin/shared/Position.java | 7 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/link/LinkState.java | 6 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java | 2 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java | 137 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java | 2 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/ui/PageState.java | 5 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/ui/Transport.java | 6 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/ui/UIState.java | 18 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/upload/UploadServerRpc.java | 30 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/window/WindowState.java | 16 | ||||
-rw-r--r-- | shared/tests/src/readme.txt | 1 |
14 files changed, 262 insertions, 7 deletions
diff --git a/shared/ivy.xml b/shared/ivy.xml index b4b5878294..3dfe1a51c2 100644 --- a/shared/ivy.xml +++ b/shared/ivy.xml @@ -20,10 +20,18 @@ <artifact type="pom" ext="pom" /> </publications> <dependencies> - <dependency org="com.vaadin" name="vaadin-shared-deps" - rev="1.0.2" conf="build,ide,test->default" /> + <dependency org="com.vaadin.external.flute" name="flute" + rev="1.3.0.gg2" conf="build,ide,test->default" /> + <dependency org="com.vaadin.external.streamhtmlparser" + name="streamhtmlparser-jsilver" rev="0.0.10.vaadin1" + conf="build,ide,test->default" /> + <dependency org="com.vaadin.external.google" name="guava" + rev="16.0.1.vaadin1" conf="build,ide,test->default" /> + <dependency org="com.vaadin.external.google" name="android-json" + rev="0.0.20131108.vaadin1" conf="build,ide,test->default" /> <dependency org="junit" name="junit" rev="4.11" - conf="test,ide -> default" /> + conf="test,ide -> default" /> + </dependencies> </ivy-module> diff --git a/shared/src/com/vaadin/shared/ApplicationConstants.java b/shared/src/com/vaadin/shared/ApplicationConstants.java index 4b5dc9140b..d54823ee60 100644 --- a/shared/src/com/vaadin/shared/ApplicationConstants.java +++ b/shared/src/com/vaadin/shared/ApplicationConstants.java @@ -35,6 +35,7 @@ public class ApplicationConstants implements Serializable { public static final String APP_PROTOCOL_PREFIX = "app://"; public static final String VAADIN_PROTOCOL_PREFIX = "vaadin://"; + public static final String FONTICON_PROTOCOL_PREFIX = "fonticon://"; public static final String PUBLISHED_PROTOCOL_NAME = "published"; public static final String PUBLISHED_PROTOCOL_PREFIX = PUBLISHED_PROTOCOL_NAME + "://"; @@ -94,4 +95,26 @@ public class ApplicationConstants implements Serializable { * Name of the parameter used to transmit the CSRF token. */ public static final String CSRF_TOKEN_PARAMETER = "v-csrfToken"; + + /** + * The name of the parameter used to transmit RPC invocations + * + * @since 7.2 + */ + public static final String RPC_INVOCATIONS = "rpc"; + + /** + * The name of the parameter used to transmit the CSRF token + * + * @since 7.2 + */ + public static final String CSRF_TOKEN = "csrfToken"; + + /** + * The name of the parameter used to transmit the sync id + * + * @see com.vaadin.ui.ConnectorTracker#getCurrentSyncId() + * @since 7.2 + */ + public static final String SERVER_SYNC_ID = "syncId"; } diff --git a/shared/src/com/vaadin/shared/EventId.java b/shared/src/com/vaadin/shared/EventId.java index dd30379d41..7cf760b885 100644 --- a/shared/src/com/vaadin/shared/EventId.java +++ b/shared/src/com/vaadin/shared/EventId.java @@ -22,5 +22,7 @@ public interface EventId extends Serializable { public static final String FOCUS = "focus"; public static final String CLICK_EVENT_IDENTIFIER = "click"; public static final String LAYOUT_CLICK_EVENT_IDENTIFIER = "lClick"; + public static final String POLL = "poll"; + public static final String CHANGE = "change"; } 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/link/LinkState.java b/shared/src/com/vaadin/shared/ui/link/LinkState.java index 269496767d..33ede86378 100644 --- a/shared/src/com/vaadin/shared/ui/link/LinkState.java +++ b/shared/src/com/vaadin/shared/ui/link/LinkState.java @@ -16,9 +16,15 @@ package com.vaadin.shared.ui.link; import com.vaadin.shared.AbstractComponentState; +import com.vaadin.shared.ui.BorderStyle; public class LinkState extends AbstractComponentState { { primaryStyleName = "v-link"; } + public String name = ""; + public String target = null; + public BorderStyle targetBorder = BorderStyle.DEFAULT; + public int targetWidth = -1; + public int targetHeight = -1; } 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..4d2768787f 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. Null means Vaadin does not touch the title. + */ + public String title = null; }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/ui/Transport.java b/shared/src/com/vaadin/shared/ui/ui/Transport.java index ea641c0a3c..ebc0ba3aea 100644 --- a/shared/src/com/vaadin/shared/ui/ui/Transport.java +++ b/shared/src/com/vaadin/shared/ui/ui/Transport.java @@ -30,7 +30,11 @@ public enum Transport { /** * HTTP streaming */ - STREAMING("streaming"); + STREAMING("streaming"), + /** + * HTTP long polling + */ + LONG_POLLING("long-polling"); private String identifier; 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/upload/UploadServerRpc.java b/shared/src/com/vaadin/shared/ui/upload/UploadServerRpc.java new file mode 100644 index 0000000000..79a6778da3 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/upload/UploadServerRpc.java @@ -0,0 +1,30 @@ +/* + * 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.upload; + +import com.vaadin.shared.communication.ServerRpc; + +public interface UploadServerRpc extends ServerRpc { + + /** + * Event sent when the file name of the upload component is changed. + * + * @param filename + * The filename + */ + void change(String filename); + +} diff --git a/shared/src/com/vaadin/shared/ui/window/WindowState.java b/shared/src/com/vaadin/shared/ui/window/WindowState.java index 5a2d2b81b0..3cb6bbe61e 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 = new Connector[0]; + 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 diff --git a/shared/tests/src/readme.txt b/shared/tests/src/readme.txt new file mode 100644 index 0000000000..0cffbcdcbb --- /dev/null +++ b/shared/tests/src/readme.txt @@ -0,0 +1 @@ +Add tests here. A dummy so that Git creates the directory structure |