aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-06-28 14:52:58 +0300
committerArtur Signell <artur@vaadin.com>2013-06-28 14:54:20 +0300
commitc3540bf1596ca91226435a4456b3d0d2c91cea5f (patch)
tree4d000e9f1536f99b74d03a6e3776837563e5e352 /server/src
parentcdb8d682af602cc8731e7a63827b499c2da5144e (diff)
parentc107efcb1bdcf1528b56016dc277fdd44513077d (diff)
downloadvaadin-framework-c3540bf1596ca91226435a4456b3d0d2c91cea5f.tar.gz
vaadin-framework-c3540bf1596ca91226435a4456b3d0d2c91cea5f.zip
Merge changes from origin/7.1
3affc37 Enable using @Stylesheet with vaadin:// (#9934) 177c424 Updated Atmosphere dependency to 1.0.14.vaadin2 (#12017, #12033, #12115) dbfb9a3 Add version property to integration tests to servers know if it is a Vaadin 6 or 7 test e371001 Ensure caption is used when child is set to required (#12077) 90ed657 Use atmosphere 1.0.14.vaadin3 which fixes Android 4.1 support (#12101) 6f2db49 Include Atmosphere fix for Android 4.1 (#12101) c4ec786 Things now align better in SimpleTree, for #12058 172d704 Actually show loading indicator during loading (#12128) 6c10136 Use varargs instead of array where appropriate (#4513) 939095a Debug window poll interval claims interval is in seconds and not milliseconds (#12098) 68f025f The 'license.html' file has flaw in the HTML (unclosed span tag) (#11952) c107efc Remove sub window references from Window javadocs (#9892) Change-Id: Id386718b46f87a91708a51d70cdb5b47a0157e8b
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/annotations/StyleSheet.java5
-rw-r--r--server/src/com/vaadin/data/Buffered.java15
-rw-r--r--server/src/com/vaadin/data/Validator.java2
-rw-r--r--server/src/com/vaadin/data/util/BeanItem.java2
-rw-r--r--server/src/com/vaadin/data/util/sqlcontainer/RowId.java2
-rw-r--r--server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java2
-rw-r--r--server/src/com/vaadin/event/ShortcutAction.java6
-rw-r--r--server/src/com/vaadin/server/BootstrapHandler.java1
-rw-r--r--server/src/com/vaadin/server/CompositeErrorMessage.java6
-rw-r--r--server/src/com/vaadin/server/Constants.java2
-rw-r--r--server/src/com/vaadin/ui/Form.java2
-rw-r--r--server/src/com/vaadin/ui/Table.java6
-rw-r--r--server/src/com/vaadin/ui/Window.java113
13 files changed, 73 insertions, 91 deletions
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();