summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2015-03-12 16:03:15 +0200
committerHenrik Paul <henrik@vaadin.com>2015-03-12 16:03:33 +0200
commitf61cf666f3d28ac57b6c3cd5de30d9b54814d683 (patch)
tree939c0e8a2cc4fbca39b458f39c37dd6a898a0f08
parentf31a927acb4168497f6f25ab68120dd9fa03e636 (diff)
parent5692572146f7029c51b129ff30c89dd30d9c788d (diff)
downloadvaadin-framework-f61cf666f3d28ac57b6c3cd5de30d9b54814d683.tar.gz
vaadin-framework-f61cf666f3d28ac57b6c3cd5de30d9b54814d683.zip
Merge branch 'master' into detailsrow
Change-Id: Ie0556ae8d56596d5e1894b3a62d39b0afe13b5a3
-rw-r--r--WebContent/VAADIN/themes/base/table/table.scss6
-rw-r--r--client/src/com/vaadin/client/ApplicationConnection.java215
-rw-r--r--client/src/com/vaadin/client/DeferredWorker.java12
-rw-r--r--client/src/com/vaadin/client/LayoutManager.java44
-rw-r--r--client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java26
-rw-r--r--client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java2
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java2
-rw-r--r--eclipse/Super Development Mode (vaadin).launch2
-rw-r--r--push/build.xml2
-rw-r--r--push/ivy.xml2
-rwxr-xr-xscripts/updatePushVersion.sh55
-rw-r--r--server/src/com/vaadin/server/Constants.java2
-rw-r--r--server/src/com/vaadin/server/DownloadStream.java30
-rw-r--r--server/src/com/vaadin/server/FileDownloader.java6
-rw-r--r--server/src/com/vaadin/server/communication/AtmospherePushConnection.java2
-rw-r--r--server/src/com/vaadin/server/communication/PushHandler.java20
-rw-r--r--server/src/com/vaadin/ui/Flash.java10
-rw-r--r--server/src/com/vaadin/ui/Grid.java2
-rw-r--r--server/src/com/vaadin/ui/Slider.java2
-rw-r--r--server/src/com/vaadin/ui/declarative/DesignContext.java21
-rw-r--r--server/tests/src/com/vaadin/server/FileDownloaderTests.java41
-rw-r--r--server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java25
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java9
-rw-r--r--uitest/integration-testscripts/eXo-3/integration-test-eXo-3.0.3-portlet2.html328
-rw-r--r--uitest/integration_tests.xml19
-rw-r--r--uitest/src/com/vaadin/tests/components/table/SelectableEditableTest.java18
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java6
-rw-r--r--uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java44
-rw-r--r--uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFieldsTest.java105
-rw-r--r--uitest/tb2/com/vaadin/tests/components/table/SelectableEditable.html32
-rw-r--r--uitest/tb2/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html147
-rw-r--r--uitest/test.xml2
32 files changed, 456 insertions, 783 deletions
diff --git a/WebContent/VAADIN/themes/base/table/table.scss b/WebContent/VAADIN/themes/base/table/table.scss
index f500d2f12a..22ffdffa4d 100644
--- a/WebContent/VAADIN/themes/base/table/table.scss
+++ b/WebContent/VAADIN/themes/base/table/table.scss
@@ -247,6 +247,12 @@
.v-off {
color: #ddd;
}
+
+/* CheckBox and selection fix #9064 */
+.#{$primaryStyleName} .v-checkbox {
+ display: inline-block;
+}
+
/*************************************
* Drag'n'drop styles
*************************************/
diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java
index f88a3b6f63..1b3196e1c2 100644
--- a/client/src/com/vaadin/client/ApplicationConnection.java
+++ b/client/src/com/vaadin/client/ApplicationConnection.java
@@ -62,7 +62,6 @@ import com.google.gwt.user.client.Window.ClosingHandler;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConfiguration.ErrorMessage;
-import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent;
import com.vaadin.client.ResourceLoader.ResourceLoadEvent;
import com.vaadin.client.ResourceLoader.ResourceLoadListener;
import com.vaadin.client.communication.HasJavaScriptConnectorHelper;
@@ -94,7 +93,6 @@ import com.vaadin.client.ui.VOverlay;
import com.vaadin.client.ui.dd.VDragAndDropManager;
import com.vaadin.client.ui.ui.UIConnector;
import com.vaadin.client.ui.window.WindowConnector;
-import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.ApplicationConstants;
import com.vaadin.shared.JsonConstants;
import com.vaadin.shared.VaadinUriResolver;
@@ -115,14 +113,14 @@ import elemental.json.JsonValue;
* This is the client side communication "engine", managing client-server
* communication with its server side counterpart
* com.vaadin.server.VaadinService.
- *
+ *
* Client-side connectors receive updates from the corresponding server-side
* connector (typically component) as state updates or RPC calls. The connector
* has the possibility to communicate back with its server side counter part
* through RPC calls.
- *
+ *
* TODO document better
- *
+ *
* Entry point classes (widgetsets) define <code>onModuleLoad()</code>.
*/
public class ApplicationConnection implements HasHandlers {
@@ -166,12 +164,12 @@ public class ApplicationConnection implements HasHandlers {
* A string that, if found in a non-JSON response to a UIDL request, will
* cause the browser to refresh the page. If followed by a colon, optional
* whitespace, and a URI, causes the browser to synchronously load the URI.
- *
+ *
* <p>
* This allows, for instance, a servlet filter to redirect the application
* to a custom login page when the session expires. For example:
* </p>
- *
+ *
* <pre>
* if (sessionExpired) {
* response.setHeader(&quot;Content-Type&quot;, &quot;text/html&quot;);
@@ -354,7 +352,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Event triggered when a XHR request has finished with the status code of
* the response.
- *
+ *
* Useful for handlers observing network failures like online/off-line
* monitors.
*/
@@ -410,12 +408,12 @@ public class ApplicationConnection implements HasHandlers {
/**
* Event triggered when a application is stopped by calling
* {@link ApplicationConnection#setApplicationRunning(false)}.
- *
+ *
* To listen for the event add a {@link ApplicationStoppedHandler} by
* invoking
* {@link ApplicationConnection#addHandler(ApplicationConnection.ApplicationStoppedEvent.Type, ApplicationStoppedHandler)}
* to the {@link ApplicationConnection}
- *
+ *
* @since 7.1.8
* @author Vaadin Ltd
*/
@@ -442,7 +440,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Called when a communication error has occurred. Returning
* <code>true</code> from this method suppresses error handling.
- *
+ *
* @param details
* A string describing the error.
* @param statusCode
@@ -457,7 +455,7 @@ public class ApplicationConnection implements HasHandlers {
* A listener for listening to application stopped events. The listener can
* be added to a {@link ApplicationConnection} by invoking
* {@link ApplicationConnection#addHandler(ApplicationStoppedEvent.Type, ApplicationStoppedHandler)}
- *
+ *
* @since 7.1.8
* @author Vaadin Ltd
*/
@@ -467,7 +465,7 @@ public class ApplicationConnection implements HasHandlers {
* Triggered when the {@link ApplicationConnection} marks a previously
* running application as stopped by invoking
* {@link ApplicationConnection#setApplicationRunning(false)}
- *
+ *
* @param event
* the event triggered by the {@link ApplicationConnection}
*/
@@ -599,7 +597,7 @@ public class ApplicationConnection implements HasHandlers {
* called once this application has started (first response received) or
* failed to start. This ensures that the applications are started in order,
* to avoid session-id problems.
- *
+ *
*/
public void start() {
String jsonText = configuration.getUIDL();
@@ -709,7 +707,7 @@ public class ApplicationConnection implements HasHandlers {
* <li><code>vaadin.postRequestHooks</code> is a map of functions which gets
* called after each XHR made by vaadin application. Note, that it is
* attaching js functions responsibility to create the variable like this:
- *
+ *
* <code><pre>
* if(!vaadin.postRequestHooks) {vaadin.postRequestHooks = new Object();}
* postRequestHooks.myHook = function(appId) {
@@ -720,7 +718,7 @@ public class ApplicationConnection implements HasHandlers {
* </pre></code> First parameter passed to these functions is the identifier
* of Vaadin application that made the request.
* </ul>
- *
+ *
* TODO make this multi-app aware
*/
private native void initializeClientHooks()
@@ -751,7 +749,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Runs possibly registered client side post request hooks. This is expected
* to be run after each uidl request made by Vaadin application.
- *
+ *
* @param appId
*/
private static native void runPostRequestHooks(String appId)
@@ -771,7 +769,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* If on Liferay and logged in, ask the client side session management
* JavaScript to extend the session duration.
- *
+ *
* Otherwise, Liferay client side JavaScript will explicitly expire the
* session even though the server side considers the session to be active.
* See ticket #8305 for more information.
@@ -790,7 +788,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Indicates whether or not there are currently active UIDL requests. Used
* internally to sequence requests properly, seldom needed in Widgets.
- *
+ *
* @return true if there are active requests
*/
public boolean hasActiveRequest() {
@@ -810,7 +808,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Requests an analyze of layouts, to find inconsistencies. Exclusively used
* for debugging during development.
- *
+ *
* @deprecated as of 7.1. Replaced by {@link UIConnector#analyzeLayouts()}
*/
@Deprecated
@@ -822,7 +820,7 @@ public class ApplicationConnection implements HasHandlers {
* Sends a request to the server to print details to console that will help
* the developer to locate the corresponding server-side connector in the
* source code.
- *
+ *
* @param serverConnector
* @deprecated as of 7.1. Replaced by
* {@link UIConnector#showServerDebugInfo(ServerConnector)}
@@ -834,7 +832,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Makes an UIDL request to the server.
- *
+ *
* @param reqInvocations
* Data containing RPC invocations and all related information.
* @param extraParams
@@ -872,7 +870,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Sends an asynchronous or synchronous UIDL request to the server using the
* given URI.
- *
+ *
* @param uri
* The URI to use for the request. May includes GET parameters
* @param payload
@@ -947,8 +945,7 @@ public class ApplicationConnection implements HasHandlers {
}
}).schedule(100);
} else {
- handleError(
- "Invalid status code 0 (server down?)",
+ handleError("Invalid status code 0 (server down?)",
statusCode);
}
return;
@@ -993,8 +990,8 @@ public class ApplicationConnection implements HasHandlers {
} else if ((statusCode / 100) == 5) {
// Something's wrong on the server, there's nothing the
// client can do except maybe try again.
- handleError("Server error. Error code: "
- + statusCode, statusCode);
+ handleError("Server error. Error code: " + statusCode,
+ statusCode);
return;
}
@@ -1039,7 +1036,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Handles received UIDL JSON text, parsing it, and passing it on to the
* appropriate handlers, while logging timing information.
- *
+ *
* @param jsonText
* @param statusCode
*/
@@ -1076,7 +1073,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Sends an asynchronous UIDL request to the server using the given URI.
- *
+ *
* @param uri
* The URI to use for the request. May includes GET parameters
* @param payload
@@ -1211,7 +1208,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Checks whether or not the CSS is loaded. By default checks the size of
* the loading indicator element.
- *
+ *
* @return
*/
protected boolean isCSSLoaded() {
@@ -1221,12 +1218,12 @@ public class ApplicationConnection implements HasHandlers {
/**
* Shows the communication error notification.
- *
+ *
* @param details
* Optional details for debugging.
* @param statusCode
* The status code returned for the request
- *
+ *
*/
protected void showCommunicationError(String details, int statusCode) {
VConsole.error("Communication error: " + details);
@@ -1235,7 +1232,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Shows the authentication error notification.
- *
+ *
* @param details
* Optional details for debugging.
*/
@@ -1246,7 +1243,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Shows the session expiration notification.
- *
+ *
* @param details
* Optional details for debugging.
*/
@@ -1257,7 +1254,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Shows an error notification.
- *
+ *
* @param details
* Optional details for debugging.
* @param message
@@ -1270,7 +1267,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Shows the error notification.
- *
+ *
* @param details
* Optional details for debugging.
*/
@@ -1357,7 +1354,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* This method is called after applying uidl change set to application.
- *
+ *
* It will clean current and queued variable change sets. And send next
* change set if it exists.
*/
@@ -1376,7 +1373,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Cleans given queue of variable changes of such changes that came from
* components that do not exist anymore.
- *
+ *
* @param variableBurst
*/
private void cleanVariableBurst(
@@ -1403,20 +1400,25 @@ public class ApplicationConnection implements HasHandlers {
int size = connectors.size();
for (int i = 0; i < size; i++) {
ServerConnector conn = connectors.get(i);
- ComponentConnector compConn = null;
+ if (isWorkPending(conn)) {
+ return true;
+ }
+
if (conn instanceof ComponentConnector) {
- compConn = (ComponentConnector) conn;
- Widget wgt = compConn.getWidget();
- if (wgt instanceof DeferredWorker) {
- if (((DeferredWorker) wgt).isWorkPending()) {
- return true;
- }
+ ComponentConnector compConn = (ComponentConnector) conn;
+ if (isWorkPending(compConn.getWidget())) {
+ return true;
}
}
}
return false;
}
+ private static boolean isWorkPending(Object object) {
+ return object instanceof DeferredWorker
+ && ((DeferredWorker) object).isWorkPending();
+ }
+
/**
* Checks if deferred commands are (potentially) still being executed as a
* result of an update from the server. Returns true if a deferred command
@@ -1425,7 +1427,7 @@ public class ApplicationConnection implements HasHandlers {
* <p>
* Used by the native "client.isActive" function.
* </p>
- *
+ *
* @return true if deferred commands are (potentially) being executed, false
* otherwise
*/
@@ -1440,7 +1442,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Returns the loading indicator used by this ApplicationConnection
- *
+ *
* @return The loading indicator for this ApplicationConnection
*/
public VLoadingIndicator getLoadingIndicator() {
@@ -1449,7 +1451,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Determines whether or not the loading indicator is showing.
- *
+ *
* @return true if the loading indicator is visible
* @deprecated As of 7.1. Use {@link #getLoadingIndicator()} and
* {@link VLoadingIndicator#isVisible()}.isVisible() instead.
@@ -1483,7 +1485,7 @@ public class ApplicationConnection implements HasHandlers {
* server is received.
* <p>
* The initial id when no request has yet been processed is -1.
- *
+ *
* @return and id identifying the response
*/
public int getLastResponseId() {
@@ -1923,13 +1925,13 @@ public class ApplicationConnection implements HasHandlers {
/**
* Sends the state change events created while updating the state
* information.
- *
+ *
* This must be called after hierarchy change listeners have been
* called. At least caption updates for the parent are strange if
* fired from state change listeners and thus calls the parent
* BEFORE the parent is aware of the child (through a
* ConnectorHierarchyChangedEvent)
- *
+ *
* @param pendingStateChangeEvents
* The events to send
*/
@@ -2285,7 +2287,7 @@ public class ApplicationConnection implements HasHandlers {
* Updates the connector hierarchy and returns a list of events that
* should be fired after update of the hierarchy and the state is
* done.
- *
+ *
* @param json
* The JSON containing the hierarchy information
* @return A collection of events that should be fired when update
@@ -2697,9 +2699,9 @@ public class ApplicationConnection implements HasHandlers {
/**
* Adds an explicit RPC method invocation to the send queue.
- *
+ *
* @since 7.0
- *
+ *
* @param invocation
* RPC method invocation
* @param delayed
@@ -2739,7 +2741,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Removes any pending invocation of the given method from the queue
- *
+ *
* @param invocation
* The invocation to remove
*/
@@ -2757,12 +2759,12 @@ public class ApplicationConnection implements HasHandlers {
/**
* This method sends currently queued variable changes to server. It is
* called when immediate variable update must happen.
- *
+ *
* To ensure correct order for variable changes (due servers multithreading
* or network), we always wait for active request to be handler before
* sending a new one. If there is an active request, we will put varible
* "burst" to queue that will be purged after current request is handled.
- *
+ *
*/
public void sendPendingVariableChanges() {
if (!deferredSendPending) {
@@ -2803,11 +2805,11 @@ public class ApplicationConnection implements HasHandlers {
/**
* Build the variable burst and send it to server.
- *
+ *
* When sync is forced, we also force sending of all pending variable-bursts
* at the same time. This is ok as we can assume that DOM will never be
* updated after this.
- *
+ *
* @param pendingInvocations
* List of RPC method invocations to send
*/
@@ -2901,7 +2903,7 @@ public class ApplicationConnection implements HasHandlers {
* is true, the update is sent as soon as possible. If immediate is false,
* the update will be sent along with the next immediate update.
* </p>
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -2923,7 +2925,7 @@ public class ApplicationConnection implements HasHandlers {
* is true, the update is sent as soon as possible. If immediate is false,
* the update will be sent along with the next immediate update.
* </p>
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -2946,7 +2948,7 @@ public class ApplicationConnection implements HasHandlers {
* is true, the update is sent as soon as possible. If immediate is false,
* the update will be sent along with the next immediate update.
* </p>
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -2969,7 +2971,7 @@ public class ApplicationConnection implements HasHandlers {
* is true, the update is sent as soon as possible. If immediate is false,
* the update will be sent along with the next immediate update.
* </p>
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -2992,7 +2994,7 @@ public class ApplicationConnection implements HasHandlers {
* is true, the update is sent as soon as possible. If immediate is false,
* the update will be sent along with the next immediate update.
* </p>
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -3015,7 +3017,7 @@ public class ApplicationConnection implements HasHandlers {
* is true, the update is sent as soon as possible. If immediate is false,
* the update will be sent along with the next immediate update.
* </p>
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -3038,7 +3040,7 @@ public class ApplicationConnection implements HasHandlers {
* is true, the update is sent as soon as possible. If immediate is false,
* the update will be sent along with the next immediate update.
* </p>
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -3061,7 +3063,7 @@ public class ApplicationConnection implements HasHandlers {
* is true, the update is sent as soon as possible. If immediate is false,
* the update will be sent along with the next immediate update.
* </p>
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -3078,13 +3080,13 @@ public class ApplicationConnection implements HasHandlers {
/**
* Sends a new value for the given paintables given variable to the server.
- *
+ * <p>
* The update is actually queued to be sent at a suitable time. If immediate
* is true, the update is sent as soon as possible. If immediate is false,
* the update will be sent along with the next immediate update.
- *
+ * <p>
* A null array is sent as an empty array.
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -3101,14 +3103,13 @@ public class ApplicationConnection implements HasHandlers {
/**
* Sends a new value for the given paintables given variable to the server.
- *
+ * <p>
* The update is actually queued to be sent at a suitable time. If immediate
* is true, the update is sent as soon as possible. If immediate is false,
- * the update will be sent along with the next immediate update. </p>
- *
+ * the update will be sent along with the next immediate update.
+ * <p>
* A null array is sent as an empty array.
- *
- *
+ *
* @param paintableId
* the id of the paintable that owns the variable
* @param variableName
@@ -3125,7 +3126,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Does absolutely nothing. Replaced by {@link LayoutManager}.
- *
+ *
* @param container
* @deprecated As of 7.0, serves no purpose
*/
@@ -3147,7 +3148,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Returns false
- *
+ *
* @param paintable
* @return false, always
* @deprecated As of 7.0, serves no purpose
@@ -3159,7 +3160,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Returns false
- *
+ *
* @param paintable
* @return false, always
* @deprecated As of 7.0, serves no purpose
@@ -3180,16 +3181,16 @@ public class ApplicationConnection implements HasHandlers {
/**
* Get either an existing ComponentConnector or create a new
* ComponentConnector with the given type and id.
- *
+ *
* If a ComponentConnector with the given id already exists, returns it.
* Otherwise creates and registers a new ComponentConnector of the given
* type.
- *
+ *
* @param connectorId
* Id of the paintable
* @param connectorType
* Type of the connector, as passed from the server side
- *
+ *
* @return Either an existing ComponentConnector or a new ComponentConnector
* of the given type
*/
@@ -3202,15 +3203,15 @@ public class ApplicationConnection implements HasHandlers {
/**
* Creates a new ServerConnector with the given type and id.
- *
+ *
* Creates and registers a new ServerConnector of the given type. Should
* never be called with the connector id of an existing connector.
- *
+ *
* @param connectorId
* Id of the new connector
* @param connectorType
* Type of the connector, as passed from the server side
- *
+ *
* @return A new ServerConnector of the given type
*/
private ServerConnector createAndRegisterConnector(String connectorId,
@@ -3230,7 +3231,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Gets a recource that has been pre-loaded via UIDL, such as custom
* layouts.
- *
+ *
* @param name
* identifier of the resource to get
* @return the resource
@@ -3241,7 +3242,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Singleton method to get instance of app's context menu.
- *
+ *
* @return VContextMenu object
*/
public VContextMenu getContextMenu() {
@@ -3256,7 +3257,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Gets an {@link Icon} instance corresponding to a URI.
- *
+ *
* @since 7.2
* @param uri
* @return Icon object
@@ -3278,7 +3279,7 @@ public class ApplicationConnection implements HasHandlers {
* Translates custom protocols in UIDL URI's to be recognizable by browser.
* All uri's from UIDL should be routed via this method before giving them
* to browser due URI's in UIDL may contain custom protocols like theme://.
- *
+ *
* @param uidlUri
* Vaadin URI from uidl
* @return translated URI ready for browser
@@ -3290,7 +3291,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Gets the URI for the current theme. Can be used to reference theme
* resources.
- *
+ *
* @return URI to the current theme
*/
public String getThemeUri() {
@@ -3301,7 +3302,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Listens for Notification hide event, and redirects. Used for system
* messages, such as session expired.
- *
+ *
*/
private class NotificationRedirect implements VNotification.EventListener {
String url;
@@ -3330,7 +3331,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Gets the token (aka double submit cookie) that the server uses to protect
* against Cross Site Request Forgery attacks.
- *
+ *
* @return the CSRF token string
*/
public String getCsrfToken() {
@@ -3340,7 +3341,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Use to notify that the given component's caption has changed; layouts may
* have to be recalculated.
- *
+ *
* @param component
* the Paintable whose caption has changed
* @deprecated As of 7.0.2, has not had any effect for a long time
@@ -3352,7 +3353,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Gets the main view
- *
+ *
* @return the main view
*/
public UIConnector getUIConnector() {
@@ -3361,7 +3362,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Gets the {@link ApplicationConfiguration} for the current application.
- *
+ *
* @see ApplicationConfiguration
* @return the configuration for this application
*/
@@ -3374,7 +3375,7 @@ public class ApplicationConnection implements HasHandlers {
* list of events which has server side listeners is updated automatically
* before the component is updated so the value is correct if called from
* updatedFromUIDL.
- *
+ *
* @param paintable
* The connector to register event listeners for
* @param eventIdentifier
@@ -3394,7 +3395,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Adds the get parameters to the uri and returns the new uri that contains
* the parameters.
- *
+ *
* @param uri
* The uri to which the parameters should be added.
* @param extraParams
@@ -3424,7 +3425,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Get VTooltip instance related to application connection
- *
+ *
* @return VTooltip instance
*/
public VTooltip getVTooltip() {
@@ -3436,7 +3437,7 @@ public class ApplicationConnection implements HasHandlers {
* this method is now handled by the state change event handler in
* AbstractComponentConnector. The only function this method has is to
* return true if the UIDL is a "cached" update.
- *
+ *
* @param component
* @param uidl
* @param manageCaption
@@ -3487,7 +3488,7 @@ public class ApplicationConnection implements HasHandlers {
* Schedules a heartbeat request to occur after the configured heartbeat
* interval elapses if the interval is a positive number. Otherwise, does
* nothing.
- *
+ *
* @deprecated as of 7.2, use {@link Heartbeat#schedule()} instead
*/
@Deprecated
@@ -3501,7 +3502,7 @@ public class ApplicationConnection implements HasHandlers {
* Heartbeat requests are used to inform the server that the client-side is
* still alive. If the client page is closed or the connection lost, the
* server will eventually close the inactive UI.
- *
+ *
* @deprecated as of 7.2, use {@link Heartbeat#send()} instead
*/
@Deprecated
@@ -3525,7 +3526,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* This method can be used to postpone rendering of a response for a short
* period of time (e.g. to avoid the rendering process during animation).
- *
+ *
* @param lock
*/
public void suspendReponseHandling(Object lock) {
@@ -3534,7 +3535,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Resumes the rendering process once all locks have been removed.
- *
+ *
* @param lock
*/
public void resumeResponseHandling(Object lock) {
@@ -3585,7 +3586,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Sets the delegate that is called whenever a communication error occurrs.
- *
+ *
* @param delegate
* the delegate.
*/
@@ -3628,7 +3629,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Gets the active connector for focused element in browser.
- *
+ *
* @return Connector for focused element or null.
*/
private ComponentConnector getActiveConnector() {
@@ -3642,7 +3643,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Sets the status for the push connection.
- *
+ *
* @param enabled
* <code>true</code> to enable the push connection;
* <code>false</code> to disable the push connection.
@@ -3655,7 +3656,7 @@ public class ApplicationConnection implements HasHandlers {
push.init(this, pushState, new CommunicationErrorHandler() {
@Override
public boolean onError(String details, int statusCode) {
- handleCommunicationError(details,statusCode);
+ handleCommunicationError(details, statusCode);
return true;
}
});
@@ -3692,7 +3693,7 @@ public class ApplicationConnection implements HasHandlers {
/**
* Returns a human readable string representation of the method used to
* communicate with the server.
- *
+ *
* @since 7.1
* @return A string representation of the current transport type
*/
diff --git a/client/src/com/vaadin/client/DeferredWorker.java b/client/src/com/vaadin/client/DeferredWorker.java
index 8e78bd9bff..cc22cda2a2 100644
--- a/client/src/com/vaadin/client/DeferredWorker.java
+++ b/client/src/com/vaadin/client/DeferredWorker.java
@@ -16,18 +16,18 @@
package com.vaadin.client;
/**
- * Give widgets the possibility to indicate to the framework that there is work
- * scheduled to be executed in the near future and that the framework should
- * wait for this work to complete before assuming the UI has reached a steady
- * state.
+ * Give widgets and connectors the possibility to indicate to the framework that
+ * there is work scheduled to be executed in the near future and that the
+ * framework should wait for this work to complete before assuming the UI has
+ * reached a steady state.
*
* @since 7.3
* @author Vaadin Ltd
*/
public interface DeferredWorker {
/**
- * Checks whether there are operations pending for this widget that must be
- * executed before reaching a steady state.
+ * Checks whether there are operations pending for this widget or connector
+ * that must be executed before reaching a steady state.
*
* @returns <code>true</code> iff there are operations pending which must be
* executed before reaching a steady state
diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java
index f77b61a5a3..828f0942b7 100644
--- a/client/src/com/vaadin/client/LayoutManager.java
+++ b/client/src/com/vaadin/client/LayoutManager.java
@@ -310,8 +310,11 @@ public class LayoutManager {
dump = needsMeasure.dump();
dumpLength = dump.length();
for (int i = 0; i < dumpLength; i++) {
- String layoutId = dump.get(i);
- currentDependencyTree.setNeedsMeasure(layoutId, true);
+ ServerConnector connector = connectorMap.getConnector(dump.get(i));
+ if (connector != null) {
+ currentDependencyTree.setNeedsMeasure(
+ (ComponentConnector) connector, true);
+ }
}
needsMeasure = FastStringSet.create();
@@ -605,15 +608,7 @@ public class LayoutManager {
ComponentConnector componentConnector = (ComponentConnector) connectorMap
.getConnector(connectorId);
- // Delay the overflow fix if the involved connectors might still
- // change
- boolean connectorChangesExpected = !currentDependencyTree
- .noMoreChangesExpected(componentConnector);
- boolean parentChangesExcpected = componentConnector.getParent() instanceof ComponentConnector
- && !currentDependencyTree
- .noMoreChangesExpected((ComponentConnector) componentConnector
- .getParent());
- if (connectorChangesExpected || parentChangesExcpected) {
+ if (delayOverflowFix(componentConnector)) {
delayedOverflowFixes.add(connectorId);
continue;
}
@@ -669,7 +664,7 @@ public class LayoutManager {
parentElement.getStyle().setProperty("overflow",
originalOverflows.get(parentElement));
- layoutDependencyTree.setNeedsMeasure(connectorId, true);
+ layoutDependencyTree.setNeedsMeasure(componentConnector, true);
}
Profiler.leave("Overflow fix restore");
@@ -703,8 +698,7 @@ public class LayoutManager {
measureConnector(connectors.get(i));
}
for (int i = 0; i < connectorCount; i++) {
- layoutDependencyTree.setNeedsMeasure(connectors.get(i)
- .getConnectorId(), false);
+ layoutDependencyTree.setNeedsMeasure(connectors.get(i), false);
}
measureCount += connectorCount;
@@ -723,8 +717,9 @@ public class LayoutManager {
measureCount++;
}
for (int i = 0; i < length; i++) {
- String connectorId = measureTargets.get(i);
- layoutDependencyTree.setNeedsMeasure(connectorId, false);
+ ComponentConnector connector = (ComponentConnector) connectorMap
+ .getConnector(measureTargets.get(i));
+ layoutDependencyTree.setNeedsMeasure(connector, false);
}
}
Profiler.leave("Layout measure from tree");
@@ -732,6 +727,23 @@ public class LayoutManager {
return measureCount;
}
+ /*
+ * Delay the overflow fix if the involved connectors might still change
+ */
+ private boolean delayOverflowFix(ComponentConnector componentConnector) {
+ if (!currentDependencyTree.noMoreChangesExpected(componentConnector)) {
+ return true;
+ }
+ ServerConnector parent = componentConnector.getParent();
+ if (parent instanceof ComponentConnector
+ && !currentDependencyTree
+ .noMoreChangesExpected((ComponentConnector) parent)) {
+ return true;
+ }
+
+ return false;
+ }
+
private void measureConnector(ComponentConnector connector) {
Profiler.enter("LayoutManager.measureConnector");
Element element = connector.getWidget().getElement();
diff --git a/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java b/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java
index da3aed4bbc..07bb6688e3 100644
--- a/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java
+++ b/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java
@@ -429,6 +429,15 @@ public class LayoutDependencyTree {
setNeedsVerticalMeasure(connector, needsMeasure);
}
+ /**
+ * @param connectorId
+ * @param needsMeasure
+ *
+ * @deprecated As of 7.4.2, use
+ * {@link #setNeedsMeasure(ComponentConnector, boolean)} for
+ * improved performance.
+ */
+ @Deprecated
public void setNeedsMeasure(String connectorId, boolean needsMeasure) {
ComponentConnector connector = (ComponentConnector) ConnectorMap.get(
connection).getConnector(connectorId);
@@ -690,19 +699,10 @@ public class LayoutDependencyTree {
}
public JsArrayString getMeasureTargetsJsArray() {
- FastStringSet horizontalQueue = getMeasureQueue(HORIZONTAL);
- JsArrayString measureTargets = horizontalQueue.dump();
-
- JsArrayString verticalDump = getMeasureQueue(VERTICAL).dump();
- int length = verticalDump.length();
- for (int i = 0; i < length; i++) {
- String connectorId = verticalDump.get(i);
- if (!horizontalQueue.contains(connectorId)) {
- measureTargets.push(connectorId);
- }
- }
-
- return measureTargets;
+ FastStringSet allMeasuredTargets = FastStringSet.create();
+ allMeasuredTargets.addAll(getMeasureQueue(HORIZONTAL));
+ allMeasuredTargets.addAll(getMeasureQueue(VERTICAL));
+ return allMeasuredTargets.dump();
}
public void logDependencyStatus(ComponentConnector connector) {
diff --git a/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java b/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java
index 2345641408..2b33d7103f 100644
--- a/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java
+++ b/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java
@@ -518,6 +518,8 @@ public abstract class ScrollbarBundle implements DeferredWorker {
* Should be called whenever this bundle is attached to the DOM (typically,
* from the onLoad of the containing widget). Used to ensure the DOM scroll
* position is maintained when detaching and reattaching the bundle.
+ *
+ * @since 7.4.1
*/
public void onLoad() {
internalSetScrollPos(toInt32(scrollPos));
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index aa768f9f21..b3906591c0 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -6411,7 +6411,7 @@ public class Grid<T> extends ResizeComposite implements
* cannot rely on the columns being the correct width after the call
* returns.
*
- * @since
+ * @since 7.4.1
*/
public void recalculateColumnWidths() {
autoColumnWidthsRecalculator.schedule();
diff --git a/eclipse/Super Development Mode (vaadin).launch b/eclipse/Super Development Mode (vaadin).launch
index b57410bfd6..9f4da19a74 100644
--- a/eclipse/Super Development Mode (vaadin).launch
+++ b/eclipse/Super Development Mode (vaadin).launch
@@ -21,7 +21,7 @@
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.codeserver.CodeServer"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="com.vaadin.DefaultWidgetSet -bindAddress 0.0.0.0"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-noprecompile -bindAddress 0.0.0.0 com.vaadin.DefaultWidgetSet com.vaadin.tests.widgetset.TestingWidgetSet"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="vaadin"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512M -XX:MaxPermSize=256M"/>
</launchConfiguration>
diff --git a/push/build.xml b/push/build.xml
index 519dc81ed2..336c3629aa 100644
--- a/push/build.xml
+++ b/push/build.xml
@@ -18,7 +18,7 @@
location="${result.dir}/js/VAADIN/vaadinPush.debug.js" />
<!-- Keep the version number in sync with ivy.xml, server/src/com/vaadin/server/Constants.java -->
- <property name="atmosphere.runtime.version" value="2.2.4.vaadin4" />
+ <property name="atmosphere.runtime.version" value="2.2.4.vaadin5" />
<property name="jquery.js" location="lib/jquery/jquery-1.11.0.js" />
<path id="classpath.compile.custom" />
diff --git a/push/ivy.xml b/push/ivy.xml
index c285bfd4aa..605f5d1a05 100644
--- a/push/ivy.xml
+++ b/push/ivy.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ivy-module [
<!-- Keep the version number in sync with build.xml -->
- <!ENTITY atmosphere.runtime.version "2.2.4.vaadin4">
+ <!ENTITY atmosphere.runtime.version "2.2.4.vaadin5">
<!ENTITY atmosphere.js.version "2.2.6.vaadin3">
]>
diff --git a/scripts/updatePushVersion.sh b/scripts/updatePushVersion.sh
new file mode 100755
index 0000000000..d2e83e0454
--- /dev/null
+++ b/scripts/updatePushVersion.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+if [ "$#" != "2" ]
+then
+ echo "Usage: $0 <runtime version> <js version>"
+ echo "If the runtime version contains the string 'vaadin', then a vaadin atmosphere version will be assumed, otherwise an upstream atmosphere version".
+ echo "If a version is set to -, the version will not be updated"
+ exit 1
+fi
+
+pushd `dirname $0`/.. > /dev/null
+basedir=`pwd`
+popd > /dev/null
+
+currentRuntime=`grep ENTITY "$basedir"/push/ivy.xml|grep runtime.version|cut -d\" -f 2`
+currentJs=`grep ENTITY "$basedir"/push/ivy.xml|grep js.version|cut -d\" -f 2`
+
+sed=`which sed`
+
+uname|grep Darwin > /dev/null
+if [ "$?" = "0" ]
+then
+ # Mac if uname output contains Darwin
+ sed=`which gsed`
+ if [ "$sed" = "" ]
+ then
+ echo "Install gnu sed (gsed) using e.g. brew install gnu-sed"
+ exit 2
+ fi
+fi
+
+echo "Currently using runtime $currentRuntime and JS $currentJs"
+
+newRuntime=$1
+newJs=$2
+
+if [ "$newRuntime" != "-" ]
+then
+ echo "Updating runtime to $newRuntime..."
+ $sed -i "s#$currentRuntime#$newRuntime#" "$basedir"/push/ivy.xml
+ $sed -i "s/$currentRuntime/$newRuntime/g" "$basedir"/push/build.xml
+ $sed -i "s/$currentRuntime/$newRuntime/g" "$basedir"/server/src/com/vaadin/server/Constants.java
+ if [[ $newRuntime == *"vaadin"* ]]
+ then
+ $sed -i "s/org.atmosphere/com.vaadin.external.atmosphere/g" "$basedir"/push/ivy.xml
+ else
+ $sed -i "s/com.vaadin.external.atmosphere/org.atmosphere/g" "$basedir"/push/ivy.xml
+ fi
+fi
+
+if [ "$newJs" != "-" ]
+then
+ echo "Updating JS to $newJs..."
+ $sed -i "s/$currentJs/$newJs/g" "$basedir"/push/ivy.xml
+fi
diff --git a/server/src/com/vaadin/server/Constants.java b/server/src/com/vaadin/server/Constants.java
index b9a43a98de..b7c2a1ff3e 100644
--- a/server/src/com/vaadin/server/Constants.java
+++ b/server/src/com/vaadin/server/Constants.java
@@ -67,7 +67,7 @@ public interface Constants {
// Keep the version number in sync with push/build.xml and other locations
// listed in that file
- static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.2.4.vaadin4";
+ static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.2.4.vaadin5";
static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n"
+ "=================================================================\n"
diff --git a/server/src/com/vaadin/server/DownloadStream.java b/server/src/com/vaadin/server/DownloadStream.java
index 8b2b933bcc..681c438967 100644
--- a/server/src/com/vaadin/server/DownloadStream.java
+++ b/server/src/com/vaadin/server/DownloadStream.java
@@ -20,8 +20,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -282,9 +280,16 @@ public class DownloadStream implements Serializable {
}
}
- // Content-Disposition: attachment generally forces download
- response.setHeader("Content-Disposition",
- getContentDispositionValue());
+ // suggest local filename from DownloadStream if
+ // Content-Disposition
+ // not explicitly set
+ String contentDispositionValue = getParameter("Content-Disposition");
+ if (contentDispositionValue == null) {
+ contentDispositionValue = "filename=\"" + getFileName()
+ + "\"";
+ response.setHeader("Content-Disposition",
+ contentDispositionValue);
+ }
int bufferSize = getBufferSize();
if (bufferSize <= 0 || bufferSize > Constants.MAX_BUFFER_SIZE) {
@@ -312,21 +317,6 @@ public class DownloadStream implements Serializable {
}
}
- private String getContentDispositionValue()
- throws UnsupportedEncodingException {
- String contentDispositionValue = getParameter("Content-Disposition");
-
- if (contentDispositionValue == null) {
- String encodedFilename = URLEncoder.encode(getFileName(), "utf-8");
-
- contentDispositionValue = String.format(
- "attachment; filename=\"%s\"; filename*=utf-8''%s",
- encodedFilename, encodedFilename);
- }
-
- return contentDispositionValue;
- }
-
/**
* Helper method that tries to close an output stream and ignores any
* exceptions.
diff --git a/server/src/com/vaadin/server/FileDownloader.java b/server/src/com/vaadin/server/FileDownloader.java
index bea9922c50..42c2f76e1a 100644
--- a/server/src/com/vaadin/server/FileDownloader.java
+++ b/server/src/com/vaadin/server/FileDownloader.java
@@ -141,6 +141,12 @@ public class FileDownloader extends AbstractExtension {
}
stream = ((ConnectorResource) resource).getStream();
+ if (stream.getParameter("Content-Disposition") == null) {
+ // Content-Disposition: attachment generally forces download
+ stream.setParameter("Content-Disposition",
+ "attachment; filename=\"" + stream.getFileName() + "\"");
+ }
+
// Content-Type to block eager browser plug-ins from hijacking
// the file
if (isOverrideContentType()) {
diff --git a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java
index ab45fcfe89..357278f411 100644
--- a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java
+++ b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java
@@ -311,7 +311,7 @@ public class AtmospherePushConnection implements PushConnection {
/**
* Called when the connection to the client has been lost.
*
- * @since
+ * @since 7.4.1
*/
public void connectionLost() {
resource = null;
diff --git a/server/src/com/vaadin/server/communication/PushHandler.java b/server/src/com/vaadin/server/communication/PushHandler.java
index 22eee70aa0..c570d22086 100644
--- a/server/src/com/vaadin/server/communication/PushHandler.java
+++ b/server/src/com/vaadin/server/communication/PushHandler.java
@@ -470,23 +470,9 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter {
*/
private static void sendRefreshAndDisconnect(AtmosphereResource resource)
throws IOException {
- if (resource instanceof AtmosphereResourceImpl
- && !((AtmosphereResourceImpl) resource).isInScope()) {
- // The resource is no longer valid so we should not write
- // anything to it
- getLogger()
- .fine("sendRefreshAndDisconnect called for resource no longer in scope");
- return;
- }
-
- AtmospherePushConnection connection = new AtmospherePushConnection(null);
- connection.connect(resource);
- try {
- connection.sendMessage(VaadinService
- .createCriticalNotificationJSON(null, null, null, null));
- } finally {
- connection.disconnect();
- }
+ sendNotificationAndDisconnect(resource,
+ VaadinService.createCriticalNotificationJSON(null, null, null,
+ null));
}
/**
diff --git a/server/src/com/vaadin/ui/Flash.java b/server/src/com/vaadin/ui/Flash.java
index cd7c00087e..2d0f188b84 100644
--- a/server/src/com/vaadin/ui/Flash.java
+++ b/server/src/com/vaadin/ui/Flash.java
@@ -97,7 +97,7 @@ public class Flash extends AbstractEmbedded {
* Returns the codebase.
*
* @see #setCodebase(String)
- * @since 7.4
+ * @since 7.4.1
* @return Current codebase.
*/
public String getCodebase() {
@@ -126,7 +126,7 @@ public class Flash extends AbstractEmbedded {
* Returns the current codetype.
*
* @see #setCodetype(String)
- * @since 7.4
+ * @since 7.4.1
* @return Current codetype.
*/
public String getCodetype() {
@@ -157,7 +157,7 @@ public class Flash extends AbstractEmbedded {
* Returns current archive.
*
* @see #setArchive(String)
- * @since 7.4
+ * @since 7.4.1
* @return Current archive.
*/
public String getArchive() {
@@ -181,7 +181,7 @@ public class Flash extends AbstractEmbedded {
/**
* Returns standby.
*
- * @since
+ * @since 7.4.1
* @return Standby string.
*/
public String getStandby() {
@@ -247,7 +247,7 @@ public class Flash extends AbstractEmbedded {
*
* @see #setParameter(String, String)
* @see #getParameter(String)
- * @since 7.4
+ * @since 7.4.1
* @return An iterable with declared parameter names.
*/
public Iterable<String> getParameterNames() {
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index cf0e54156a..22ef0333c2 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -5088,7 +5088,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
* but this method can be used to force recalculation in situations when
* grid does not recalculate automatically.
*
- * @since
+ * @since 7.4.1
*/
public void recalculateColumnWidths() {
getRpcProxy(GridClientRpc.class).recalculateColumnWidths();
diff --git a/server/src/com/vaadin/ui/Slider.java b/server/src/com/vaadin/ui/Slider.java
index dad4d295bf..fab6e33cae 100644
--- a/server/src/com/vaadin/ui/Slider.java
+++ b/server/src/com/vaadin/ui/Slider.java
@@ -267,7 +267,7 @@ public class Slider extends AbstractField<Double> {
if (resolution > 0) {
// Round up to resolution
- newValue = (int) (v * Math.pow(10, resolution));
+ newValue = Math.floor(v * Math.pow(10, resolution));
newValue = newValue / Math.pow(10, resolution);
if (getMin() > newValue || getMax() < newValue) {
throw new ValueOutOfBoundsException(newValue);
diff --git a/server/src/com/vaadin/ui/declarative/DesignContext.java b/server/src/com/vaadin/ui/declarative/DesignContext.java
index 09fefd0a6b..218774c72d 100644
--- a/server/src/com/vaadin/ui/declarative/DesignContext.java
+++ b/server/src/com/vaadin/ui/declarative/DesignContext.java
@@ -278,16 +278,8 @@ public class DesignContext implements Serializable {
Class<? extends Component> componentClass) {
Component instance = instanceCache.get(componentClass);
if (instance == null) {
- try {
- instance = componentClass.newInstance();
- instanceCache.put(componentClass, instance);
- } catch (InstantiationException e) {
- throw new RuntimeException("Could not instantiate "
- + componentClass.getName());
- } catch (IllegalAccessException e) {
- throw new RuntimeException("Could not instantiate "
- + componentClass.getName());
- }
+ instance = instantiateClass(componentClass.getName());
+ instanceCache.put(componentClass, instance);
}
return instance;
}
@@ -484,6 +476,15 @@ public class DesignContext implements Serializable {
// Extract the package and class names.
String qualifiedClassName = tagNameToClassName(node);
+ return instantiateClass(qualifiedClassName);
+ }
+
+ /**
+ * Instantiates given class via ComponentFactory.
+ * @param qualifiedClassName class name to instantiate
+ * @return instance of a given class
+ */
+ private Component instantiateClass(String qualifiedClassName) {
ComponentFactory factory = Design.getComponentFactory();
Component component = factory.createComponent(qualifiedClassName, this);
diff --git a/server/tests/src/com/vaadin/server/FileDownloaderTests.java b/server/tests/src/com/vaadin/server/FileDownloaderTests.java
deleted file mode 100644
index 4e9478c570..0000000000
--- a/server/tests/src/com/vaadin/server/FileDownloaderTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.vaadin.server;
-
-import static org.mockito.Matchers.contains;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLEncoder;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class FileDownloaderTests {
- private String filename = "日本語.png";
- private DownloadStream stream;
-
- @Before
- public void setup() {
- stream = new DownloadStream(mock(InputStream.class), "", filename);
- }
-
- @Test
- public void contentDispositionFilenameIsUtf8Encoded() throws IOException {
- VaadinResponse response = mock(VaadinResponse.class);
-
- stream.writeResponse(mock(VaadinRequest.class), response);
-
- verify(response).setHeader(eq("Content-Disposition"),
- contains("attachment;"));
- String encodedFileName = URLEncoder.encode(filename, "utf-8");
- verify(response).setHeader(eq("Content-Disposition"),
- contains(String.format("filename=\"%s\";", encodedFileName)));
- verify(response)
- .setHeader(
- eq("Content-Disposition"),
- contains(String.format("filename*=utf-8''%s",
- encodedFileName)));
- }
-}
diff --git a/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java b/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java
index a5f1d288a2..4115872fb7 100644
--- a/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java
+++ b/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java
@@ -19,6 +19,8 @@ import java.io.ByteArrayInputStream;
import java.util.ArrayList;
import java.util.List;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.TextField;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
@@ -109,9 +111,32 @@ public class ComponentFactoryTest {
Design.read(new ByteArrayInputStream("<v-label />".getBytes()));
}
+ @Test
+ public void testGetDefaultInstanceUsesComponentFactory() {
+ final List<String> classes = new ArrayList<String>();
+ currentComponentFactory.set(new ComponentFactory() {
+ @Override
+ public Component createComponent(String fullyQualifiedClassName,
+ DesignContext context) {
+ classes.add(fullyQualifiedClassName);
+ return defaultFactory.createComponent(fullyQualifiedClassName,
+ context);
+ }
+ });
+
+ DesignContext designContext = new DesignContext();
+ designContext.getDefaultInstance(new DefaultInstanceTestComponent());
+
+ Assert.assertEquals("There should be one class requests", 1, classes.size());
+ Assert.assertEquals("First class should be DefaultInstanceTestComponent",
+ DefaultInstanceTestComponent.class.getName(), classes.get(0));
+ }
+
@After
public void cleanup() {
currentComponentFactory.remove();
}
+ public static class DefaultInstanceTestComponent extends AbstractComponent {
+ }
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java
index 48bba8a853..d2e2654cbc 100644
--- a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java
+++ b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java
@@ -65,6 +65,15 @@ public class SliderTest {
} catch (Slider.ValueOutOfBoundsException e) {
// TODO: handle exception
}
+ }
+
+ @Test
+ public void valueCanHaveLargePrecision() {
+ Slider slider = new Slider();
+ slider.setResolution(20);
+
+ slider.setValue(99.01234567891234567890123456789);
+ assertThat(slider.getValue(), is(99.01234567891234567890123456789));
}
}
diff --git a/uitest/integration-testscripts/eXo-3/integration-test-eXo-3.0.3-portlet2.html b/uitest/integration-testscripts/eXo-3/integration-test-eXo-3.0.3-portlet2.html
deleted file mode 100644
index 8813f7fe23..0000000000
--- a/uitest/integration-testscripts/eXo-3/integration-test-eXo-3.0.3-portlet2.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<?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="" />
-<title>integration-test-eXo-3.1.0-portlet2</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">integration-test-eXo-3.1.0-portlet2</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/portal/public/intranet/</td>
- <td></td>
-</tr>
-<tr>
- <td>setTimeout</td>
- <td>60000</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Login as John</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>link=Login as John</td>
- <td>37,4</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Applications Registry</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClickAndWait</td>
- <td>link=Applications Registry</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>link=Portlet</td>
- <td>33,11</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Vaadin Portlet 2.0 Test</td>
- <td>59,9</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>link=Vaadin Portlet 2.0 Test</td>
- <td>59,9</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Click here to add into categories</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>link=Click here to add into categories</td>
- <td>48,3</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>name=category_Gadgets</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>name=category_Gadgets</td>
- <td>10,16</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Save</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>link=Save</td>
- <td>4,6</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Vaadin Liferay Theme</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>link=Vaadin Liferay Theme</td>
- <td>64,13</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Click here to add into categories</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>link=Click here to add into categories</td>
- <td>96,9</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>name=category_Gadgets</td>
- <td>7,12</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>name=category_Gadgets</td>
- <td>7,12</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Save</td>
- <td>4,6</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>link=Save</td>
- <td>4,6</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>link=Add New Page</td>
- <td>55,11</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>link=Add New Page</td>
- <td>55,11</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>pageName</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>pageName</td>
- <td>33,16</td>
-</tr>
-<tr>
- <td>enterCharacter</td>
- <td>pageName</td>
- <td>Portlet2</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>//div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div</td>
- <td>36,12</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@id='UIDropDownPageTemp']/div[1]/div/div/div/div/div/div</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>//div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div</td>
- <td>21,13</td>
-</tr>
-<!--Drag JSR286 test portlet to page-->
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[@id='Gadgets/JSR286TestPortlet']/div/div/div/div</td>
- <td></td>
-</tr>
-<tr>
- <td>drag</td>
- <td>//div[@id='Gadgets/JSR286TestPortlet']/div/div/div/div</td>
- <td></td>
-</tr>
-<tr>
- <td>drop</td>
- <td>//div[2]/div/div/div[1]/div/div[2]/div/div/div/div</td>
- <td>113,9</td>
-</tr>
-<tr>
- <td>waitForTextPresent</td>
- <td>Vaadin Portlet 2.0 Test</td>
- <td></td>
-</tr>
-<!--Switch to view mode-->
-<tr>
- <td>mouseClickAndWait</td>
- <td>//a[@onclick='eXo.core.DOMUtil.disableOnClick(this);']</td>
- <td>13,5</td>
-</tr>
-<!--Start of actual portlet test-->
-<tr>
- <td>waitForText</td>
- <td>//div[2]/div/div/div/span</td>
- <td>Test of ApplicationResources with full path</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//body/div[4]/div//p</td>
- <td>exact:Mode: view State: normal</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>initial</td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[4]/div</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>assertTextNotPresent</td>
- <td>Action * received</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//div[@class=&quot;v-link v-widget&quot;]/a/span</td>
- <td>Edit</td>
-</tr>
-<!--Send an action-->
-<tr>
- <td>mouseClickAndWait</td>
- <td>//div[8]/div/a/span</td>
- <td>32,9</td>
-</tr>
-<tr>
- <td>assertTextPresent</td>
- <td>Action 'someAction' received</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//body/div[4]/div//p</td>
- <td>exact:Mode: view State: normal</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//div[@class=&quot;v-link v-widget&quot;]/a/span</td>
- <td>Edit</td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[4]/div</td>
- <td>0,0</td>
-</tr>
-<!--Switch to edit mode-->
-<tr>
- <td>mouseClickAndWait</td>
- <td>//div[5]/div/a/span</td>
- <td>12,3</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//body/div[4]/div//p</td>
- <td>exact:Mode: edit State: normal</td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[4]/div</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//div[@class=&quot;v-link v-widget&quot;]/a/span</td>
- <td>Done</td>
-</tr>
-<!--Maximize-->
-<tr>
- <td>mouseClickAndWait</td>
- <td>//div[6]/div/a/span</td>
- <td>16,7</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//body/div[3]/div//p</td>
- <td>exact:Mode: edit State: normal</td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[3]/div</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//div[6]/div/a/span</td>
- <td>Maximize</td>
-</tr>
-<!--Restore back to normal-->
-<tr>
- <td>mouseClickAndWait</td>
- <td>//div[6]/div/a/span</td>
- <td>71,8</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//body/div[3]/div//p</td>
- <td>exact:Mode: edit State: normal</td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[3]/div</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//div[@class=&quot;v-link v-widget&quot;]/a/span</td>
- <td>Done</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>//div[6]/div/a/span</td>
- <td>Maximize</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>final</td>
-</tr>
-</tbody></table>
-</body>
-</html>
diff --git a/uitest/integration_tests.xml b/uitest/integration_tests.xml
index 26ce4ed70d..1e040b04f7 100644
--- a/uitest/integration_tests.xml
+++ b/uitest/integration_tests.xml
@@ -150,6 +150,13 @@
</antcall>
</target>
+ <target name="integration-test-osgi">
+ <antcall target="run-generic-integration-test">
+ <param name="startDelay" value="10" />
+ <param name="target-server" value="osgi" />
+ </antcall>
+ </target>
+
<target name="integration-test-tomcat6">
<antcall target="run-generic-integration-test">
<param name="startDelay" value="10" />
@@ -304,16 +311,6 @@
</antcall>
</target>
- <target name="integration-test-exo3">
- <fileset dir="integration-testscripts" id="html-test-files" includes="eXo-3/integration-test-eXo-3.0.3-portlet2.html" />
- <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
- <antcall target="run-generic-integration-test">
- <param name="startDelay" value="600" />
- <param name="test_browsers" value="winxp-firefox17-esr" />
- <param name="target-server" value="exo3" />
- </antcall>
- </target>
-
<target name="integration-test-websphere8">
<antcall target="run-generic-integration-test">
<param name="startDelay" value="600" />
@@ -406,7 +403,6 @@
<antcall target="integration-test-liferay6ee" />
<antcall target="integration-test-liferay6-theme" />
<antcall target="integration-test-liferay6ee-theme" />
- <antcall target="integration-test-exo3" />
<antcall target="integration-test-weblogicPortal" />
<antcall target="integration-test-liferay5" />
<antcall target="integration-test-weblogic10" />
@@ -426,6 +422,7 @@
<antcall target="integration-test-tomcat6" />
<antcall target="integration-test-tomcat7" />
<antcall target="integration-test-tomcat8" />
+ <antcall target="integration-test-osgi" />
<antcall target="integration-test-tomcat7apacheproxy" />
<antcall target="integration-test-websphere8" />
<antcall target="integration-test-websphereportal8" />
diff --git a/uitest/src/com/vaadin/tests/components/table/SelectableEditableTest.java b/uitest/src/com/vaadin/tests/components/table/SelectableEditableTest.java
new file mode 100644
index 0000000000..8b5b54cfaa
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/SelectableEditableTest.java
@@ -0,0 +1,18 @@
+package com.vaadin.tests.components.table;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.TableElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class SelectableEditableTest extends MultiBrowserTest {
+ @Test
+ public void testSelectFromCellWith() throws Exception {
+ openTestURL();
+ TableElement table = $(TableElement.class).first();
+ table.getCell(0, 1).click(70, 12);
+ Assert.assertTrue("Element does not have the 'v-selected' css class",
+ hasCssClass(table.getRow(0), "v-selected"));
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index ef32d9a067..a95def5983 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -158,6 +158,12 @@ public abstract class AbstractTB3Test extends ParallelTest {
}
}
+ protected WebElement getTooltipErrorElement() {
+ WebElement tooltip = getDriver().findElement(
+ com.vaadin.testbench.By.className("v-tooltip"));
+ return tooltip.findElement(By.className("v-errormessage"));
+ }
+
protected WebElement getTooltipElement() {
return getDriver().findElement(
com.vaadin.testbench.By.className("v-tooltip-text"));
diff --git a/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java b/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java
index e70a980d70..4fa6eda5c3 100644
--- a/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java
+++ b/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java
@@ -5,11 +5,13 @@ import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.Validator;
import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.data.validator.StringLengthValidator;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.TextField;
-public class ValidationOfRequiredEmptyFields extends TestBase {
+@SuppressWarnings("deprecation")
+public class ValidationOfRequiredEmptyFields extends AbstractTestUI {
private TextField tf;
private CheckBox requiredInput;
@@ -23,10 +25,10 @@ public class ValidationOfRequiredEmptyFields extends TestBase {
private CheckBox stringLengthValidatorInput;
@Override
- protected void setup() {
+ protected void setup(VaadinRequest request) {
requiredInput = new CheckBox("Field required");
requiredInput.setImmediate(true);
- requiredInput.addListener(new ValueChangeListener() {
+ requiredInput.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
tf.setRequired(requiredInput.getValue());
@@ -35,16 +37,16 @@ public class ValidationOfRequiredEmptyFields extends TestBase {
requiredErrorInput = new TextField("Required error message");
requiredErrorInput.setImmediate(true);
- requiredErrorInput.addListener(new ValueChangeListener() {
+ requiredErrorInput.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
tf.setRequiredError(requiredErrorInput.getValue());
}
});
- integerValidatorInput = new CheckBox("Integer.parseInt validator");
+ integerValidatorInput = new CheckBox("Integer validator");
integerValidatorInput.setImmediate(true);
- integerValidatorInput.addListener(new ValueChangeListener() {
+ integerValidatorInput.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
@@ -55,20 +57,20 @@ public class ValidationOfRequiredEmptyFields extends TestBase {
}
}
});
- stringLengthValidatorInput = new CheckBox(
- "stringLength.parseInt validator");
+ stringLengthValidatorInput = new CheckBox("String length validator");
stringLengthValidatorInput.setImmediate(true);
- stringLengthValidatorInput.addListener(new ValueChangeListener() {
+ stringLengthValidatorInput
+ .addValueChangeListener(new ValueChangeListener() {
- @Override
- public void valueChange(ValueChangeEvent event) {
- if (stringLengthValidatorInput.getValue()) {
- tf.addValidator(stringLengthValidator);
- } else {
- tf.removeValidator(stringLengthValidator);
- }
- }
- });
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (stringLengthValidatorInput.getValue()) {
+ tf.addValidator(stringLengthValidator);
+ } else {
+ tf.removeValidator(stringLengthValidator);
+ }
+ }
+ });
tf = new TextField();
tf.setImmediate(true);
@@ -86,8 +88,8 @@ public class ValidationOfRequiredEmptyFields extends TestBase {
}
@Override
- protected String getDescription() {
- return null;
+ protected String getTestDescription() {
+ return "Tests that the lower textfield's tooltip displays validation error messages correctly.";
}
@Override
diff --git a/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFieldsTest.java b/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFieldsTest.java
new file mode 100644
index 0000000000..ab77ba6b26
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFieldsTest.java
@@ -0,0 +1,105 @@
+package com.vaadin.tests.validation;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+
+import com.vaadin.testbench.elements.CheckBoxElement;
+import com.vaadin.testbench.elements.TextFieldElement;
+import com.vaadin.testbench.elements.VerticalLayoutElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class ValidationOfRequiredEmptyFieldsTest extends MultiBrowserTest {
+
+ @Override
+ protected boolean requireWindowFocusForIE() {
+ return true;
+ }
+
+ @Test
+ public void requiredErrorMessage() throws Exception {
+ openTestURL();
+ getRequiredCheckbox().click();
+ getRequiredMessageField().click();
+ getRequiredMessageField().sendKeys("The field is required", Keys.TAB);
+ assertTooltipError("The field is required");
+ }
+
+ @Test
+ public void integerValidatorErrorMessage() {
+ openTestURL();
+ getRequiredCheckbox().click();
+ getIntegerValidatorCheckbox().click();
+ getTargetTextField().sendKeys("a", Keys.SHIFT, Keys.TAB);
+ assertTooltipError("Must be an integer");
+ }
+
+ @Test
+ public void requiredWithIntegerAndLengthValidatorErrorMessage() {
+ openTestURL();
+ getRequiredCheckbox().click();
+ getIntegerValidatorCheckbox().click();
+ getLengthValidatorCheckbox().click();
+ getTargetTextField().sendKeys("a", Keys.SHIFT, Keys.TAB);
+ assertTooltipError("Must be an integer\nMust be 5-10 chars");
+ }
+
+ @Test
+ public void integerAndLengthValidatorErrorMessage() {
+ openTestURL();
+ getIntegerValidatorCheckbox().click();
+ getLengthValidatorCheckbox().click();
+ getTargetTextField().sendKeys("a", Keys.SHIFT, Keys.TAB);
+ assertTooltipError("Must be an integer\nMust be 5-10 chars");
+ }
+
+ private void assertTooltipError(final String message) {
+ TextFieldElement e = getTargetTextField();
+ testBenchElement(e).showTooltip();
+ waitUntil(new ExpectedCondition<Boolean>() {
+
+ @Override
+ public Boolean apply(WebDriver input) {
+ return message.equals(getTooltipErrorElement().getText());
+ }
+
+ @Override
+ public String toString() {
+ return "tooltip to be '" + message + "' (was: '"
+ + getTooltipErrorElement().getText() + "')";
+ }
+ });
+ hideTooltip();
+ }
+
+ private void hideTooltip() {
+ $(VerticalLayoutElement.class).first().click();
+ }
+
+ private TextFieldElement getRequiredMessageField() {
+ return $(TextFieldElement.class).all().get(0);
+ }
+
+ private TextFieldElement getTargetTextField() {
+ return $(TextFieldElement.class).all().get(1);
+ }
+
+ private WebElement getRequiredCheckbox() {
+ return $(CheckBoxElement.class).caption("Field required").first()
+ .findElement(By.xpath("input"));
+ }
+
+ private WebElement getIntegerValidatorCheckbox() {
+ return $(CheckBoxElement.class).caption("Integer validator").first()
+ .findElement(By.xpath("input"));
+ }
+
+ private WebElement getLengthValidatorCheckbox() {
+ return $(CheckBoxElement.class).caption("String length validator")
+ .first().findElement(By.xpath("input"));
+ }
+
+}
diff --git a/uitest/tb2/com/vaadin/tests/components/table/SelectableEditable.html b/uitest/tb2/com/vaadin/tests/components/table/SelectableEditable.html
deleted file mode 100644
index 8d46523c40..0000000000
--- a/uitest/tb2/com/vaadin/tests/components/table/SelectableEditable.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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="" />
-<title>SelectableEditable</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">SelectableEditable</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.table.SelectableEditable?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableSelectableEditable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td>
- <td>70,12</td>
-</tr>
-<tr>
- <td>assertCSSClass</td>
- <td>vaadin=runcomvaadintestscomponentstableSelectableEditable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
- <td>v-selected</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/uitest/tb2/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html b/uitest/tb2/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html
deleted file mode 100644
index 62d972e89f..0000000000
--- a/uitest/tb2/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<?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="" />
-<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.validation.ValidationOfRequiredEmptyFields?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VCheckBox[0]/domChild[0]</td>
- <td>11,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VTextField[0]</td>
- <td>60,11</td>
-</tr>
-<tr>
- <td>enterCharacter</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VTextField[0]</td>
- <td>The field is required</td>
-</tr>
-<tr>
- <td>showTooltip</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>required-message</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]</td>
- <td>13,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
- <td>28,13</td>
-</tr>
-<tr>
- <td>enterCharacter</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
- <td>a</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]</td>
- <td>34,186</td>
-</tr>
-<tr>
- <td>showTooltip</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>error-must-be-int</td>
-</tr>
-<!-- Dummy command to remove the tooltip -->
-<tr>
- <td>showTooltip</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
- <td>45,9</td>
-</tr>
-<tr>
- <td>showTooltip</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>waitForVisible</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]/domChild[1]</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>error-must-be-int-and-5-to-10-chars</td>
-</tr>
-<tr>
- <td>showTooltip</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
- <td>12,7</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
- <td>124,12</td>
-</tr>
-<tr>
- <td>type</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VCheckBox[0]/domChild[0]</td>
- <td>8,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
- <td>13,7</td>
-</tr>
-<tr>
- <td>showTooltip</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>waitForVisible</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]/domChild[1]</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>empty-invalid-not-required</td>
-</tr>
-</tbody></table>
-</body>
-</html>
diff --git a/uitest/test.xml b/uitest/test.xml
index 496e115c18..c07c4d96af 100644
--- a/uitest/test.xml
+++ b/uitest/test.xml
@@ -7,7 +7,7 @@
<!-- Configuration -->
<!-- ================================================================== -->
<!-- Browsers to use for testing -->
- <property name="browsers-windows" value="winxp-ie8,win7-ie9,win7-ie10,winxp-firefox17-esr,winxp-googlechrome21" />
+ <property name="browsers-windows" value="winxp-ie8,win7-ie9,win7-ie10,winxp-firefox17-esr" />
<property name="browsers-linux" value="linux-firefox3,linux-opera10,linux-googlechrome8" />
<property name="browsers-mac" value="osx-firefox3,osx-opera10,osx-googlechrome8,osx-safari4,osx-safari5" />