diff options
26 files changed, 307 insertions, 99 deletions
diff --git a/WebContent/VAADIN/jquery.atmosphere.js b/WebContent/VAADIN/jquery.atmosphere.js index b83894d2eb..bb597f01b5 100644 --- a/WebContent/VAADIN/jquery.atmosphere.js +++ b/WebContent/VAADIN/jquery.atmosphere.js @@ -1159,6 +1159,10 @@ jQuery.atmosphere = function() { } } }; + if (_websocket.url === undefined) { + // Android 4.1 does not really support websockets and fails silently + _websocket.onclose({reason:"Android 4.1 does not support websockets.", wasClean: false}); + } } function _handleProtocol(request, message) { diff --git a/WebContent/VAADIN/themes/base/common/common.scss b/WebContent/VAADIN/themes/base/common/common.scss index 48890488fb..c32116cda8 100644 --- a/WebContent/VAADIN/themes/base/common/common.scss +++ b/WebContent/VAADIN/themes/base/common/common.scss @@ -11,7 +11,7 @@ .v-caption { cursor: default; } -body &.v-app-loading { +body &.v-app .v-app-loading { /* You can use this to provide indication for the user that the application is loading. */ /* It is applied to the same element as .v-app */ background-image: url(img/loading-indicator.gif); diff --git a/WebContent/license.html b/WebContent/license.html index 22678ca981..5e9bfe4dc5 100644 --- a/WebContent/license.html +++ b/WebContent/license.html @@ -346,7 +346,7 @@ <div id="footer"> - <span class="slogan">Vaadin – thinking of U and I<span> + <span class="slogan">Vaadin – thinking of U and I</span> </div> <!-- /footer --> diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java index d873cc8dc6..236417f23b 100644 --- a/client/src/com/vaadin/client/ApplicationConnection.java +++ b/client/src/com/vaadin/client/ApplicationConnection.java @@ -2940,6 +2940,14 @@ public class ApplicationConnection { uidlUri = serviceUrl + relativeUrl; } } + if (uidlUri.startsWith(ApplicationConstants.VAADIN_PROTOCOL_PREFIX)) { + final String vaadinUri = configuration.getVaadinDirUrl(); + String relativeUrl = uidlUri + .substring(ApplicationConstants.VAADIN_PROTOCOL_PREFIX + .length()); + uidlUri = vaadinUri + relativeUrl; + } + return uidlUri; } diff --git a/client/src/com/vaadin/client/SimpleTree.java b/client/src/com/vaadin/client/SimpleTree.java index 289f05022a..7370496cb8 100644 --- a/client/src/com/vaadin/client/SimpleTree.java +++ b/client/src/com/vaadin/client/SimpleTree.java @@ -21,6 +21,7 @@ import com.google.gwt.dom.client.SpanElement; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Cursor; import com.google.gwt.dom.client.Style.Display; +import com.google.gwt.dom.client.Style.TextAlign; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; @@ -54,9 +55,10 @@ public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers { style.setProperty("whiteSpace", "nowrap"); style.setPadding(3, Unit.PX); style.setPaddingLeft(12, Unit.PX); - + // handle styling style = handle.getStyle(); style.setDisplay(Display.NONE); + style.setTextAlign(TextAlign.CENTER); style.setWidth(0.5, Unit.EM); style.setHeight(0.5, Unit.EM); style.setCursor(Cursor.POINTER); @@ -68,8 +70,9 @@ public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers { handle.setInnerHTML("+"); getElement().appendChild(handle); getElement().appendChild(text); + // children styling style = children.getStyle(); - style.setPaddingLeft(9, Unit.PX); + style.setPaddingLeft(1.5, Unit.EM); style.setDisplay(Display.NONE); getElement().appendChild(children); diff --git a/client/src/com/vaadin/client/VCaption.java b/client/src/com/vaadin/client/VCaption.java index d033c2b4fe..d0338de4a1 100644 --- a/client/src/com/vaadin/client/VCaption.java +++ b/client/src/com/vaadin/client/VCaption.java @@ -437,6 +437,12 @@ public class VCaption extends HTML { return true; } + if (state instanceof AbstractFieldState) { + if (((AbstractFieldState) state).required) { + return true; + } + } + return false; } diff --git a/client/src/com/vaadin/client/debug/internal/InfoSection.java b/client/src/com/vaadin/client/debug/internal/InfoSection.java index ade3bdd52d..38d7290fde 100644 --- a/client/src/com/vaadin/client/debug/internal/InfoSection.java +++ b/client/src/com/vaadin/client/debug/internal/InfoSection.java @@ -165,10 +165,12 @@ public class InfoSection implements Section { addRow("Widget set", GWT.getModuleName()); addRow("Theme", connection.getConfiguration().getThemeName()); - String communicationMethodInfo = connection.getCommunicationMethodName(); + String communicationMethodInfo = connection + .getCommunicationMethodName(); int pollInterval = connection.getUIConnector().getState().pollInterval; if (pollInterval > 0) { - communicationMethodInfo += " (poll interval " + pollInterval + "s)"; + communicationMethodInfo += " (poll interval " + pollInterval + + "ms)"; } addRow("Communication method", communicationMethodInfo); diff --git a/push/build.xml b/push/build.xml index f18caf69b4..042e513830 100644 --- a/push/build.xml +++ b/push/build.xml @@ -13,7 +13,7 @@ <property name="vaadinPush.js" location="${result.dir}/js/VAADIN/vaadinPush.js" /> <!-- Keep the version number in sync with ivy.xml and server/src/com/vaadin/server/Constants.java--> - <property name="atmosphere.version" value="1.0.14-vaadin1" /> + <property name="atmosphere.version" value="1.0.14.vaadin3" /> <property name="jquery.version" value="1.7.2" /> <path id="classpath.compile.custom" /> diff --git a/push/ivy.xml b/push/ivy.xml index 444e8908e0..615e404db3 100644 --- a/push/ivy.xml +++ b/push/ivy.xml @@ -28,7 +28,7 @@ <!-- Atmosphere --> <!-- Keep the version number in sync with build.xml --> <dependency org="com.vaadin.external.atmosphere" name="atmosphere-runtime" - rev="1.0.14-vaadin1" conf="build,ide,test -> default"> + rev="1.0.14.vaadin3" conf="build,ide,test -> default"> </dependency> </dependencies> diff --git a/server/src/com/vaadin/annotations/StyleSheet.java b/server/src/com/vaadin/annotations/StyleSheet.java index e06140fcd5..2e15d9481c 100644 --- a/server/src/com/vaadin/annotations/StyleSheet.java +++ b/server/src/com/vaadin/annotations/StyleSheet.java @@ -32,6 +32,11 @@ import com.vaadin.server.ClientConnector; * Relative urls are mapped to APP/PUBLISHED/[url] which are by default served * from the classpath relative to the class where the annotation is defined. * <p> + * Special Vaadin urls are also supported. The most useful is vaadin:// which + * maps to the location of the automatically published VAADIN folder. Using the + * VAADIN folder and vaadin:// you can publish stylesheets which use images or + * other files with relative paths. + * <p> * Example: {@code @StyleSheet( "http://host.com/file1.css", "file2.css"})} on * the class com.example.MyConnector would load the file * http://host.com/file1.css as is and file2.css from /com/example/file2.css on diff --git a/server/src/com/vaadin/data/Buffered.java b/server/src/com/vaadin/data/Buffered.java index bbfc04b73a..0d6722f71f 100644 --- a/server/src/com/vaadin/data/Buffered.java +++ b/server/src/com/vaadin/data/Buffered.java @@ -152,19 +152,6 @@ public interface Buffered extends Serializable { } /** - * Creates a source exception from a cause exception. - * - * @param source - * the source object implementing the Buffered interface. - * @param cause - * the original cause for this exception. - */ - public SourceException(Buffered source, Throwable cause) { - this.source = source; - causes = new Throwable[] { cause }; - } - - /** * Creates a source exception from multiple causes. * * @param source @@ -172,7 +159,7 @@ public interface Buffered extends Serializable { * @param causes * the original causes for this exception. */ - public SourceException(Buffered source, Throwable[] causes) { + public SourceException(Buffered source, Throwable... causes) { this.source = source; this.causes = causes; } diff --git a/server/src/com/vaadin/data/Validator.java b/server/src/com/vaadin/data/Validator.java index c4f008cb39..4f3fbe2cc3 100644 --- a/server/src/com/vaadin/data/Validator.java +++ b/server/src/com/vaadin/data/Validator.java @@ -105,7 +105,7 @@ public interface Validator extends Serializable { * this exception. */ public InvalidValueException(String message, - InvalidValueException[] causes) { + InvalidValueException... causes) { super(message); if (causes == null) { throw new NullPointerException( diff --git a/server/src/com/vaadin/data/util/BeanItem.java b/server/src/com/vaadin/data/util/BeanItem.java index 24eb2505e4..fc51be8f36 100644 --- a/server/src/com/vaadin/data/util/BeanItem.java +++ b/server/src/com/vaadin/data/util/BeanItem.java @@ -141,7 +141,7 @@ public class BeanItem<BT> extends PropertysetItem { * @param propertyIds * ids of the properties. */ - public BeanItem(BT bean, String[] propertyIds) { + public BeanItem(BT bean, String... propertyIds) { this(bean, Arrays.asList(propertyIds)); } diff --git a/server/src/com/vaadin/data/util/sqlcontainer/RowId.java b/server/src/com/vaadin/data/util/sqlcontainer/RowId.java index 8fd8eec697..c375bd5a4a 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/RowId.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/RowId.java @@ -34,7 +34,7 @@ public class RowId implements Serializable { protected RowId() { } - public RowId(Object[] id) { + public RowId(Object... id) { if (id == null) { throw new IllegalArgumentException("id parameter must not be null!"); } diff --git a/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java b/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java index fbf53121da..03f7f23fdd 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java @@ -18,7 +18,7 @@ package com.vaadin.data.util.sqlcontainer; public class TemporaryRowId extends RowId { private static final long serialVersionUID = -641983830469018329L; - public TemporaryRowId(Object[] id) { + public TemporaryRowId(Object... id) { super(id); } diff --git a/server/src/com/vaadin/event/ShortcutAction.java b/server/src/com/vaadin/event/ShortcutAction.java index 78eec53112..5ec4d3bfa0 100644 --- a/server/src/com/vaadin/event/ShortcutAction.java +++ b/server/src/com/vaadin/event/ShortcutAction.java @@ -70,7 +70,7 @@ public class ShortcutAction extends Action { * @param m * optional modifier keys */ - public ShortcutAction(String caption, int kc, int[] m) { + public ShortcutAction(String caption, int kc, int... m) { super(caption); keyCode = kc; modifiers = m; @@ -91,7 +91,7 @@ public class ShortcutAction extends Action { * @param m * optional modifier keys */ - public ShortcutAction(String caption, Resource icon, int kc, int[] m) { + public ShortcutAction(String caption, Resource icon, int kc, int... m) { super(caption, icon); keyCode = kc; modifiers = m; @@ -174,7 +174,7 @@ public class ShortcutAction extends Action { * @param shorthandCaption * @param modifierKeys */ - public ShortcutAction(String shorthandCaption, int[] modifierKeys) { + public ShortcutAction(String shorthandCaption, int... modifierKeys) { // && -> & etc super(SHORTHAND_ESCAPE.matcher(shorthandCaption).replaceAll("$1$2$3")); // replace escaped chars with something that won't accidentally match diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index dddfb385a6..b21fdb0b74 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -363,6 +363,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { Element mainDiv = new Element(Tag.valueOf("div"), ""); mainDiv.attr("id", context.getAppId()); mainDiv.addClass("v-app"); + mainDiv.addClass(context.getThemeName()); if (style != null && style.length() != 0) { mainDiv.attr("style", style); } diff --git a/server/src/com/vaadin/server/CompositeErrorMessage.java b/server/src/com/vaadin/server/CompositeErrorMessage.java index 5ae7cfd577..1645285f9b 100644 --- a/server/src/com/vaadin/server/CompositeErrorMessage.java +++ b/server/src/com/vaadin/server/CompositeErrorMessage.java @@ -32,10 +32,10 @@ public class CompositeErrorMessage extends AbstractErrorMessage { * Constructor for CompositeErrorMessage. * * @param errorMessages - * the Array of error messages that are listed togeter. Nulls are - * ignored, but at least one message is required. + * the array of error messages that are listed together. Nulls + * are ignored, but at least one message is required. */ - public CompositeErrorMessage(ErrorMessage[] errorMessages) { + public CompositeErrorMessage(ErrorMessage... errorMessages) { super(null); setErrorLevel(ErrorLevel.INFORMATION); diff --git a/server/src/com/vaadin/server/Constants.java b/server/src/com/vaadin/server/Constants.java index bcdb62064b..ed65b53183 100644 --- a/server/src/com/vaadin/server/Constants.java +++ b/server/src/com/vaadin/server/Constants.java @@ -65,7 +65,7 @@ public interface Constants { + " Widgetset version: %s\n" + "================================================================="; - static final String REQUIRED_ATMOSPHERE_VERSION = "1.0.14-vaadin1"; + static final String REQUIRED_ATMOSPHERE_VERSION = "1.0.14.vaadin3"; static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n" + "=================================================================\n" diff --git a/server/src/com/vaadin/ui/Form.java b/server/src/com/vaadin/ui/Form.java index 9d0bb41cac..706c103cd7 100644 --- a/server/src/com/vaadin/ui/Form.java +++ b/server/src/com/vaadin/ui/Form.java @@ -1131,7 +1131,7 @@ public class Form extends AbstractField<Object> implements Item.Editor, * @param visibleProperties * the visibleProperties to set. */ - public void setVisibleItemProperties(Object[] visibleProperties) { + public void setVisibleItemProperties(Object... visibleProperties) { LinkedList<Object> v = new LinkedList<Object>(); for (int i = 0; i < visibleProperties.length; i++) { v.add(visibleProperties[i]); diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index a688b2eb45..b5606b4e67 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -623,7 +623,7 @@ public class Table extends AbstractSelect implements Action.Container, * @param visibleColumns * the Array of shown property id:s. */ - public void setVisibleColumns(Object[] visibleColumns) { + public void setVisibleColumns(Object... visibleColumns) { // Visible columns must exist if (visibleColumns == null) { @@ -722,7 +722,7 @@ public class Table extends AbstractSelect implements Action.Container, * the Array of column headers that match the * {@link #getVisibleColumns()} method. */ - public void setColumnHeaders(String[] columnHeaders) { + public void setColumnHeaders(String... columnHeaders) { if (columnHeaders.length != visibleColumns.size()) { throw new IllegalArgumentException( @@ -781,7 +781,7 @@ public class Table extends AbstractSelect implements Action.Container, * the Array of icons that match the {@link #getVisibleColumns()} * . */ - public void setColumnIcons(Resource[] columnIcons) { + public void setColumnIcons(Resource... columnIcons) { if (columnIcons.length != visibleColumns.size()) { throw new IllegalArgumentException( diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index 700d0eb387..5820161c1c 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -80,14 +80,14 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, }; /** - * Creates a new, empty sub window + * Creates a new, empty window */ public Window() { this("", null); } /** - * Creates a new, empty sub window with a given title. + * Creates a new, empty window with a given title. * * @param caption * the title of the window. @@ -97,7 +97,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, } /** - * Creates a new, empty sub window with the given content and title. + * Creates a new, empty window with the given content and title. * * @param caption * the title of the window. @@ -214,15 +214,12 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Method that handles window closing (from UI). * * <p> - * By default, sub-windows are removed from their respective parent windows - * and thus visually closed on browser-side. Browser-level windows also - * closed on the client-side, but they are not implicitly removed from the - * application. + * By default, windows are removed from their respective UIs and thus + * visually closed on browser-side. * </p> * * <p> - * To explicitly close a sub-window, use {@link #removeWindow(Window)}. To - * react to a window being closed (after it is closed), register a + * To react to a window being closed (after it is closed), register a * {@link CloseListener}. * </p> */ @@ -233,7 +230,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, if (uI != null) { // focus is restored to the parent window uI.focus(); - // subwindow is removed from the UI + // window is removed from the UI uI.removeWindow(this); } } @@ -329,7 +326,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * An interface used for listening to Window close events. Add the - * CloseListener to a browser level window or a sub window and + * CloseListener to a window and * {@link CloseListener#windowClose(CloseEvent)} will be called whenever the * user closes the window. * @@ -353,8 +350,8 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Adds a CloseListener to the window. * - * For a sub window the CloseListener is fired when the user closes it - * (clicks on the close button). + * For a window the CloseListener is fired when the user closes it (clicks + * on the close button). * * For a browser level window the CloseListener is fired when the browser * level window is closed. Note that closing a browser level window does not @@ -636,8 +633,8 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, } /** - * Sets sub-window modal, so that widgets behind it cannot be accessed. - * <b>Note:</b> affects sub-windows only. + * Sets window modality. When a modal window is open, components outside + * that window it cannot be accessed. * * @param modal * true if modality is to be turned on @@ -655,7 +652,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, } /** - * Sets sub-window resizable. <b>Note:</b> affects sub-windows only. + * Sets window resizable. * * @param resizable * true if resizability is to be turned on @@ -699,7 +696,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Sets this window to be centered relative to its parent window. Affects - * sub-windows only. If the window is resized as a result of the size of its + * windows only. If the window is resized as a result of the size of its * content changing, it will keep itself centered as long as its position is * not explicitly changed programmatically or by the user. * <p> @@ -711,64 +708,59 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, } /** - * Returns the closable status of the sub window. If a sub window is - * closable it typically shows an X in the upper right corner. Clicking on - * the X sends a close event to the server. Setting closable to false will - * remove the X from the sub window and prevent the user from closing the - * window. + * Returns the closable status of the window. If a window is closable, it + * typically shows an X in the upper right corner. Clicking on the X sends a + * close event to the server. Setting closable to false will remove the X + * from the window and prevent the user from closing the window. * - * Note! For historical reasons readonly controls the closability of the sub + * Note! For historical reasons readonly controls the closability of the * window and therefore readonly and closable affect each other. Setting * readonly to true will set closable to false and vice versa. * <p/> - * Closable only applies to sub windows, not to browser level windows. * - * @return true if the sub window can be closed by the user. + * @return true if the window can be closed by the user. */ public boolean isClosable() { return !isReadOnly(); } /** - * Sets the closable status for the sub window. If a sub window is closable - * it typically shows an X in the upper right corner. Clicking on the X - * sends a close event to the server. Setting closable to false will remove - * the X from the sub window and prevent the user from closing the window. + * Sets the closable status for the window. If a window is closable it + * typically shows an X in the upper right corner. Clicking on the X sends a + * close event to the server. Setting closable to false will remove the X + * from the window and prevent the user from closing the window. * - * Note! For historical reasons readonly controls the closability of the sub + * Note! For historical reasons readonly controls the closability of the * window and therefore readonly and closable affect each other. Setting * readonly to true will set closable to false and vice versa. * <p/> - * Closable only applies to sub windows, not to browser level windows. * * @param closable - * determines if the sub window can be closed by the user. + * determines if the window can be closed by the user. */ public void setClosable(boolean closable) { setReadOnly(!closable); } /** - * Indicates whether a sub window can be dragged or not. By default a sub - * window is draggable. + * Indicates whether a window can be dragged or not. By default a window is + * draggable. * <p/> - * Draggable only applies to sub windows, not to browser level windows. * * @param draggable - * true if the sub window can be dragged by the user + * true if the window can be dragged by the user */ public boolean isDraggable() { return getState().draggable; } /** - * Enables or disables that a sub window can be dragged (moved) by the user. - * By default a sub window is draggable. + * Enables or disables that a window can be dragged (moved) by the user. By + * default a window is draggable. * <p/> - * Draggable only applies to sub windows, not to browser level windows. * * @param draggable - * true if the sub window can be dragged by the user + * true if the window can be dragged by the user */ public void setDraggable(boolean draggable) { getState().draggable = draggable; @@ -807,8 +799,8 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Makes is possible to close the window by pressing the given * {@link KeyCode} and (optional) {@link ModifierKey}s.<br/> * Note that this shortcut only reacts while the window has focus, closing - * itself - if you want to close a subwindow from a parent window, use - * {@link #addAction(com.vaadin.event.Action)} of the parent window instead. + * itself - if you want to close a window from a UI, use + * {@link UI#addAction(com.vaadin.event.Action)} of the UI instead. * * @param keyCode * the keycode for invoking the shortcut @@ -842,10 +834,10 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * <pre> * <code> * // within the window using helper - * subWindow.setCloseShortcut(KeyCode.ESCAPE, null); + * window.setCloseShortcut(KeyCode.ESCAPE, null); * * // or globally - * getWindow().addAction(new Window.CloseShortcut(subWindow, KeyCode.ESCAPE)); + * getUI().addAction(new Window.CloseShortcut(window, KeyCode.ESCAPE)); * </code> * </pre> * @@ -902,14 +894,13 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, } } - /** - * Note, that focus/blur listeners in Window class are only supported by sub - * windows. Also note that Window is not considered focused if its contained - * component currently has focus. + /* + * (non-Javadoc) * - * @see com.vaadin.event.FieldEvents.FocusNotifier#addListener(com.vaadin.event.FieldEvents.FocusListener) + * @see + * com.vaadin.event.FieldEvents.FocusNotifier#addFocusListener(com.vaadin + * .event.FieldEvents.FocusListener) */ - @Override public void addFocusListener(FocusListener listener) { addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, @@ -941,14 +932,13 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, removeFocusListener(listener); } - /** - * Note, that focus/blur listeners in Window class are only supported by sub - * windows. Also note that Window is not considered focused if its contained - * component currently has focus. + /* + * (non-Javadoc) * - * @see com.vaadin.event.FieldEvents.BlurNotifier#addListener(com.vaadin.event.FieldEvents.BlurListener) + * @see + * com.vaadin.event.FieldEvents.BlurNotifier#addBlurListener(com.vaadin. + * event.FieldEvents.BlurListener) */ - @Override public void addBlurListener(BlurListener listener) { addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, @@ -982,16 +972,15 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * {@inheritDoc} * - * If the window is a sub-window focusing will cause the sub-window to be - * brought on top of other sub-windows on gain keyboard focus. + * Cause the window to be brought on top of other windows and gain keyboard + * focus. */ - @Override public void focus() { /* - * When focusing a sub-window it basically means it should be brought to - * the front. Instead of just moving the keyboard focus we focus the - * window and bring it top-most. + * When focusing a window it basically means it should be brought to the + * front. Instead of just moving the keyboard focus we focus the window + * and bring it top-most. */ super.focus(); bringToFront(); diff --git a/shared/src/com/vaadin/shared/ApplicationConstants.java b/shared/src/com/vaadin/shared/ApplicationConstants.java index 15b81cd9a4..d7de435735 100644 --- a/shared/src/com/vaadin/shared/ApplicationConstants.java +++ b/shared/src/com/vaadin/shared/ApplicationConstants.java @@ -34,6 +34,7 @@ public class ApplicationConstants implements Serializable { + "PUBLISHED"; public static final String APP_PROTOCOL_PREFIX = "app://"; + public static final String VAADIN_PROTOCOL_PREFIX = "vaadin://"; public static final String PUBLISHED_PROTOCOL_NAME = "published"; public static final String PUBLISHED_PROTOCOL_PREFIX = PUBLISHED_PROTOCOL_NAME + "://"; diff --git a/uitest/integration_base_files/base.xml b/uitest/integration_base_files/base.xml index d8ba018b75..f2064c3007 100644 --- a/uitest/integration_base_files/base.xml +++ b/uitest/integration_base_files/base.xml @@ -1,6 +1,7 @@ <?xml version="1.0"?> <project name="test" basedir="."> <property file="deploy.properties" /> + <property name="vaadin.major.7" value="1" /> <property name="lock" value="deploy/lock.file" /> <property name="deployDir" value="deploy/${server}" /> <property name="serverPort" value="8080" /> diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.html b/uitest/src/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.html new file mode 100644 index 0000000000..bc013f42ef --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.html @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.abstractfield.RequiredIndicatorForFieldsWithoutCaption?debug&restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VGridLayout[0]/domChild[2]/domChild[0]/domChild[0]</td> + <td>v-required-field-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>//div[3]/div/div[2]/div/div/span</td> + <td>v-required-field-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>//div[4]/div/div[2]/div/div/span</td> + <td>v-required-field-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[4]/VAbsoluteLayout[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]</td> + <td>v-required-field-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VCssLayout[0]/domChild[1]/domChild[0]</td> + <td>v-required-field-indicator</td> +</tr> +<!--Set to not required--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCheckBox[0]/domChild[0]</td> + <td>9,4</td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VGridLayout[0]/domChild[2]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>//div[3]/div/div[2]/div/div/span</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>//div[4]/div/div[2]/div/div/span</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[4]/VAbsoluteLayout[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VCssLayout[0]/domChild[1]/domChild[0]</td> + <td></td> +</tr> +<!--Set to required again--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCheckBox[0]/domChild[0]</td> + <td>9,4</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VGridLayout[0]/domChild[2]/domChild[0]/domChild[0]</td> + <td>v-required-field-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>//div[3]/div/div[2]/div/div/span</td> + <td>v-required-field-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>//div[4]/div/div[2]/div/div/span</td> + <td>v-required-field-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[4]/VAbsoluteLayout[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]</td> + <td>v-required-field-indicator</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsabstractfieldRequiredIndicatorForFieldsWithoutCaption::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VCssLayout[0]/domChild[1]/domChild[0]</td> + <td>v-required-field-indicator</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java b/uitest/src/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java new file mode 100644 index 0000000000..56e593ce0f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java @@ -0,0 +1,92 @@ +package com.vaadin.tests.components.abstractfield; + +import java.util.HashSet; +import java.util.Set; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.AbsoluteLayout; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.Component; +import com.vaadin.ui.ComponentContainer; +import com.vaadin.ui.CssLayout; +import com.vaadin.ui.Field; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +public class RequiredIndicatorForFieldsWithoutCaption extends AbstractTestUI { + private Set<Field> fields = new HashSet<Field>(); + + @Override + protected void setup(VaadinRequest request) { + + CheckBox required = new CheckBox("Fields required", true); + required.setImmediate(true); + required.addValueChangeListener(new ValueChangeListener() { + + @Override + public void valueChange(ValueChangeEvent event) { + boolean required = (Boolean) event.getProperty().getValue(); + for (Field f : fields) { + f.setRequired(required); + } + } + }); + addComponent(required); + addComponent(createWrappedTextField(new GridLayout(2, 1))); + addComponent(createWrappedTextField(new VerticalLayout())); + addComponent(createWrappedTextField(new HorizontalLayout())); + AbsoluteLayout al = new AbsoluteLayout(); + al.setWidth("400px"); + al.setHeight("100px"); + addComponent(createWrappedTextField(al)); + addComponent(createWrappedTextField(new CssLayout())); + } + + /** + * @since + * @param gridLayout + * @return + */ + private Component createWrappedTextField(ComponentContainer container) { + TextField tf = new TextField(); + tf.setRequired(true); + tf.setWidth(200, Unit.PIXELS); + fields.add(tf); + container.addComponent(new Label(container.getClass().getSimpleName())); + container.addComponent(tf); + if (container instanceof AbsoluteLayout) { + ((AbsoluteLayout) container).getPosition(tf).setLeft(100.0f, + Unit.PIXELS); + ((AbsoluteLayout) container).getPosition(tf).setTop(50.0f, + Unit.PIXELS); + } + + return container; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Test for ensuring that the required indicator is visible for fields even when they would not otherwise have a caption"; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 12077; + } +} |