diff options
author | John Ahlroos <john@vaadin.com> | 2012-08-28 09:41:55 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-08-28 09:41:55 +0300 |
commit | 435a2e735251464529f8329b0563c26d5b4cc6a9 (patch) | |
tree | 8bde89594f6b258f087a8518265418a02800cea2 | |
parent | 7b9e1566d6e36c10aef3566b20267449586a81cb (diff) | |
parent | c6d43cc88fb0ef4853e07be54fc76a6aa1dc9e23 (diff) | |
download | vaadin-framework-435a2e735251464529f8329b0563c26d5b4cc6a9.tar.gz vaadin-framework-435a2e735251464529f8329b0563c26d5b4cc6a9.zip |
Merge branch 'master' into layoutgraph
Conflicts:
tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
464 files changed, 4861 insertions, 2131 deletions
diff --git a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/ConnectorBundleLoaderFactory.java index a2e61947e8..752f290a42 100644 --- a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/ConnectorBundleLoaderFactory.java +++ b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/ConnectorBundleLoaderFactory.java @@ -30,6 +30,7 @@ import com.google.gwt.core.ext.typeinfo.TypeOracle; import com.google.gwt.user.rebind.ClassSourceFileComposerFactory; import com.google.gwt.user.rebind.SourceWriter; import com.vaadin.shared.annotations.Delayed; +import com.vaadin.shared.annotations.DelegateToWidget; import com.vaadin.shared.communication.ClientRpc; import com.vaadin.shared.communication.ServerRpc; import com.vaadin.shared.ui.Connect; @@ -182,6 +183,18 @@ public class ConnectorBundleLoaderFactory extends Generator { writeSetters(logger, w, bundle); writeGetters(logger, w, bundle); writeSerializers(logger, w, bundle); + writeDelegateToWidget(logger, w, bundle); + } + + private void writeDelegateToWidget(TreeLogger logger, SourceWriter w, + ConnectorBundle bundle) { + Set<Property> needsDelegateToWidget = bundle.getNeedsDelegateToWidget(); + for (Property property : needsDelegateToWidget) { + w.println("store.setDelegateToWidget(%s, \"%s\", \"%s\");", + getClassLiteralString(property.getBeanType()), + property.getName(), + property.getAnnotation(DelegateToWidget.class).value()); + } } private void writeSerializers(TreeLogger logger, SourceWriter w, @@ -535,8 +548,11 @@ public class ConnectorBundleLoaderFactory extends Generator { } public static void writeClassLiteral(SourceWriter w, JType type) { - w.print(type.getQualifiedSourceName()); - w.print(".class"); + w.print(getClassLiteralString(type)); + } + + public static String getClassLiteralString(JType type) { + return type.getQualifiedSourceName() + ".class"; } private void writeIdentifiers(SourceWriter w, ConnectorBundle bundle) { diff --git a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java index 1f5b301802..99f3a1d17b 100644 --- a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java +++ b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java @@ -40,7 +40,7 @@ import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.Connect.LoadStyle; import com.vaadin.terminal.gwt.client.ServerConnector; import com.vaadin.terminal.gwt.client.ui.UnknownComponentConnector; -import com.vaadin.terminal.gwt.client.ui.root.RootConnector; +import com.vaadin.terminal.gwt.client.ui.UI.UIConnector; import com.vaadin.terminal.gwt.server.ClientConnector; /** @@ -284,7 +284,7 @@ public class WidgetMapGenerator extends Generator { if (connectorsWithInstantiator.contains(clientClass)) { continue; } - if (clientClass == RootConnector.class) { + if (clientClass == UIConnector.class) { // Roots are not instantiated by widgetset continue; } diff --git a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/ConnectorBundle.java b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/ConnectorBundle.java index 7515124a5a..1db551ed9a 100644 --- a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/ConnectorBundle.java +++ b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/ConnectorBundle.java @@ -61,6 +61,7 @@ public class ConnectorBundle { private final Set<Property> needsSetter = new HashSet<Property>(); private final Set<Property> needsType = new HashSet<Property>(); private final Set<Property> needsGetter = new HashSet<Property>(); + private final Set<Property> needsDelegateToWidget = new HashSet<Property>(); private ConnectorBundle(String name, ConnectorBundle previousBundle, Collection<TypeVisitor> visitors, @@ -585,4 +586,23 @@ public class ConnectorBundle { && previousBundle.hasSserializeSupport(type); } } + + public void setNeedsDelegateToWidget(Property property) { + if (!isNeedsDelegateToWidget(property)) { + needsDelegateToWidget.add(property); + } + } + + private boolean isNeedsDelegateToWidget(Property property) { + if (needsDelegateToWidget.contains(property)) { + return true; + } else { + return previousBundle != null + && previousBundle.isNeedsDelegateToWidget(property); + } + } + + public Set<Property> getNeedsDelegateToWidget() { + return Collections.unmodifiableSet(needsDelegateToWidget); + } }
\ No newline at end of file diff --git a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/FieldProperty.java b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/FieldProperty.java index 31555cc30b..c4c2a50e1c 100644 --- a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/FieldProperty.java +++ b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/FieldProperty.java @@ -16,6 +16,7 @@ package com.vaadin.terminal.gwt.widgetsetutils.metadata; +import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -29,8 +30,11 @@ import com.google.gwt.user.rebind.SourceWriter; public class FieldProperty extends Property { + private final JField field; + private FieldProperty(JClassType beanType, JField field) { super(field.getName(), beanType, field.getType()); + this.field = field; } @Override @@ -74,4 +78,9 @@ public class FieldProperty extends Property { return fields; } + @Override + public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { + return field.getAnnotation(annotationClass); + } + } diff --git a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/MethodProperty.java b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/MethodProperty.java index f422205175..431ead7f96 100644 --- a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/MethodProperty.java +++ b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/MethodProperty.java @@ -16,6 +16,7 @@ package com.vaadin.terminal.gwt.widgetsetutils.metadata; +import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -121,4 +122,9 @@ public class MethodProperty extends Property { + baseName.substring(1); } + @Override + public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { + return setter.getAnnotation(annotationClass); + } + } diff --git a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/Property.java b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/Property.java index 1714489db5..5ef0293688 100644 --- a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/Property.java +++ b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/Property.java @@ -16,6 +16,8 @@ package com.vaadin.terminal.gwt.widgetsetutils.metadata; +import java.lang.annotation.Annotation; + import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JPrimitiveType; @@ -81,4 +83,7 @@ public abstract class Property { + getName().hashCode(); } + public abstract <T extends Annotation> T getAnnotation( + Class<T> annotationClass); + } diff --git a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/TypeVisitor.java b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/TypeVisitor.java index 976eb6417a..cda849f564 100644 --- a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/TypeVisitor.java +++ b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/TypeVisitor.java @@ -5,6 +5,7 @@ package com.vaadin.terminal.gwt.widgetsetutils.metadata; import com.google.gwt.core.ext.TreeLogger; +import com.google.gwt.core.ext.UnableToCompleteException; import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JMethod; import com.google.gwt.core.ext.typeinfo.JType; @@ -17,7 +18,7 @@ public abstract class TypeVisitor { } public void visitConnector(TreeLogger logger, JClassType type, - ConnectorBundle bundle) { + ConnectorBundle bundle) throws UnableToCompleteException { // Default does nothing } diff --git a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java index 4d63703151..2b0e3e1f61 100644 --- a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java +++ b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java @@ -4,17 +4,21 @@ package com.vaadin.terminal.gwt.widgetsetutils.metadata; +import java.util.Collection; + import com.google.gwt.core.ext.TreeLogger; +import com.google.gwt.core.ext.TreeLogger.Type; +import com.google.gwt.core.ext.UnableToCompleteException; import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JMethod; -import com.google.gwt.core.ext.typeinfo.JType; +import com.vaadin.shared.annotations.DelegateToWidget; import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector; public class WidgetInitVisitor extends TypeVisitor { @Override public void visitConnector(TreeLogger logger, JClassType type, - ConnectorBundle bundle) { + ConnectorBundle bundle) throws UnableToCompleteException { if (ConnectorBundle.isConnectedComponentConnector(type)) { JClassType createWidgetClass = findInheritedMethod(type, "createWidget").getEnclosingType(); @@ -29,8 +33,41 @@ public class WidgetInitVisitor extends TypeVisitor { JMethod getWidget = findInheritedMethod(type, "getWidget"); bundle.setNeedsReturnType(type, getWidget); - JType widgetType = getWidget.getReturnType(); - bundle.setNeedsGwtConstructor(widgetType.isClass()); + JClassType widgetType = getWidget.getReturnType().isClass(); + bundle.setNeedsGwtConstructor(widgetType); + + JMethod getState = findInheritedMethod(type, "getState"); + JClassType stateType = getState.getReturnType().isClass(); + + Collection<Property> properties = bundle.getProperties(stateType); + for (Property property : properties) { + DelegateToWidget delegateToWidget = property + .getAnnotation(DelegateToWidget.class); + if (delegateToWidget != null) { + bundle.setNeedsDelegateToWidget(property); + String methodName = DelegateToWidget.Helper + .getDelegateTarget(property.getName(), + delegateToWidget.value()); + JMethod delegatedSetter = findInheritedMethod(widgetType, + methodName, property.getPropertyType()); + if (delegatedSetter == null) { + logger.log( + Type.ERROR, + widgetType.getName() + + "." + + methodName + + "(" + + property.getPropertyType() + .getSimpleSourceName() + + ") required by @DelegateToWidget for " + + stateType.getName() + "." + + property.getName() + + " can not be found."); + throw new UnableToCompleteException(); + } + bundle.setNeedsInvoker(widgetType, delegatedSetter); + } + } } } } diff --git a/client/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/client/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index 8bb4f37324..2eccd9bb8c 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/client/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -31,6 +31,7 @@ import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Window; import com.vaadin.shared.ApplicationConstants; +import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.terminal.gwt.client.metadata.BundleLoadCallback; import com.vaadin.terminal.gwt.client.metadata.ConnectorBundleLoader; import com.vaadin.terminal.gwt.client.metadata.NoDataException; @@ -202,11 +203,12 @@ public class ApplicationConfiguration implements EntryPoint { private String id; private String themeUri; private String appUri; - private int rootId; + private int uiId; private boolean standalone; private ErrorMessage communicationError; private ErrorMessage authorizationError; private boolean useDebugIdInDom = true; + private int heartbeatInterval; private HashMap<Integer, String> unknownComponents; @@ -284,12 +286,20 @@ public class ApplicationConfiguration implements EntryPoint { /** * Gets the root if of this application instance. The root id should be * included in every request originating from this instance in order to - * associate it with the right Root instance on the server. + * associate it with the right UI instance on the server. * * @return the root id */ - public int getRootId() { - return rootId; + public int getUIId() { + return uiId; + } + + /** + * @return The interval in seconds between heartbeat requests, or a + * non-positive number if heartbeat is disabled. + */ + public int getHeartbeatInterval() { + return heartbeatInterval; } public JavaScriptObject getVersionInfoJSObject() { @@ -314,7 +324,8 @@ public class ApplicationConfiguration implements EntryPoint { appUri += '/'; } themeUri = jsoConfiguration.getConfigString("themeUri"); - rootId = jsoConfiguration.getConfigInteger("rootId").intValue(); + uiId = jsoConfiguration.getConfigInteger(UIConstants.UI_ID_PARAMETER) + .intValue(); // null -> true useDebugIdInDom = jsoConfiguration.getConfigBoolean("useDebugIdInDom") != Boolean.FALSE; @@ -322,6 +333,9 @@ public class ApplicationConfiguration implements EntryPoint { // null -> false standalone = jsoConfiguration.getConfigBoolean("standalone") == Boolean.TRUE; + heartbeatInterval = jsoConfiguration + .getConfigInteger("heartbeatInterval"); + communicationError = jsoConfiguration.getConfigError("comErrMsg"); authorizationError = jsoConfiguration.getConfigError("authErrMsg"); diff --git a/client/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/client/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 58357ae3fc..450972ddc6 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/client/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -58,6 +58,7 @@ import com.vaadin.shared.Version; import com.vaadin.shared.communication.LegacyChangeVariablesInvocation; import com.vaadin.shared.communication.MethodInvocation; import com.vaadin.shared.communication.SharedState; +import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.terminal.gwt.client.ApplicationConfiguration.ErrorMessage; import com.vaadin.terminal.gwt.client.ResourceLoader.ResourceLoadEvent; import com.vaadin.terminal.gwt.client.ResourceLoader.ResourceLoadListener; @@ -68,13 +69,16 @@ import com.vaadin.terminal.gwt.client.communication.RpcManager; import com.vaadin.terminal.gwt.client.communication.StateChangeEvent; import com.vaadin.terminal.gwt.client.extensions.AbstractExtensionConnector; import com.vaadin.terminal.gwt.client.metadata.ConnectorBundleLoader; +import com.vaadin.terminal.gwt.client.metadata.NoDataException; +import com.vaadin.terminal.gwt.client.metadata.Property; import com.vaadin.terminal.gwt.client.metadata.Type; +import com.vaadin.terminal.gwt.client.metadata.TypeData; import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector; import com.vaadin.terminal.gwt.client.ui.VContextMenu; +import com.vaadin.terminal.gwt.client.ui.UI.UIConnector; import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager; import com.vaadin.terminal.gwt.client.ui.notification.VNotification; import com.vaadin.terminal.gwt.client.ui.notification.VNotification.HideEvent; -import com.vaadin.terminal.gwt.client.ui.root.RootConnector; import com.vaadin.terminal.gwt.client.ui.window.WindowConnector; /** @@ -153,7 +157,7 @@ public class ApplicationConnection { private Timer loadTimer3; private Element loadElement; - private final RootConnector rootConnector; + private final UIConnector uIConnector; protected boolean applicationRunning = false; @@ -205,10 +209,10 @@ public class ApplicationConnection { } public ApplicationConnection() { - // Assuming Root data is eagerly loaded + // Assuming UI data is eagerly loaded ConnectorBundleLoader.get().loadBundle( ConnectorBundleLoader.EAGER_BUNDLE_NAME, null); - rootConnector = GWT.create(RootConnector.class); + uIConnector = GWT.create(UIConnector.class); rpcManager = GWT.create(RpcManager.class); layoutManager = GWT.create(LayoutManager.class); layoutManager.setConnection(this); @@ -240,8 +244,10 @@ public class ApplicationConnection { initializeClientHooks(); - rootConnector.init(cnf.getRootPanelId(), this); + uIConnector.init(cnf.getRootPanelId(), this); showLoadingIndicator(); + + scheduleHeartbeat(); } /** @@ -492,8 +498,8 @@ public class ApplicationConnection { if (extraParams != null && extraParams.length() > 0) { uri = addGetParameters(uri, extraParams); } - uri = addGetParameters(uri, ApplicationConstants.ROOT_ID_PARAMETER - + "=" + configuration.getRootId()); + uri = addGetParameters(uri, UIConstants.UI_ID_PARAMETER + "=" + + configuration.getUIId()); doUidlRequest(uri, payload, forceSync); @@ -906,7 +912,7 @@ public class ApplicationConnection { if (loadElement == null) { loadElement = DOM.createDiv(); DOM.setStyleAttribute(loadElement, "position", "absolute"); - DOM.appendChild(rootConnector.getWidget().getElement(), loadElement); + DOM.appendChild(uIConnector.getWidget().getElement(), loadElement); VConsole.log("inserting load indicator"); } DOM.setElementProperty(loadElement, "className", "v-loading-indicator"); @@ -1090,7 +1096,7 @@ public class ApplicationConnection { meta = json.getValueMap("meta"); if (meta.containsKey("repaintAll")) { repaintAll = true; - rootConnector.getWidget().clear(); + uIConnector.getWidget().clear(); getConnectorMap().clear(); if (meta.containsKey("invalidLayouts")) { validatingLayouts = true; @@ -1148,6 +1154,8 @@ public class ApplicationConnection { " * Hierarchy state change event processing completed", 10); + delegateToWidget(pendingStateChangeEvents); + // Fire state change events. sendStateChangeEvents(pendingStateChangeEvents); @@ -1264,6 +1272,62 @@ public class ApplicationConnection { } + private void delegateToWidget( + Collection<StateChangeEvent> pendingStateChangeEvents) { + VConsole.log(" * Running @DelegateToWidget"); + + for (StateChangeEvent sce : pendingStateChangeEvents) { + ServerConnector connector = sce.getConnector(); + if (connector instanceof ComponentConnector) { + ComponentConnector component = (ComponentConnector) connector; + Type type = TypeData.getType(component.getClass()); + + Type stateType; + try { + stateType = type.getMethod("getState") + .getReturnType(); + } catch (NoDataException e) { + throw new RuntimeException( + "Can not find the state type for " + + type.getSignature(), e); + } + + Set<String> changedProperties = sce + .getChangedProperties(); + for (String propertyName : changedProperties) { + Property property = stateType + .getProperty(propertyName); + String method = property + .getDelegateToWidgetMethodName(); + if (method != null) { + doDelegateToWidget(component, property, method); + } + } + + } + } + } + + private void doDelegateToWidget(ComponentConnector component, + Property property, String methodName) { + Type type = TypeData.getType(component.getClass()); + try { + Type widgetType = type.getMethod("getWidget") + .getReturnType(); + Widget widget = component.getWidget(); + + Object propertyValue = property.getValue(component + .getState()); + + widgetType.getMethod(methodName).invoke(widget, + propertyValue); + } catch (NoDataException e) { + throw new RuntimeException( + "Missing data needed to invoke @DelegateToWidget for " + + Util.getSimpleName(component), e); + } + } + /** * Sends the state change events created while updating the state * information. @@ -1300,17 +1364,17 @@ public class ApplicationConnection { if (!c.getParent().getChildren().contains(c)) { VConsole.error("ERROR: Connector is connected to a parent but the parent does not contain the connector"); } - } else if ((c instanceof RootConnector && c == getRootConnector())) { - // RootConnector for this connection, leave as-is + } else if ((c instanceof UIConnector && c == getRootConnector())) { + // UIConnector for this connection, leave as-is } else if (c instanceof WindowConnector && getRootConnector().hasSubWindow( (WindowConnector) c)) { - // Sub window attached to this RootConnector, leave + // Sub window attached to this UIConnector, leave // as-is } else { // The connector has been detached from the // hierarchy, unregister it and any possible - // children. The RootConnector should never be + // children. The UIConnector should never be // unregistered even though it has no parent. connectorMap.unregisterConnector(c); unregistered++; @@ -1345,17 +1409,17 @@ public class ApplicationConnection { .getConnectorClassByEncodedTag(connectorType); // Connector does not exist so we must create it - if (connectorClass != RootConnector.class) { + if (connectorClass != UIConnector.class) { // create, initialize and register the paintable getConnector(connectorId, connectorType); } else { - // First RootConnector update. Before this the - // RootConnector has been created but not + // First UIConnector update. Before this the + // UIConnector has been created but not // initialized as the connector id has not been // known connectorMap.registerConnector(connectorId, - rootConnector); - rootConnector.doInit(connectorId, + uIConnector); + uIConnector.doInit(connectorId, ApplicationConnection.this); } } catch (final Throwable e) { @@ -2416,8 +2480,8 @@ public class ApplicationConnection { * * @return the main view */ - public RootConnector getRootConnector() { - return rootConnector; + public UIConnector getRootConnector() { + return uIConnector; } /** @@ -2554,4 +2618,77 @@ public class ApplicationConnection { LayoutManager getLayoutManager() { return layoutManager; } + + /** + * Schedules a heartbeat request to occur after the configured heartbeat + * interval elapses if the interval is a positive number. Otherwise, does + * nothing. + * + * @see #sendHeartbeat() + * @see ApplicationConfiguration#getHeartbeatInterval() + */ + protected void scheduleHeartbeat() { + final int interval = getConfiguration().getHeartbeatInterval(); + if (interval > 0) { + VConsole.log("Scheduling heartbeat in " + interval + " seconds"); + new Timer() { + @Override + public void run() { + sendHeartbeat(); + } + }.schedule(interval * 1000); + } + } + + /** + * Sends a heartbeat request to the server. + * <p> + * 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 Root. + * <p> + * <b>TODO</b>: Improved error handling, like in doUidlRequest(). + * + * @see #scheduleHeartbeat() + */ + protected void sendHeartbeat() { + final String uri = addGetParameters( + translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX + + ApplicationConstants.HEARTBEAT_REQUEST_PATH), + UIConstants.UI_ID_PARAMETER + "=" + + getConfiguration().getUIId()); + + final RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, uri); + + final RequestCallback callback = new RequestCallback() { + + @Override + public void onResponseReceived(Request request, Response response) { + int status = response.getStatusCode(); + if (status == Response.SC_OK) { + // TODO Permit retry in some error situations + VConsole.log("Heartbeat response OK"); + scheduleHeartbeat(); + } else { + VConsole.error("Heartbeat request failed with status code " + + status); + } + } + + @Override + public void onError(Request request, Throwable exception) { + VConsole.error("Heartbeat request resulted in exception"); + VConsole.error(exception); + } + }; + + rb.setCallback(callback); + + try { + VConsole.log("Sending heartbeat request..."); + rb.send(); + } catch (RequestException re) { + callback.onError(null, re); + } + } } diff --git a/client/src/com/vaadin/terminal/gwt/client/ComponentLocator.java b/client/src/com/vaadin/terminal/gwt/client/ComponentLocator.java index e515c2626c..7c75913126 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ComponentLocator.java +++ b/client/src/com/vaadin/terminal/gwt/client/ComponentLocator.java @@ -28,10 +28,10 @@ import com.vaadin.shared.ComponentState; import com.vaadin.shared.Connector; import com.vaadin.shared.communication.SharedState; import com.vaadin.terminal.gwt.client.ui.SubPartAware; +import com.vaadin.terminal.gwt.client.ui.UI.VUI; import com.vaadin.terminal.gwt.client.ui.gridlayout.VGridLayout; import com.vaadin.terminal.gwt.client.ui.orderedlayout.VBoxLayout; import com.vaadin.terminal.gwt.client.ui.orderedlayout.VMeasuringOrderedLayout; -import com.vaadin.terminal.gwt.client.ui.root.VRoot; import com.vaadin.terminal.gwt.client.ui.tabsheet.VTabsheetPanel; import com.vaadin.terminal.gwt.client.ui.window.VWindow; import com.vaadin.terminal.gwt.client.ui.window.WindowConnector; @@ -386,7 +386,7 @@ public class ComponentLocator { return null; } - if (w instanceof VRoot) { + if (w instanceof VUI) { return ""; } else if (w instanceof VWindow) { Connector windowConnector = ConnectorMap.get(client) diff --git a/client/src/com/vaadin/terminal/gwt/client/LayoutManager.java b/client/src/com/vaadin/terminal/gwt/client/LayoutManager.java index 5bd784d1c6..3deb581848 100644 --- a/client/src/com/vaadin/terminal/gwt/client/LayoutManager.java +++ b/client/src/com/vaadin/terminal/gwt/client/LayoutManager.java @@ -315,7 +315,7 @@ public class LayoutManager { try { cl.layoutHorizontally(); } catch (RuntimeException e) { - VConsole.log(e); + VConsole.error(e); } countLayout(layoutCounts, cl); } else { @@ -326,7 +326,7 @@ public class LayoutManager { try { rr.layout(); } catch (RuntimeException e) { - VConsole.log(e); + VConsole.error(e); } countLayout(layoutCounts, rr); } @@ -343,7 +343,7 @@ public class LayoutManager { try { cl.layoutVertically(); } catch (RuntimeException e) { - VConsole.log(e); + VConsole.error(e); } countLayout(layoutCounts, cl); } else { @@ -354,7 +354,7 @@ public class LayoutManager { try { rr.layout(); } catch (RuntimeException e) { - VConsole.log(e); + VConsole.error(e); } countLayout(layoutCounts, rr); } diff --git a/client/src/com/vaadin/terminal/gwt/client/VDebugConsole.java b/client/src/com/vaadin/terminal/gwt/client/VDebugConsole.java index 1e2a3062f1..022171f2bb 100644 --- a/client/src/com/vaadin/terminal/gwt/client/VDebugConsole.java +++ b/client/src/com/vaadin/terminal/gwt/client/VDebugConsole.java @@ -70,8 +70,8 @@ import com.google.gwt.user.client.ui.Widget; import com.vaadin.shared.Version; import com.vaadin.terminal.gwt.client.ui.VLazyExecutor; import com.vaadin.terminal.gwt.client.ui.VOverlay; +import com.vaadin.terminal.gwt.client.ui.UI.UIConnector; import com.vaadin.terminal.gwt.client.ui.notification.VNotification; -import com.vaadin.terminal.gwt.client.ui.root.RootConnector; import com.vaadin.terminal.gwt.client.ui.window.WindowConnector; /** @@ -924,7 +924,7 @@ public class VDebugConsole extends VOverlay implements Console { } protected void dumpConnectorInfo(ApplicationConnection a) { - RootConnector root = a.getRootConnector(); + UIConnector root = a.getRootConnector(); log("================"); log("Connector hierarchy for Root: " + root.getState().getCaption() + " (" + root.getConnectorId() + ")"); diff --git a/client/src/com/vaadin/terminal/gwt/client/metadata/Property.java b/client/src/com/vaadin/terminal/gwt/client/metadata/Property.java index 082d032e64..69e41ce75d 100644 --- a/client/src/com/vaadin/terminal/gwt/client/metadata/Property.java +++ b/client/src/com/vaadin/terminal/gwt/client/metadata/Property.java @@ -4,6 +4,8 @@ package com.vaadin.terminal.gwt.client.metadata; +import com.vaadin.shared.annotations.DelegateToWidget; + public class Property { private final Type bean; private final String name; @@ -21,15 +23,12 @@ public class Property { TypeDataStore.getSetter(this).invoke(bean, value); } - public String getDelegateToWidgetMethod() { + public String getDelegateToWidgetMethodName() { String value = TypeDataStore.getDelegateToWidget(this); if (value == null) { return null; - } else if (value.isEmpty()) { - return "set" + Character.toUpperCase(value.charAt(0)) - + value.substring(1); } else { - return value; + return DelegateToWidget.Helper.getDelegateTarget(getName(), value); } } diff --git a/client/src/com/vaadin/terminal/gwt/client/metadata/TypeDataStore.java b/client/src/com/vaadin/terminal/gwt/client/metadata/TypeDataStore.java index 55740f69da..9c19410c88 100644 --- a/client/src/com/vaadin/terminal/gwt/client/metadata/TypeDataStore.java +++ b/client/src/com/vaadin/terminal/gwt/client/metadata/TypeDataStore.java @@ -101,6 +101,12 @@ public class TypeDataStore { return get().delegateToWidget.get(property); } + public void setDelegateToWidget(Class<?> clazz, String propertyName, + String delegateValue) { + delegateToWidget.put(new Property(getType(clazz), propertyName), + delegateValue); + } + public void setReturnType(Class<?> type, String methodName, Type returnType) { returnTypes.put(new Method(getType(type), methodName), returnType); } diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java b/client/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java index a50dad0c2f..14d7f4007e 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java @@ -40,8 +40,8 @@ import com.vaadin.terminal.gwt.client.communication.StateChangeEvent; import com.vaadin.terminal.gwt.client.metadata.NoDataException; import com.vaadin.terminal.gwt.client.metadata.Type; import com.vaadin.terminal.gwt.client.metadata.TypeData; +import com.vaadin.terminal.gwt.client.ui.UI.UIConnector; import com.vaadin.terminal.gwt.client.ui.datefield.PopupDateFieldConnector; -import com.vaadin.terminal.gwt.client.ui.root.RootConnector; public abstract class AbstractComponentConnector extends AbstractConnector implements ComponentConnector { @@ -151,7 +151,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector ServerConnector parent = getParent(); if (parent instanceof ComponentContainerConnector) { ((ComponentContainerConnector) parent).updateCaption(this); - } else if (parent == null && !(this instanceof RootConnector)) { + } else if (parent == null && !(this instanceof UIConnector)) { VConsole.error("Parent of connector " + Util.getConnectorString(this) + " is null. This is typically an indication of a broken component hierarchy"); @@ -181,7 +181,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector ServerConnector parent = getParent(); if (parent instanceof ComponentContainerConnector) { ((ComponentContainerConnector) parent).updateCaption(this); - } else if (parent == null && !(this instanceof RootConnector)) { + } else if (parent == null && !(this instanceof UIConnector)) { VConsole.error("Parent of connector " + Util.getConnectorString(this) + " is null. This is typically an indication of a broken component hierarchy"); diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/MediaBaseConnector.java b/client/src/com/vaadin/terminal/gwt/client/ui/MediaBaseConnector.java index 2f52971aeb..33d97f4ed8 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/MediaBaseConnector.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/MediaBaseConnector.java @@ -49,9 +49,6 @@ public abstract class MediaBaseConnector extends AbstractComponentConnector { public void onStateChanged(StateChangeEvent stateChangeEvent) { super.onStateChanged(stateChangeEvent); - getWidget().setControls(getState().isShowControls()); - getWidget().setAutoplay(getState().isAutoplay()); - getWidget().setMuted(getState().isMuted()); for (int i = 0; i < getState().getSources().size(); i++) { URLReference source = getState().getSources().get(i); String sourceType = getState().getSourceTypes().get(i); diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java b/client/src/com/vaadin/terminal/gwt/client/ui/UI/UIConnector.java index b3490effa7..4e1bed1aa8 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/UI/UIConnector.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.terminal.gwt.client.ui.root; +package com.vaadin.terminal.gwt.client.ui.UI; import java.util.ArrayList; import java.util.Iterator; @@ -36,10 +36,10 @@ import com.google.web.bindery.event.shared.HandlerRegistration; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.Connect.LoadStyle; -import com.vaadin.shared.ui.root.PageClientRpc; -import com.vaadin.shared.ui.root.RootConstants; -import com.vaadin.shared.ui.root.RootServerRpc; -import com.vaadin.shared.ui.root.RootState; +import com.vaadin.shared.ui.ui.PageClientRpc; +import com.vaadin.shared.ui.ui.UIConstants; +import com.vaadin.shared.ui.ui.UIServerRpc; +import com.vaadin.shared.ui.ui.UIState; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.ComponentConnector; @@ -58,13 +58,13 @@ import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler; import com.vaadin.terminal.gwt.client.ui.layout.MayScrollChildren; import com.vaadin.terminal.gwt.client.ui.notification.VNotification; import com.vaadin.terminal.gwt.client.ui.window.WindowConnector; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; -@Connect(value = Root.class, loadStyle = LoadStyle.EAGER) -public class RootConnector extends AbstractComponentContainerConnector +@Connect(value = UI.class, loadStyle = LoadStyle.EAGER) +public class UIConnector extends AbstractComponentContainerConnector implements Paintable, MayScrollChildren { - private RootServerRpc rpc = RpcProxy.create(RootServerRpc.class, this); + private UIServerRpc rpc = RpcProxy.create(UIServerRpc.class, this); private HandlerRegistration childStateChangeHandlerRegistration; @@ -107,7 +107,7 @@ public class RootConnector extends AbstractComponentContainerConnector getWidget().connection = client; getWidget().immediate = getState().isImmediate(); - getWidget().resizeLazy = uidl.hasAttribute(RootConstants.RESIZE_LAZY); + getWidget().resizeLazy = uidl.hasAttribute(UIConstants.RESIZE_LAZY); String newTheme = uidl.getStringAttribute("theme"); if (getWidget().theme != null && !newTheme.equals(getWidget().theme)) { // Complete page refresh is needed due css can affect layout @@ -151,14 +151,14 @@ public class RootConnector extends AbstractComponentContainerConnector Scheduler.get().scheduleDeferred(new Command() { @Override public void execute() { - VRoot.goTo(url); + VUI.goTo(url); } }); } else if ("_self".equals(target)) { // This window is closing (for sure). Only other opens are // relevant in this change. See #3558, #2144 isClosed = true; - VRoot.goTo(url); + VUI.goTo(url); } else { String options; if (open.hasAttribute("border")) { @@ -263,9 +263,9 @@ public class RootConnector extends AbstractComponentContainerConnector scrollIntoView(connector); } - if (uidl.hasAttribute(RootConstants.FRAGMENT_VARIABLE)) { + if (uidl.hasAttribute(UIConstants.FRAGMENT_VARIABLE)) { getWidget().currentFragment = uidl - .getStringAttribute(RootConstants.FRAGMENT_VARIABLE); + .getStringAttribute(UIConstants.FRAGMENT_VARIABLE); if (!getWidget().currentFragment.equals(History.getToken())) { History.newItem(getWidget().currentFragment, true); } @@ -276,7 +276,7 @@ public class RootConnector extends AbstractComponentContainerConnector // Include current fragment in the next request client.updateVariable(getWidget().id, - RootConstants.FRAGMENT_VARIABLE, + UIConstants.FRAGMENT_VARIABLE, getWidget().currentFragment, false); } @@ -333,8 +333,8 @@ public class RootConnector extends AbstractComponentContainerConnector } @Override - public VRoot getWidget() { - return (VRoot) super.getWidget(); + public VUI getWidget() { + return (VUI) super.getWidget(); } protected ComponentConnector getContent() { @@ -359,7 +359,7 @@ public class RootConnector extends AbstractComponentContainerConnector } /** - * Checks if the given sub window is a child of this Root Connector + * Checks if the given sub window is a child of this UI Connector * * @deprecated Should be replaced by a more generic mechanism for getting * non-ComponentConnector children @@ -388,8 +388,8 @@ public class RootConnector extends AbstractComponentContainerConnector } @Override - public RootState getState() { - return (RootState) super.getState(); + public UIState getState() { + return (UIState) super.getState(); } @Override @@ -453,5 +453,4 @@ public class RootConnector extends AbstractComponentContainerConnector } }); } - } diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java b/client/src/com/vaadin/terminal/gwt/client/ui/UI/VUI.java index 162e7c55a8..1c4b69a3b9 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/UI/VUI.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.terminal.gwt.client.ui.root; +package com.vaadin.terminal.gwt.client.ui.UI; import java.util.ArrayList; @@ -33,7 +33,7 @@ import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.SimplePanel; import com.vaadin.shared.ApplicationConstants; -import com.vaadin.shared.ui.root.RootConstants; +import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.ComponentConnector; @@ -50,7 +50,7 @@ import com.vaadin.terminal.gwt.client.ui.textfield.VTextField; /** * */ -public class VRoot extends SimplePanel implements ResizeHandler, +public class VUI extends SimplePanel implements ResizeHandler, Window.ClosingHandler, ShortcutActionHandlerOwner, Focusable, HasResizeHandlers { @@ -130,7 +130,7 @@ public class VRoot extends SimplePanel implements ResizeHandler, // Send the new fragment to the server if it has changed if (!newFragment.equals(currentFragment) && connection != null) { currentFragment = newFragment; - connection.updateVariable(id, RootConstants.FRAGMENT_VARIABLE, + connection.updateVariable(id, UIConstants.FRAGMENT_VARIABLE, newFragment, true); } } @@ -146,7 +146,7 @@ public class VRoot extends SimplePanel implements ResizeHandler, }); - public VRoot() { + public VUI() { super(); setStyleName(CLASSNAME); diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/embeddedbrowser/EmbeddedBrowserConnector.java b/client/src/com/vaadin/terminal/gwt/client/ui/embeddedbrowser/EmbeddedBrowserConnector.java new file mode 100644 index 0000000000..61231c4fba --- /dev/null +++ b/client/src/com/vaadin/terminal/gwt/client/ui/embeddedbrowser/EmbeddedBrowserConnector.java @@ -0,0 +1,38 @@ +package com.vaadin.terminal.gwt.client.ui.embeddedbrowser; + +import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.embeddedbrowser.EmbeddedBrowserState; +import com.vaadin.terminal.gwt.client.communication.StateChangeEvent; +import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector; + +@Connect(com.vaadin.ui.EmbeddedBrowser.class) +public class EmbeddedBrowserConnector extends AbstractComponentConnector { + + @Override + protected void init() { + super.init(); + } + + @Override + public VEmbeddedBrowser getWidget() { + return (VEmbeddedBrowser) super.getWidget(); + } + + @Override + public EmbeddedBrowserState getState() { + return (EmbeddedBrowserState) super.getState(); + } + + @Override + public void onStateChanged(StateChangeEvent stateChangeEvent) { + + super.onStateChanged(stateChangeEvent); + + getWidget().setAlternateText(getState().getAlternateText()); + getWidget().setSource( + getState().getSource() != null ? getState().getSource() + .getURL() : null); + getWidget().setName(getConnectorId()); + } + +} diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/embeddedbrowser/VEmbeddedBrowser.java b/client/src/com/vaadin/terminal/gwt/client/ui/embeddedbrowser/VEmbeddedBrowser.java new file mode 100644 index 0000000000..fffbff049e --- /dev/null +++ b/client/src/com/vaadin/terminal/gwt/client/ui/embeddedbrowser/VEmbeddedBrowser.java @@ -0,0 +1,120 @@ +package com.vaadin.terminal.gwt.client.ui.embeddedbrowser; + +import com.google.gwt.dom.client.Document; +import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.IFrameElement; +import com.google.gwt.user.client.ui.Widget; + +public class VEmbeddedBrowser extends Widget { + + protected IFrameElement iframe; + protected Element altElement; + protected String altText; + + public VEmbeddedBrowser() { + Element root = Document.get().createDivElement(); + setElement(root); + + setStylePrimaryName("v-embeddedbrowser"); + + createAltTextElement(); + } + + /** + * Always creates new iframe inside widget. Will replace previous iframe. + * + * @return + */ + protected IFrameElement createIFrameElement(String src) { + String name = null; + + // Remove alt text + if (altElement != null) { + getElement().removeChild(altElement); + altElement = null; + } + + // Remove old iframe + if (iframe != null) { + name = iframe.getAttribute("name"); + getElement().removeChild(iframe); + iframe = null; + } + + iframe = Document.get().createIFrameElement(); + iframe.setSrc(src); + iframe.setFrameBorder(0); + iframe.setAttribute("width", "100%"); + iframe.setAttribute("height", "100%"); + iframe.setAttribute("allowTransparency", "true"); + + getElement().appendChild(iframe); + + // Reset old attributes (except src) + if (name != null) { + iframe.setName(name); + } + + return iframe; + } + + protected void createAltTextElement() { + if (iframe != null) { + return; + } + + if (altElement == null) { + altElement = Document.get().createSpanElement(); + getElement().appendChild(altElement); + } + + if (altText != null) { + altElement.setInnerText(altText); + } else { + altElement.setInnerText(""); + } + } + + public void setAlternateText(String altText) { + if (this.altText != altText) { + this.altText = altText; + if (altElement != null) { + if (altText != null) { + altElement.setInnerText(altText); + } else { + altElement.setInnerText(""); + } + } + } + } + + /** + * Set the source (the "src" attribute) of iframe. Will replace old iframe + * with new. + * + * @param source + * Source of iframe. + */ + public void setSource(String source) { + + if (source == null) { + if (iframe != null) { + getElement().removeChild(iframe); + iframe = null; + } + createAltTextElement(); + setAlternateText(altText); + return; + } + + if (iframe == null || iframe.getSrc() != source) { + createIFrameElement(source); + } + } + + public void setName(String name) { + if (iframe != null) { + iframe.setName(name); + } + } +} diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/flash/FlashConnector.java b/client/src/com/vaadin/terminal/gwt/client/ui/flash/FlashConnector.java new file mode 100644 index 0000000000..a9e7a71013 --- /dev/null +++ b/client/src/com/vaadin/terminal/gwt/client/ui/flash/FlashConnector.java @@ -0,0 +1,44 @@ +package com.vaadin.terminal.gwt.client.ui.flash; + +import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.flash.FlashState; +import com.vaadin.terminal.gwt.client.communication.StateChangeEvent; +import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector; + +@Connect(com.vaadin.ui.Flash.class) +public class FlashConnector extends AbstractComponentConnector { + + @Override + protected void init() { + super.init(); + } + + @Override + public VFlash getWidget() { + return (VFlash) super.getWidget(); + } + + @Override + public FlashState getState() { + return (FlashState) super.getState(); + } + + @Override + public void onStateChanged(StateChangeEvent stateChangeEvent) { + + super.onStateChanged(stateChangeEvent); + + getWidget().setSource( + getState().getSource() != null ? getState().getSource() + .getURL() : null); + getWidget().setArchive(getState().getArchive()); + getWidget().setClassId(getState().getClassId()); + getWidget().setCodebase(getState().getCodebase()); + getWidget().setCodetype(getState().getCodetype()); + getWidget().setStandby(getState().getStandby()); + getWidget().setAlternateText(getState().getAlternateText()); + getWidget().setEmbedParams(getState().getEmbedParams()); + + getWidget().rebuildIfNeeded(); + } +} diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/flash/VFlash.java b/client/src/com/vaadin/terminal/gwt/client/ui/flash/VFlash.java new file mode 100644 index 0000000000..5d60dc66aa --- /dev/null +++ b/client/src/com/vaadin/terminal/gwt/client/ui/flash/VFlash.java @@ -0,0 +1,228 @@ +package com.vaadin.terminal.gwt.client.ui.flash; + +import java.util.HashMap; +import java.util.Map; + +import com.google.gwt.user.client.ui.HTML; +import com.vaadin.terminal.gwt.client.Util; + +public class VFlash extends HTML { + + protected String source; + protected String altText; + protected String classId; + protected String codebase; + protected String codetype; + protected String standby; + protected String archive; + protected Map<String, String> embedParams = new HashMap<String, String>(); + protected boolean needsRebuild = false; + protected String width; + protected String height; + + public VFlash() { + setStylePrimaryName("v-flash"); + } + + public void setSource(String source) { + if (this.source != source) { + this.source = source; + needsRebuild = true; + } + } + + public void setAlternateText(String altText) { + if (this.altText != altText) { + this.altText = altText; + needsRebuild = true; + } + } + + public void setClassId(String classId) { + if (this.classId != classId) { + this.classId = classId; + needsRebuild = true; + } + } + + public void setCodebase(String codebase) { + if (this.codebase != codebase) { + this.codebase = codebase; + needsRebuild = true; + } + } + + public void setCodetype(String codetype) { + if (this.codetype != codetype) { + this.codetype = codetype; + needsRebuild = true; + } + } + + public void setStandby(String standby) { + if (this.standby != standby) { + this.standby = standby; + needsRebuild = true; + } + } + + public void setArchive(String archive) { + if (this.archive != archive) { + this.archive = archive; + needsRebuild = true; + } + } + + /** + * Call this after changing values of widget. It will rebuild embedding + * structure if needed. + */ + public void rebuildIfNeeded() { + if (needsRebuild) { + needsRebuild = false; + this.setHTML(createFlashEmbed()); + } + } + + @Override + public void setWidth(String width) { + // super.setWidth(height); + + if (this.width != width) { + this.width = width; + needsRebuild = true; + } + } + + @Override + public void setHeight(String height) { + // super.setHeight(height); + + if (this.height != height) { + this.height = height; + needsRebuild = true; + } + } + + public void setEmbedParams(Map<String, String> params) { + if (params == null) { + if (!embedParams.isEmpty()) { + embedParams.clear(); + needsRebuild = true; + } + return; + } + + if (!embedParams.equals(params)) { + embedParams = new HashMap<String, String>(params); + needsRebuild = true; + } + } + + protected String createFlashEmbed() { + /* + * To ensure cross-browser compatibility we are using the twice-cooked + * method to embed flash i.e. we add a OBJECT tag for IE ActiveX and + * inside it a EMBED for all other browsers. + */ + + StringBuilder html = new StringBuilder(); + + // Start the object tag + html.append("<object "); + + /* + * Add classid required for ActiveX to recognize the flash. This is a + * predefined value which ActiveX recognizes and must be the given + * value. More info can be found on + * http://kb2.adobe.com/cps/415/tn_4150.html. Allow user to override + * this by setting his own classid. + */ + if (classId != null) { + html.append("classid=\"" + Util.escapeAttribute(classId) + "\" "); + } else { + html.append("classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "); + } + + /* + * Add codebase required for ActiveX and must be exactly this according + * to http://kb2.adobe.com/cps/415/tn_4150.html to work with the above + * given classid. Again, see more info on + * http://kb2.adobe.com/cps/415/tn_4150.html. Limiting Flash version to + * 6.0.0.0 and above. Allow user to override this by setting his own + * codebase + */ + if (codebase != null) { + html.append("codebase=\"" + Util.escapeAttribute(codebase) + "\" "); + } else { + html.append("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" "); + } + + // Add width and height + html.append("width=\"" + Util.escapeAttribute(width) + "\" "); + html.append("height=\"" + Util.escapeAttribute(height) + "\" "); + html.append("type=\"application/x-shockwave-flash\" "); + + // Codetype + if (codetype != null) { + html.append("codetype=\"" + Util.escapeAttribute(codetype) + "\" "); + } + + // Standby + if (standby != null) { + html.append("standby=\"" + Util.escapeAttribute(standby) + "\" "); + } + + // Archive + if (archive != null) { + html.append("archive=\"" + Util.escapeAttribute(archive) + "\" "); + } + + // End object tag + html.append(">"); + + // Ensure we have an movie parameter + if (embedParams.get("movie") == null) { + embedParams.put("movie", source); + } + + // Add parameters to OBJECT + for (String name : embedParams.keySet()) { + html.append("<param "); + html.append("name=\"" + Util.escapeAttribute(name) + "\" "); + html.append("value=\"" + + Util.escapeAttribute(embedParams.get(name)) + "\" "); + html.append("/>"); + } + + // Build inner EMBED tag + html.append("<embed "); + html.append("src=\"" + Util.escapeAttribute(source) + "\" "); + html.append("width=\"" + Util.escapeAttribute(width) + "\" "); + html.append("height=\"" + Util.escapeAttribute(height) + "\" "); + html.append("type=\"application/x-shockwave-flash\" "); + + // Add the parameters to the Embed + for (String name : embedParams.keySet()) { + html.append(Util.escapeAttribute(name)); + html.append("="); + html.append("\"" + Util.escapeAttribute(embedParams.get(name)) + + "\""); + } + + // End embed tag + html.append("></embed>"); + + if (altText != null) { + html.append("<noembed>"); + html.append(altText); + html.append("</noembed>"); + } + + // End object tag + html.append("</object>"); + + return html.toString(); + } + +} diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/image/ImageConnector.java b/client/src/com/vaadin/terminal/gwt/client/ui/image/ImageConnector.java new file mode 100644 index 0000000000..d36e224a03 --- /dev/null +++ b/client/src/com/vaadin/terminal/gwt/client/ui/image/ImageConnector.java @@ -0,0 +1,67 @@ +package com.vaadin.terminal.gwt.client.ui.image; + +import com.google.gwt.dom.client.NativeEvent; +import com.google.gwt.event.dom.client.LoadEvent; +import com.google.gwt.event.dom.client.LoadHandler; +import com.vaadin.shared.MouseEventDetails; +import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.image.ImageServerRpc; +import com.vaadin.shared.ui.image.ImageState; +import com.vaadin.terminal.gwt.client.communication.RpcProxy; +import com.vaadin.terminal.gwt.client.communication.StateChangeEvent; +import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector; +import com.vaadin.terminal.gwt.client.ui.ClickEventHandler; + +@Connect(com.vaadin.ui.Image.class) +public class ImageConnector extends AbstractComponentConnector { + + ImageServerRpc rpc; + + @Override + protected void init() { + super.init(); + rpc = RpcProxy.create(ImageServerRpc.class, this); + getWidget().addHandler(new LoadHandler() { + + @Override + public void onLoad(LoadEvent event) { + getLayoutManager().setNeedsMeasure(ImageConnector.this); + } + + }, LoadEvent.getType()); + } + + @Override + public VImage getWidget() { + return (VImage) super.getWidget(); + } + + @Override + public ImageState getState() { + return (ImageState) super.getState(); + } + + @Override + public void onStateChanged(StateChangeEvent stateChangeEvent) { + super.onStateChanged(stateChangeEvent); + + clickEventHandler.handleEventHandlerRegistration(); + + getWidget().setUrl( + getState().getSource() != null ? getState().getSource() + .getURL() : null); + getWidget().setAltText(getState().getAlternateText()); + } + + protected final ClickEventHandler clickEventHandler = new ClickEventHandler( + this) { + + @Override + protected void fireClick(NativeEvent event, + MouseEventDetails mouseDetails) { + rpc.click(mouseDetails); + } + + }; + +} diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/image/VImage.java b/client/src/com/vaadin/terminal/gwt/client/ui/image/VImage.java new file mode 100644 index 0000000000..7e6b77ed4a --- /dev/null +++ b/client/src/com/vaadin/terminal/gwt/client/ui/image/VImage.java @@ -0,0 +1,10 @@ +package com.vaadin.terminal.gwt.client.ui.image; + +import com.google.gwt.user.client.ui.Image; + +public class VImage extends Image { + + public VImage() { + setStylePrimaryName("v-image"); + } +} diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/notification/VNotification.java b/client/src/com/vaadin/terminal/gwt/client/ui/notification/VNotification.java index b4cea2dc72..b668c9a88c 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/notification/VNotification.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/notification/VNotification.java @@ -30,7 +30,7 @@ import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Widget; import com.vaadin.shared.Position; -import com.vaadin.shared.ui.root.RootConstants; +import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.UIDL; @@ -384,19 +384,19 @@ public class VNotification extends VOverlay { public static void showNotification(ApplicationConnection client, final UIDL notification) { boolean onlyPlainText = notification - .hasAttribute(RootConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED); + .hasAttribute(UIConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED); String html = ""; if (notification - .hasAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_ICON)) { + .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_ICON)) { final String parsedUri = client .translateVaadinUri(notification - .getStringAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_ICON)); + .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_ICON)); html += "<img src=\"" + Util.escapeAttribute(parsedUri) + "\" />"; } if (notification - .hasAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_CAPTION)) { + .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION)) { String caption = notification - .getStringAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_CAPTION); + .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION); if (onlyPlainText) { caption = Util.escapeHTML(caption); caption = caption.replaceAll("\\n", "<br />"); @@ -404,9 +404,9 @@ public class VNotification extends VOverlay { html += "<h1>" + caption + "</h1>"; } if (notification - .hasAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_MESSAGE)) { + .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE)) { String message = notification - .getStringAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_MESSAGE); + .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE); if (onlyPlainText) { message = Util.escapeHTML(message); message = message.replaceAll("\\n", "<br />"); @@ -415,16 +415,16 @@ public class VNotification extends VOverlay { } final String style = notification - .hasAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_STYLE) ? notification - .getStringAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_STYLE) + .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_STYLE) ? notification + .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_STYLE) : null; final int pos = notification - .getIntAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_POSITION); + .getIntAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_POSITION); Position position = Position.values()[pos]; final int delay = notification - .getIntAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_DELAY); + .getIntAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY); createNotification(delay).show(html, position, style); } diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/slider/SliderConnector.java b/client/src/com/vaadin/terminal/gwt/client/ui/slider/SliderConnector.java index 7e0617b7dc..53f3b8874b 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/slider/SliderConnector.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/slider/SliderConnector.java @@ -15,70 +15,61 @@ */ package com.vaadin.terminal.gwt.client.ui.slider; -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.user.client.Command; +import com.google.gwt.event.logical.shared.ValueChangeEvent; +import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.vaadin.shared.ui.Connect; -import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.Paintable; -import com.vaadin.terminal.gwt.client.UIDL; +import com.vaadin.shared.ui.slider.SliderServerRpc; +import com.vaadin.shared.ui.slider.SliderState; +import com.vaadin.terminal.gwt.client.communication.RpcProxy; +import com.vaadin.terminal.gwt.client.communication.StateChangeEvent; import com.vaadin.terminal.gwt.client.ui.AbstractFieldConnector; import com.vaadin.ui.Slider; @Connect(Slider.class) public class SliderConnector extends AbstractFieldConnector implements - Paintable { + ValueChangeHandler<Double> { - @Override - public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - - getWidget().client = client; - getWidget().id = uidl.getId(); - - if (!isRealUpdate(uidl)) { - return; - } + protected SliderServerRpc rpc = RpcProxy + .create(SliderServerRpc.class, this); - getWidget().immediate = getState().isImmediate(); - getWidget().disabled = !isEnabled(); - getWidget().readonly = isReadOnly(); + @Override + public void init() { + super.init(); + getWidget().setConnection(getConnection()); + getWidget().addValueChangeHandler(this); + } - getWidget().vertical = uidl.hasAttribute("vertical"); + @Override + public VSlider getWidget() { + return (VSlider) super.getWidget(); + } - // TODO should style names be used? + @Override + public SliderState getState() { + return (SliderState) super.getState(); + } - if (getWidget().vertical) { - getWidget().addStyleName(VSlider.CLASSNAME + "-vertical"); - } else { - getWidget().removeStyleName(VSlider.CLASSNAME + "-vertical"); - } + @Override + public void onValueChange(ValueChangeEvent<Double> event) { + rpc.valueChanged(event.getValue()); + } - getWidget().min = uidl.getDoubleAttribute("min"); - getWidget().max = uidl.getDoubleAttribute("max"); - getWidget().resolution = uidl.getIntAttribute("resolution"); - getWidget().value = new Double(uidl.getDoubleVariable("value")); + @Override + public void onStateChanged(StateChangeEvent stateChangeEvent) { + super.onStateChanged(stateChangeEvent); - getWidget().setFeedbackValue(getWidget().value); + getWidget().setId(getConnectorId()); + getWidget().setImmediate(getState().isImmediate()); + getWidget().setDisabled(!isEnabled()); + getWidget().setReadOnly(isReadOnly()); + getWidget().setOrientation(getState().getOrientation()); + getWidget().setMinValue(getState().getMinValue()); + getWidget().setMaxValue(getState().getMaxValue()); + getWidget().setResolution(getState().getResolution()); + getWidget().setValue(getState().getValue(), false); + getWidget().setFeedbackValue(getState().getValue()); getWidget().buildBase(); - - if (!getWidget().vertical) { - // Draw handle with a delay to allow base to gain maximum width - Scheduler.get().scheduleDeferred(new Command() { - @Override - public void execute() { - getWidget().buildHandle(); - getWidget().setValue(getWidget().value, false); - } - }); - } else { - getWidget().buildHandle(); - getWidget().setValue(getWidget().value, false); - } - } - - @Override - public VSlider getWidget() { - return (VSlider) super.getWidget(); } } diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java b/client/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java index 9667522eb3..d9801626b4 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java @@ -19,12 +19,17 @@ package com.vaadin.terminal.gwt.client.ui.slider; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.event.dom.client.KeyCodes; +import com.google.gwt.event.logical.shared.ValueChangeEvent; +import com.google.gwt.event.logical.shared.ValueChangeHandler; +import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.HasValue; +import com.vaadin.shared.ui.slider.SliderOrientation; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.ContainerResizedListener; @@ -36,7 +41,7 @@ import com.vaadin.terminal.gwt.client.ui.VLazyExecutor; import com.vaadin.terminal.gwt.client.ui.VOverlay; public class VSlider extends SimpleFocusablePanel implements Field, - ContainerResizedListener { + ContainerResizedListener, HasValue<Double> { public static final String CLASSNAME = "v-slider"; @@ -46,20 +51,22 @@ public class VSlider extends SimpleFocusablePanel implements Field, */ private static final int MIN_SIZE = 50; - ApplicationConnection client; + protected ApplicationConnection client; - String id; + protected String id; - boolean immediate; - boolean disabled; - boolean readonly; + protected boolean immediate; + protected boolean disabled; + protected boolean readonly; private int acceleration = 1; - double min; - double max; - int resolution; - Double value; - boolean vertical; + protected double min; + protected double max; + protected int resolution; + protected Double value; + protected SliderOrientation orientation = SliderOrientation.HORIZONTAL; + + private boolean valueChangeHandlerInitialized = false; private final HTML feedback = new HTML("", false); private final VOverlay feedbackPopup = new VOverlay(true, false, true) { @@ -92,7 +99,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, @Override public void execute() { - updateValueToServer(); + fireValueChanged(); acceleration = 1; } }); @@ -137,7 +144,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, } private void updateFeedbackPosition() { - if (vertical) { + if (isVertical()) { feedbackPopup.setPopupPosition( DOM.getAbsoluteLeft(handle) + handle.getOffsetWidth(), DOM.getAbsoluteTop(handle) + handle.getOffsetHeight() / 2 @@ -152,16 +159,17 @@ public class VSlider extends SimpleFocusablePanel implements Field, } void buildBase() { - final String styleAttribute = vertical ? "height" : "width"; - final String oppositeStyleAttribute = vertical ? "width" : "height"; - final String domProperty = vertical ? "offsetHeight" : "offsetWidth"; + final String styleAttribute = isVertical() ? "height" : "width"; + final String oppositeStyleAttribute = isVertical() ? "width" : "height"; + final String domProperty = isVertical() ? "offsetHeight" + : "offsetWidth"; // clear unnecessary opposite style attribute DOM.setStyleAttribute(base, oppositeStyleAttribute, ""); final Element p = DOM.getParent(getElement()); if (DOM.getElementPropertyInt(p, domProperty) > 50) { - if (vertical) { + if (isVertical()) { setHeight(); } else { DOM.setStyleAttribute(base, styleAttribute, ""); @@ -176,7 +184,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, public void execute() { final Element p = DOM.getParent(getElement()); if (DOM.getElementPropertyInt(p, domProperty) > (MIN_SIZE + 5)) { - if (vertical) { + if (isVertical()) { setHeight(); } else { DOM.setStyleAttribute(base, styleAttribute, ""); @@ -188,12 +196,27 @@ public class VSlider extends SimpleFocusablePanel implements Field, }); } + if (!isVertical()) { + // Draw handle with a delay to allow base to gain maximum width + Scheduler.get().scheduleDeferred(new Command() { + @Override + public void execute() { + buildHandle(); + setValue(value, false); + } + }); + } else { + buildHandle(); + setValue(value, false); + } + // TODO attach listeners for focusing and arrow keys } void buildHandle() { - final String handleAttribute = vertical ? "marginTop" : "marginLeft"; - final String oppositeHandleAttribute = vertical ? "marginLeft" + final String handleAttribute = isVertical() ? "marginTop" + : "marginLeft"; + final String oppositeHandleAttribute = isVertical() ? "marginLeft" : "marginTop"; DOM.setStyleAttribute(handle, handleAttribute, "0"); @@ -206,59 +229,6 @@ public class VSlider extends SimpleFocusablePanel implements Field, } - void setValue(Double value, boolean updateToServer) { - if (value == null) { - return; - } - - if (value < min) { - value = min; - } else if (value > max) { - value = max; - } - - // Update handle position - final String styleAttribute = vertical ? "marginTop" : "marginLeft"; - final String domProperty = vertical ? "offsetHeight" : "offsetWidth"; - final int handleSize = Integer.parseInt(DOM.getElementProperty(handle, - domProperty)); - final int baseSize = Integer.parseInt(DOM.getElementProperty(base, - domProperty)) - (2 * BASE_BORDER_WIDTH); - - final int range = baseSize - handleSize; - double v = value.doubleValue(); - - // Round value to resolution - if (resolution > 0) { - v = Math.round(v * Math.pow(10, resolution)); - v = v / Math.pow(10, resolution); - } else { - v = Math.round(v); - } - final double valueRange = max - min; - double p = 0; - if (valueRange > 0) { - p = range * ((v - min) / valueRange); - } - if (p < 0) { - p = 0; - } - if (vertical) { - p = range - p; - } - final double pos = p; - - DOM.setStyleAttribute(handle, styleAttribute, (Math.round(pos)) + "px"); - - // Update value - this.value = new Double(v); - setFeedbackValue(v); - - if (updateToServer) { - updateValueToServer(); - } - } - @Override public void onBrowserEvent(Event event) { if (disabled || readonly) { @@ -386,7 +356,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, final int coord = getEventPosition(event); final int handleSize, baseSize, baseOffset; - if (vertical) { + if (isVertical()) { handleSize = handle.getOffsetHeight(); baseSize = base.getOffsetHeight(); baseOffset = base.getAbsoluteTop() - Window.getScrollTop() @@ -398,7 +368,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, + handleSize / 2; } - if (vertical) { + if (isVertical()) { v = ((baseSize - (coord - baseOffset)) / (double) (baseSize - handleSize)) * (max - min) + min; } else { @@ -423,7 +393,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, * @return */ protected int getEventPosition(Event event) { - if (vertical) { + if (isVertical()) { return Util.getTouchOrMouseClientY(event); } else { return Util.getTouchOrMouseClientX(event); @@ -432,7 +402,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, @Override public void iLayout() { - if (vertical) { + if (isVertical()) { setHeight(); } // Update handle position @@ -451,8 +421,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, DOM.setStyleAttribute(base, "overflow", ""); } - private void updateValueToServer() { - client.updateVariable(id, "value", value.doubleValue(), immediate); + private void fireValueChanged() { + ValueChangeEvent.fire(VSlider.this, value); } /** @@ -469,8 +439,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, return false; } - if ((keycode == getNavigationUpKey() && vertical) - || (keycode == getNavigationRightKey() && !vertical)) { + if ((keycode == getNavigationUpKey() && isVertical()) + || (keycode == getNavigationRightKey() && !isVertical())) { if (shift) { for (int a = 0; a < acceleration; a++) { increaseValue(false); @@ -480,8 +450,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, increaseValue(false); } return true; - } else if (keycode == getNavigationDownKey() && vertical - || (keycode == getNavigationLeftKey() && !vertical)) { + } else if (keycode == getNavigationDownKey() && isVertical() + || (keycode == getNavigationLeftKey() && !isVertical())) { if (shift) { for (int a = 0; a < acceleration; a++) { decreaseValue(false); @@ -539,4 +509,119 @@ public class VSlider extends SimpleFocusablePanel implements Field, protected int getNavigationRightKey() { return KeyCodes.KEY_RIGHT; } + + public void setConnection(ApplicationConnection client) { + this.client = client; + } + + public void setId(String id) { + this.id = id; + } + + public void setImmediate(boolean immediate) { + this.immediate = immediate; + } + + public void setDisabled(boolean disabled) { + this.disabled = disabled; + } + + public void setReadOnly(boolean readonly) { + this.readonly = readonly; + } + + private boolean isVertical() { + return orientation == SliderOrientation.VERTICAL; + } + + public void setOrientation(SliderOrientation orientation) { + if (this.orientation != orientation) { + this.orientation = orientation; + + if (isVertical()) { + addStyleName(VSlider.CLASSNAME + "-vertical"); + } else { + removeStyleName(VSlider.CLASSNAME + "-vertical"); + } + } + } + + public void setMinValue(double value) { + min = value; + } + + public void setMaxValue(double value) { + max = value; + } + + public void setResolution(int resolution) { + this.resolution = resolution; + } + + public HandlerRegistration addValueChangeHandler( + ValueChangeHandler<Double> handler) { + return addHandler(handler, ValueChangeEvent.getType()); + } + + public Double getValue() { + return value; + } + + public void setValue(Double value) { + if (value < min) { + value = min; + } else if (value > max) { + value = max; + } + + // Update handle position + final String styleAttribute = isVertical() ? "marginTop" : "marginLeft"; + final String domProperty = isVertical() ? "offsetHeight" + : "offsetWidth"; + final int handleSize = Integer.parseInt(DOM.getElementProperty(handle, + domProperty)); + final int baseSize = Integer.parseInt(DOM.getElementProperty(base, + domProperty)) - (2 * BASE_BORDER_WIDTH); + + final int range = baseSize - handleSize; + double v = value.doubleValue(); + + // Round value to resolution + if (resolution > 0) { + v = Math.round(v * Math.pow(10, resolution)); + v = v / Math.pow(10, resolution); + } else { + v = Math.round(v); + } + final double valueRange = max - min; + double p = 0; + if (valueRange > 0) { + p = range * ((v - min) / valueRange); + } + if (p < 0) { + p = 0; + } + if (isVertical()) { + p = range - p; + } + final double pos = p; + + DOM.setStyleAttribute(handle, styleAttribute, (Math.round(pos)) + "px"); + + // Update value + this.value = new Double(v); + setFeedbackValue(v); + } + + public void setValue(Double value, boolean fireEvents) { + if (value == null) { + return; + } + + setValue(value); + + if (fireEvents) { + fireValueChanged(); + } + } } diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/splitpanel/AbstractSplitPanelConnector.java b/client/src/com/vaadin/terminal/gwt/client/ui/splitpanel/AbstractSplitPanelConnector.java index 9f4df02380..912f9a7c83 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/splitpanel/AbstractSplitPanelConnector.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/splitpanel/AbstractSplitPanelConnector.java @@ -138,9 +138,6 @@ public abstract class AbstractSplitPanelConnector extends // Splitter updates SplitterState splitterState = getState().getSplitterState(); - getWidget().setLocked(splitterState.isLocked()); - getWidget().setPositionReversed(splitterState.isPositionReversed()); - getWidget().setStylenames(); getWidget().minimumPosition = splitterState.getMinPosition() diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java b/client/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java index 345eebc8aa..eda3f7090f 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java @@ -5256,6 +5256,27 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return false; } + /** + * Checks if the row represented by the row key has been selected + * + * @param key + * The generated row key + */ + private boolean rowKeyIsSelected(int rowKey) { + // Check single selections + if (selectedRowKeys.contains("" + rowKey)) { + return true; + } + + // Check range selections + for (SelectionRange r : selectedRowRanges) { + if (r.inRange(getRenderedRowByKey("" + rowKey))) { + return true; + } + } + return false; + } + protected void startRowDrag(Event event, final int type, Element targetTdOrTr) { VTransferable transferable = new VTransferable(); @@ -5274,17 +5295,23 @@ public class VScrollTable extends FlowPanel implements HasWidgets, VDragEvent ev = VDragAndDropManager.get().startDrag( transferable, event, true); if (dragmode == DRAGMODE_MULTIROW && isMultiSelectModeAny() - && selectedRowKeys.contains("" + rowKey)) { + && rowKeyIsSelected(rowKey)) { + + // Create a drag image of ALL rows ev.createDragImage( (Element) scrollBody.tBodyElement.cast(), true); + + // Hide rows which are not selected Element dragImage = ev.getDragImage(); int i = 0; for (Iterator<Widget> iterator = scrollBody.iterator(); iterator .hasNext();) { VScrollTableRow next = (VScrollTableRow) iterator .next(); + Element child = (Element) dragImage.getChild(i++); - if (!selectedRowKeys.contains("" + next.rowKey)) { + + if (!rowKeyIsSelected(next.rowKey)) { child.getStyle().setVisibility(Visibility.HIDDEN); } } diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/textarea/TextAreaConnector.java b/client/src/com/vaadin/terminal/gwt/client/ui/textarea/TextAreaConnector.java index 5fb7f97044..d5abed4fa9 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/textarea/TextAreaConnector.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/textarea/TextAreaConnector.java @@ -18,7 +18,6 @@ package com.vaadin.terminal.gwt.client.ui.textarea; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.textarea.TextAreaState; -import com.vaadin.terminal.gwt.client.communication.StateChangeEvent; import com.vaadin.terminal.gwt.client.ui.textfield.TextFieldConnector; import com.vaadin.ui.TextArea; @@ -31,14 +30,6 @@ public class TextAreaConnector extends TextFieldConnector { } @Override - public void onStateChanged(StateChangeEvent stateChangeEvent) { - super.onStateChanged(stateChangeEvent); - - getWidget().setRows(getState().getRows()); - getWidget().setWordwrap(getState().isWordwrap()); - } - - @Override public VTextArea getWidget() { return (VTextArea) super.getWidget(); } diff --git a/server/src/com/vaadin/Application.java b/server/src/com/vaadin/Application.java index d2924eb716..bdad94355d 100644 --- a/server/src/com/vaadin/Application.java +++ b/server/src/com/vaadin/Application.java @@ -31,6 +31,7 @@ import java.util.EventObject; import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; +import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Locale; @@ -51,14 +52,14 @@ import com.vaadin.data.util.converter.ConverterFactory; import com.vaadin.data.util.converter.DefaultConverterFactory; import com.vaadin.event.EventRouter; import com.vaadin.service.ApplicationContext; -import com.vaadin.shared.ApplicationConstants; +import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.terminal.AbstractErrorMessage; import com.vaadin.terminal.ApplicationResource; import com.vaadin.terminal.CombinedRequest; import com.vaadin.terminal.DeploymentConfiguration; import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.RootProvider; import com.vaadin.terminal.Terminal; +import com.vaadin.terminal.UIProvider; import com.vaadin.terminal.VariableOwner; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedRequest.BrowserDetails; @@ -74,8 +75,8 @@ import com.vaadin.terminal.gwt.server.WebApplicationContext; import com.vaadin.tools.ReflectTools; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Root; import com.vaadin.ui.Table; +import com.vaadin.ui.UI; import com.vaadin.ui.Window; /** @@ -134,9 +135,9 @@ public class Application implements Terminal.ErrorListener, Serializable { /** * The name of the parameter that is by default used in e.g. web.xml to - * define the name of the default {@link Root} class. + * define the name of the default {@link UI} class. */ - public static final String ROOT_PARAMETER = "root"; + public static final String UI_PARAMETER = "UI"; private static final Method BOOTSTRAP_FRAGMENT_METHOD = ReflectTools .findMethod(BootstrapListener.class, "modifyBootstrapFragment", @@ -164,19 +165,19 @@ public class Application implements Terminal.ErrorListener, Serializable { private static final Pattern WINDOW_NAME_PATTERN = Pattern .compile("^/?([^/]+).*"); - private Root.LegacyWindow mainWindow; + private UI.LegacyWindow mainWindow; private String theme; - private Map<String, Root.LegacyWindow> legacyRootNames = new HashMap<String, Root.LegacyWindow>(); + private Map<String, UI.LegacyWindow> legacyUINames = new HashMap<String, UI.LegacyWindow>(); /** * Sets the main window of this application. Setting window as a main * window of this application also adds the window to this application. * * @param mainWindow - * the root to set as the default window + * the UI to set as the default window */ - public void setMainWindow(Root.LegacyWindow mainWindow) { + public void setMainWindow(UI.LegacyWindow mainWindow) { if (this.mainWindow != null) { throw new IllegalStateException( "mainWindow has already been set"); @@ -201,9 +202,9 @@ public class Application implements Terminal.ErrorListener, Serializable { * Note that each application must have at least one main window. * </p> * - * @return the root used as the default window + * @return the UI used as the default window */ - public Root.LegacyWindow getMainWindow() { + public UI.LegacyWindow getMainWindow() { return mainWindow; } @@ -215,11 +216,11 @@ public class Application implements Terminal.ErrorListener, Serializable { * {@inheritDoc} * * @see #getWindow(String) - * @see Application#getRoot(WrappedRequest) + * @see Application#getUI(WrappedRequest) */ @Override - public Root.LegacyWindow getRoot(WrappedRequest request) { + public UI.LegacyWindow getUI(WrappedRequest request) { String pathInfo = request.getRequestPathInfo(); String name = null; if (pathInfo != null && pathInfo.length() > 0) { @@ -229,7 +230,7 @@ public class Application implements Terminal.ErrorListener, Serializable { name = matcher.group(1); } } - Root.LegacyWindow window = getWindow(name); + UI.LegacyWindow window = getWindow(name); if (window != null) { return window; } @@ -239,8 +240,8 @@ public class Application implements Terminal.ErrorListener, Serializable { /** * Sets the application's theme. * <p> - * Note that this theme can be overridden for a specific root with - * {@link Application#getThemeForRoot(Root)}. Setting theme to be + * Note that this theme can be overridden for a specific UI with + * {@link Application#getThemeForUI(UI)}. Setting theme to be * <code>null</code> selects the default theme. For the available theme * names, see the contents of the VAADIN/themes directory. * </p> @@ -254,7 +255,7 @@ public class Application implements Terminal.ErrorListener, Serializable { /** * Gets the application's theme. The application's theme is the default - * theme used by all the roots for which a theme is not explicitly + * theme used by all the uIs for which a theme is not explicitly * defined. If the application theme is not explicitly set, * <code>null</code> is returned. * @@ -272,70 +273,70 @@ public class Application implements Terminal.ErrorListener, Serializable { */ @Override - public String getThemeForRoot(Root root) { + public String getThemeForUI(UI uI) { return theme; } /** * <p> - * Gets a root by name. Returns <code>null</code> if the application is + * Gets a UI by name. Returns <code>null</code> if the application is * not running or it does not contain a window corresponding to the * name. * </p> * * @param name * the name of the requested window - * @return a root corresponding to the name, or <code>null</code> to use + * @return a UI corresponding to the name, or <code>null</code> to use * the default window */ - public Root.LegacyWindow getWindow(String name) { - return legacyRootNames.get(name); + public UI.LegacyWindow getWindow(String name) { + return legacyUINames.get(name); } /** * Counter to get unique names for windows with no explicit name */ - private int namelessRootIndex = 0; + private int namelessUIIndex = 0; /** * Adds a new browser level window to this application. Please note that - * Root doesn't have a name that is used in the URL - to add a named - * window you should instead use {@link #addWindow(Root, String)} + * UI doesn't have a name that is used in the URL - to add a named + * window you should instead use {@link #addWindow(UI, String)} * - * @param root - * the root window to add to the application + * @param uI + * the UI window to add to the application * @return returns the name that has been assigned to the window * - * @see #addWindow(Root, String) + * @see #addWindow(UI, String) */ - public void addWindow(Root.LegacyWindow root) { - if (root.getName() == null) { - String name = Integer.toString(namelessRootIndex++); - root.setName(name); + public void addWindow(UI.LegacyWindow uI) { + if (uI.getName() == null) { + String name = Integer.toString(namelessUIIndex++); + uI.setName(name); } - legacyRootNames.put(root.getName(), root); - root.setApplication(this); + legacyUINames.put(uI.getName(), uI); + uI.setApplication(this); } /** * Removes the specified window from the application. This also removes - * all name mappings for the window (see - * {@link #addWindow(Root, String) and #getWindowName(Root)}. + * all name mappings for the window (see {@link #addWindow(UI, String) + * and #getWindowName(UI)}. * * <p> * Note that removing window from the application does not close the * browser window - the window is only removed from the server-side. * </p> * - * @param root - * the root to remove + * @param uI + * the UI to remove */ - public void removeWindow(Root.LegacyWindow root) { - for (Entry<String, Root.LegacyWindow> entry : legacyRootNames + public void removeWindow(UI.LegacyWindow uI) { + for (Entry<String, UI.LegacyWindow> entry : legacyUINames .entrySet()) { - if (entry.getValue() == root) { - legacyRootNames.remove(entry.getKey()); + if (entry.getValue() == uI) { + legacyUINames.remove(entry.getKey()); } } } @@ -349,8 +350,8 @@ public class Application implements Terminal.ErrorListener, Serializable { * * @return the unmodifiable collection of windows. */ - public Collection<Root.LegacyWindow> getWindows() { - return Collections.unmodifiableCollection(legacyRootNames.values()); + public Collection<UI.LegacyWindow> getWindows() { + return Collections.unmodifiableCollection(legacyUINames.values()); } } @@ -489,23 +490,23 @@ public class Application implements Terminal.ErrorListener, Serializable { private LinkedList<RequestHandler> requestHandlers = new LinkedList<RequestHandler>(); - private int nextRootId = 0; - private Map<Integer, Root> roots = new HashMap<Integer, Root>(); + private int nextUIId = 0; + private Map<Integer, UI> uIs = new HashMap<Integer, UI>(); - private final Map<String, Integer> retainOnRefreshRoots = new HashMap<String, Integer>(); + private final Map<String, Integer> retainOnRefreshUIs = new HashMap<String, Integer>(); private final EventRouter eventRouter = new EventRouter(); /** - * Keeps track of which roots have been inited. + * Keeps track of which uIs have been inited. * <p> * TODO Investigate whether this might be derived from the different states - * in getRootForRrequest. + * in getUIForRrequest. * </p> */ - private Set<Integer> initedRoots = new HashSet<Integer>(); + private Set<Integer> initedUIs = new HashSet<Integer>(); - private List<RootProvider> rootProviders = new LinkedList<RootProvider>(); + private List<UIProvider> uiProviders = new LinkedList<UIProvider>(); /** * Gets the user of the application. @@ -579,19 +580,19 @@ public class Application implements Terminal.ErrorListener, Serializable { /** * Ends the Application. - * * <p> * In effect this will cause the application stop returning any windows when - * asked. When the application is closed, its state is removed from the - * session and the browser window is redirected to the application logout - * url set with {@link #setLogoutURL(String)}. If the logout url has not - * been set, the browser window is reloaded and the application is - * restarted. - * </p> - * . + * asked. When the application is closed, close events are fired for its + * UIs, its state is removed from the session, and the browser window is + * redirected to the application logout url set with + * {@link #setLogoutURL(String)}. If the logout url has not been set, the + * browser window is reloaded and the application is restarted. */ public void close() { applicationIsRunning = false; + for (UI ui : getUIs()) { + ui.fireCloseEvent(); + } } /** @@ -1830,110 +1831,108 @@ public class Application implements Terminal.ErrorListener, Serializable { } /** - * Gets a root for a request for which no root is already known. This method - * is called when the framework processes a request that does not originate - * from an existing root instance. This typically happens when a host page - * is requested. + * Gets a UI for a request for which no UI is already known. This method is + * called when the framework processes a request that does not originate + * from an existing UI instance. This typically happens when a host page is + * requested. * * <p> * Subclasses of Application may override this method to provide custom - * logic for choosing how to create a suitable root or for picking an - * already created root. If an existing root is picked, care should be taken - * to avoid keeping the same root open in multiple browser windows, as that - * will cause the states to go out of sync. + * logic for choosing how to create a suitable UI or for picking an already + * created UI. If an existing UI is picked, care should be taken to avoid + * keeping the same UI open in multiple browser windows, as that will cause + * the states to go out of sync. * </p> * * <p> - * If {@link BrowserDetails} are required to create a Root, the - * implementation can throw a {@link RootRequiresMoreInformationException} - * exception. In this case, the framework will instruct the browser to send - * the additional details, whereupon this method is invoked again with the - * browser details present in the wrapped request. Throwing the exception if - * the browser details are already available is not supported. + * If {@link BrowserDetails} are required to create a UI, the implementation + * can throw a {@link UIRequiresMoreInformationException} exception. In this + * case, the framework will instruct the browser to send the additional + * details, whereupon this method is invoked again with the browser details + * present in the wrapped request. Throwing the exception if the browser + * details are already available is not supported. * </p> * * <p> * The default implementation in {@link Application} creates a new instance - * of the Root class returned by {@link #getRootClassName(WrappedRequest)}, - * which in turn uses the {@value #ROOT_PARAMETER} parameter from web.xml. - * If {@link DeploymentConfiguration#getClassLoader()} for the request - * returns a {@link ClassLoader}, it is used for loading the Root class. - * Otherwise the {@link ClassLoader} used to load this class is used. + * of the UI class returned by {@link #getUIClassName(WrappedRequest)}, + * which in turn uses the {@value #UI_PARAMETER} parameter from web.xml. If + * {@link DeploymentConfiguration#getClassLoader()} for the request returns + * a {@link ClassLoader}, it is used for loading the UI class. Otherwise the + * {@link ClassLoader} used to load this class is used. * </p> * * @param request - * the wrapped request for which a root is needed - * @return a root instance to use for the request - * @throws RootRequiresMoreInformationException + * the wrapped request for which a UI is needed + * @return a UI instance to use for the request + * @throws UIRequiresMoreInformationException * may be thrown by an implementation to indicate that - * {@link BrowserDetails} are required to create a root + * {@link BrowserDetails} are required to create a UI * - * @see #getRootClassName(WrappedRequest) - * @see Root - * @see RootRequiresMoreInformationException + * @see #getUIClassName(WrappedRequest) + * @see UI + * @see UIRequiresMoreInformationException * @see WrappedRequest#getBrowserDetails() * * @since 7.0 */ - protected Root getRoot(WrappedRequest request) - throws RootRequiresMoreInformationException { + protected UI getUI(WrappedRequest request) + throws UIRequiresMoreInformationException { // Iterate in reverse order - test check newest provider first - for (int i = rootProviders.size() - 1; i >= 0; i--) { - RootProvider provider = rootProviders.get(i); + for (int i = uiProviders.size() - 1; i >= 0; i--) { + UIProvider provider = uiProviders.get(i); - Class<? extends Root> rootClass = provider.getRootClass(this, - request); + Class<? extends UI> uiClass = provider.getUIClass(this, request); - if (rootClass != null) { - return provider.instantiateRoot(this, rootClass, request); + if (uiClass != null) { + return provider.instantiateUI(this, uiClass, request); } } throw new RuntimeException( - "No root providers available or providers are not able to find root instance"); + "No UI providers available or providers are not able to find UI instance"); } /** - * Finds the theme to use for a specific root. If no specific theme is + * Finds the theme to use for a specific UI. If no specific theme is * required, <code>null</code> is returned. * * TODO Tell what the default implementation does once it does something. * - * @param root - * the root to get a theme for + * @param uI + * the UI to get a theme for * @return the name of the theme, or <code>null</code> if the default theme * should be used * * @since 7.0 */ - public String getThemeForRoot(Root root) { - Theme rootTheme = getAnnotationFor(root.getClass(), Theme.class); - if (rootTheme != null) { - return rootTheme.value(); + public String getThemeForUI(UI uI) { + Theme uiTheme = getAnnotationFor(uI.getClass(), Theme.class); + if (uiTheme != null) { + return uiTheme.value(); } else { return null; } } /** - * Finds the widgetset to use for a specific root. If no specific widgetset - * is required, <code>null</code> is returned. + * Finds the widgetset to use for a specific UI. If no specific widgetset is + * required, <code>null</code> is returned. * * TODO Tell what the default implementation does once it does something. * - * @param root - * the root to get a widgetset for + * @param uI + * the UI to get a widgetset for * @return the name of the widgetset, or <code>null</code> if the default * widgetset should be used * * @since 7.0 */ - public String getWidgetsetForRoot(Root root) { - Widgetset rootWidgetset = getAnnotationFor(root.getClass(), - Widgetset.class); - if (rootWidgetset != null) { - return rootWidgetset.value(); + public String getWidgetsetForUI(UI uI) { + Widgetset uiWidgetset = getAnnotationFor(uI.getClass(), Widgetset.class); + if (uiWidgetset != null) { + return uiWidgetset.value(); } else { return null; } @@ -2087,7 +2086,7 @@ public class Application implements Terminal.ErrorListener, Serializable { */ private static final ThreadLocal<Application> currentApplication = new ThreadLocal<Application>(); - private boolean rootPreserved = false; + private boolean uiPreserved = false; /** * Gets the currently used application. The current application is @@ -2139,144 +2138,140 @@ public class Application implements Terminal.ErrorListener, Serializable { return configuration.isProductionMode(); } - public void addRootProvider(RootProvider rootProvider) { - rootProviders.add(rootProvider); + public void addUIProvider(UIProvider uIProvider) { + uiProviders.add(uIProvider); } - public void removeRootProvider(RootProvider rootProvider) { - rootProviders.remove(rootProvider); + public void removeUIProvider(UIProvider uIProvider) { + uiProviders.remove(uIProvider); } /** - * Finds the {@link Root} to which a particular request belongs. If the - * request originates from an existing Root, that root is returned. In other - * cases, the method attempts to create and initialize a new root and might - * throw a {@link RootRequiresMoreInformationException} if all required + * Finds the {@link UI} to which a particular request belongs. If the + * request originates from an existing UI, that UI is returned. In other + * cases, the method attempts to create and initialize a new UI and might + * throw a {@link UIRequiresMoreInformationException} if all required * information is not available. * <p> * Please note that this method can also return a newly created - * <code>Root</code> which has not yet been initialized. You can use - * {@link #isRootInitPending(int)} with the root's id ( - * {@link Root#getRootId()} to check whether the initialization is still - * pending. + * <code>UI</code> which has not yet been initialized. You can use + * {@link #isUIInitPending(int)} with the UI's id ( {@link UI#getUIId()} to + * check whether the initialization is still pending. * </p> * * @param request - * the request for which a root is desired - * @return a root belonging to the request - * @throws RootRequiresMoreInformationException - * if no existing root could be found and creating a new root + * the request for which a UI is desired + * @return a UI belonging to the request + * @throws UIRequiresMoreInformationException + * if no existing UI could be found and creating a new UI * requires additional information from the browser * - * @see #getRoot(WrappedRequest) - * @see RootRequiresMoreInformationException + * @see #getUI(WrappedRequest) + * @see UIRequiresMoreInformationException * * @since 7.0 */ - public Root getRootForRequest(WrappedRequest request) - throws RootRequiresMoreInformationException { - Root root = Root.getCurrent(); - if (root != null) { - return root; + public UI getUIForRequest(WrappedRequest request) + throws UIRequiresMoreInformationException { + UI uI = UI.getCurrent(); + if (uI != null) { + return uI; } - Integer rootId = getRootId(request); + Integer uiId = getUIId(request); synchronized (this) { BrowserDetails browserDetails = request.getBrowserDetails(); boolean hasBrowserDetails = browserDetails != null && browserDetails.getUriFragment() != null; - root = roots.get(rootId); + uI = uIs.get(uiId); - if (root == null && isRootPreserved()) { - // Check for a known root - if (!retainOnRefreshRoots.isEmpty()) { + if (uI == null && isUiPreserved()) { + // Check for a known UI + if (!retainOnRefreshUIs.isEmpty()) { - Integer retainedRootId; + Integer retainedUIId; if (!hasBrowserDetails) { - throw new RootRequiresMoreInformationException(); + throw new UIRequiresMoreInformationException(); } else { String windowName = browserDetails.getWindowName(); - retainedRootId = retainOnRefreshRoots.get(windowName); + retainedUIId = retainOnRefreshUIs.get(windowName); } - if (retainedRootId != null) { - rootId = retainedRootId; - root = roots.get(rootId); + if (retainedUIId != null) { + uiId = retainedUIId; + uI = uIs.get(uiId); } } } - if (root == null) { - // Throws exception if root can not yet be created - root = getRoot(request); + if (uI == null) { + // Throws exception if UI can not yet be created + uI = getUI(request); - // Initialize some fields for a newly created root - if (root.getApplication() == null) { - root.setApplication(this); + // Initialize some fields for a newly created UI + if (uI.getApplication() == null) { + uI.setApplication(this); } - if (root.getRootId() < 0) { + if (uI.getUIId() < 0) { - if (rootId == null) { + if (uiId == null) { // Get the next id if none defined - rootId = Integer.valueOf(nextRootId++); + uiId = Integer.valueOf(nextUIId++); } - root.setRootId(rootId.intValue()); - roots.put(rootId, root); + uI.setUIId(uiId.intValue()); + uIs.put(uiId, uI); } } // Set thread local here so it is available in init - Root.setCurrent(root); + UI.setCurrent(uI); - if (!initedRoots.contains(rootId)) { - boolean initRequiresBrowserDetails = isRootPreserved() - || !root.getClass() - .isAnnotationPresent(EagerInit.class); + if (!initedUIs.contains(uiId)) { + boolean initRequiresBrowserDetails = isUiPreserved() + || !uI.getClass().isAnnotationPresent(EagerInit.class); if (!initRequiresBrowserDetails || hasBrowserDetails) { - root.doInit(request); + uI.doInit(request); - // Remember that this root has been initialized - initedRoots.add(rootId); + // Remember that this UI has been initialized + initedUIs.add(uiId); // init() might turn on preserve so do this afterwards - if (isRootPreserved()) { - // Remember this root + if (isUiPreserved()) { + // Remember this UI String windowName = request.getBrowserDetails() .getWindowName(); - retainOnRefreshRoots.put(windowName, rootId); + retainOnRefreshUIs.put(windowName, uiId); } } } } // end synchronized block - return root; + return uI; } /** - * Internal helper to finds the root id for a request. + * Internal helper to finds the UI id for a request. * * @param request - * the request to get the root id for - * @return a root id, or <code>null</code> if no root id is defined + * the request to get the UI id for + * @return a UI id, or <code>null</code> if no UI id is defined * * @since 7.0 */ - private static Integer getRootId(WrappedRequest request) { + private static Integer getUIId(WrappedRequest request) { if (request instanceof CombinedRequest) { - // Combined requests has the rootid parameter in the second request + // Combined requests has the uiId parameter in the second request CombinedRequest combinedRequest = (CombinedRequest) request; request = combinedRequest.getSecondRequest(); } - String rootIdString = request - .getParameter(ApplicationConstants.ROOT_ID_PARAMETER); - Integer rootId = rootIdString == null ? null - : new Integer(rootIdString); - return rootId; + String uiIdString = request.getParameter(UIConstants.UI_ID_PARAMETER); + Integer uiId = uiIdString == null ? null : new Integer(uiIdString); + return uiId; } /** - * Sets whether the same Root state should be reused if the framework can + * Sets whether the same UI state should be reused if the framework can * detect that the application is opened in a browser window where it has * previously been open. The framework attempts to discover this by checking * the value of window.name in the browser. @@ -2285,62 +2280,62 @@ public class Application implements Terminal.ErrorListener, Serializable { * the UI is already shown, as it might not be retained as intended. * </p> * - * @param rootPreserved - * <code>true</code>if the same Root instance should be reused - * e.g. when the browser window is refreshed. + * @param uiPreserved + * <code>true</code>if the same UI instance should be reused e.g. + * when the browser window is refreshed. */ - public void setRootPreserved(boolean rootPreserved) { - this.rootPreserved = rootPreserved; - if (!rootPreserved) { - retainOnRefreshRoots.clear(); + public void setUiPreserved(boolean uiPreserved) { + this.uiPreserved = uiPreserved; + if (!uiPreserved) { + retainOnRefreshUIs.clear(); } } /** - * Checks whether the same Root state should be reused if the framework can + * Checks whether the same UI state should be reused if the framework can * detect that the application is opened in a browser window where it has * previously been open. The framework attempts to discover this by checking * the value of window.name in the browser. * - * @return <code>true</code>if the same Root instance should be reused e.g. + * @return <code>true</code>if the same UI instance should be reused e.g. * when the browser window is refreshed. */ - public boolean isRootPreserved() { - return rootPreserved; + public boolean isUiPreserved() { + return uiPreserved; } /** - * Checks whether there's a pending initialization for the root with the - * given id. + * Checks whether there's a pending initialization for the UI with the given + * id. * - * @param rootId - * root id to check for + * @param uiId + * UI id to check for * @return <code>true</code> of the initialization is pending, - * <code>false</code> if the root id is not registered or if the - * root has already been initialized + * <code>false</code> if the UI id is not registered or if the UI + * has already been initialized * - * @see #getRootForRequest(WrappedRequest) + * @see #getUIForRequest(WrappedRequest) */ - public boolean isRootInitPending(int rootId) { - return !initedRoots.contains(Integer.valueOf(rootId)); + public boolean isUIInitPending(int uiId) { + return !initedUIs.contains(Integer.valueOf(uiId)); } /** - * Gets all the roots of this application. This includes roots that have - * been requested but not yet initialized. Please note, that roots are not + * Gets all the uIs of this application. This includes uIs that have been + * requested but not yet initialized. Please note, that uIs are not * automatically removed e.g. if the browser window is closed and that there - * is no way to manually remove a root. Inactive roots will thus not be - * released for GC until the entire application is released when the session - * has timed out (unless there are dangling references). Improved support - * for releasing unused roots is planned for an upcoming alpha release of - * Vaadin 7. + * is no way to manually remove a UI. Inactive uIs will thus not be released + * for GC until the entire application is released when the session has + * timed out (unless there are dangling references). Improved support for + * releasing unused uIs is planned for an upcoming alpha release of Vaadin + * 7. * - * @return a collection of roots belonging to this application + * @return a collection of uIs belonging to this application * * @since 7.0 */ - public Collection<Root> getRoots() { - return Collections.unmodifiableCollection(roots.values()); + public Collection<UI> getUIs() { + return Collections.unmodifiableCollection(uIs.values()); } private int connectorIdSequence = 0; @@ -2362,17 +2357,17 @@ public class Application implements Terminal.ErrorListener, Serializable { } /** - * Returns a Root with the given id. + * Returns a UI with the given id. * <p> * This is meant for framework internal use. * </p> * - * @param rootId - * The root id - * @return The root with the given id or null if not found + * @param uiId + * The UI id + * @return The UI with the given id or null if not found */ - public Root getRootById(int rootId) { - return roots.get(rootId); + public UI getUIById(int uiId) { + return uIs.get(uiId); } /** @@ -2421,4 +2416,98 @@ public class Application implements Terminal.ErrorListener, Serializable { public void modifyBootstrapResponse(BootstrapResponse response) { eventRouter.fireEvent(response); } + + /** + * Removes all those UIs from the application for which {@link #isUIAlive} + * returns false. Close events are fired for the removed UIs. + * <p> + * Called by the framework at the end of every request. + * + * @see UI.CloseEvent + * @see UI.CloseListener + * @see #isUIAlive(UI) + * + * @since 7.0.0 + */ + public void closeInactiveUIs() { + for (Iterator<UI> i = uIs.values().iterator(); i.hasNext();) { + UI ui = i.next(); + if (!isUIAlive(ui)) { + i.remove(); + retainOnRefreshUIs.values().remove(ui.getUIId()); + ui.fireCloseEvent(); + getLogger().info( + "Closed UI #" + ui.getUIId() + " due to inactivity"); + } + } + } + + /** + * Returns the number of seconds that must pass without a valid heartbeat or + * UIDL request being received from a UI before that UI is removed from the + * application. This is a lower bound; it might take longer to close an + * inactive UI. Returns a negative number if heartbeat is disabled and + * timeout never occurs. + * + * @see #getUidlRequestTimeout() + * @see #closeInactiveUIs() + * @see DeploymentConfiguration#getHeartbeatInterval() + * + * @since 7.0.0 + * + * @return The heartbeat timeout in seconds or a negative number if timeout + * never occurs. + */ + protected int getHeartbeatTimeout() { + // Permit three missed heartbeats before closing the UI + return (int) (configuration.getHeartbeatInterval() * (3.1)); + } + + /** + * Returns the number of seconds that must pass without a valid UIDL request + * being received from a UI before the UI is removed from the application, + * even though heartbeat requests are received. This is a lower bound; it + * might take longer to close an inactive UI. Returns a negative number if + * <p> + * This timeout only has effect if cleanup of inactive UIs is enabled; + * otherwise heartbeat requests are enough to extend UI lifetime + * indefinitely. + * + * @see DeploymentConfiguration#isIdleUICleanupEnabled() + * @see #getHeartbeatTimeout() + * @see #closeInactiveUIs() + * + * @since 7.0.0 + * + * @return The UIDL request timeout in seconds, or a negative number if + * timeout never occurs. + */ + protected int getUidlRequestTimeout() { + return configuration.isIdleUICleanupEnabled() ? getContext() + .getMaxInactiveInterval() : -1; + } + + /** + * Returns whether the given UI is alive (the client-side actively + * communicates with the server) or whether it can be removed from the + * application and eventually collected. + * + * @since 7.0.0 + * + * @param ui + * The UI whose status to check + * @return true if the UI is alive, false if it could be removed. + */ + protected boolean isUIAlive(UI ui) { + long now = System.currentTimeMillis(); + if (getHeartbeatTimeout() >= 0 + && now - ui.getLastHeartbeatTime() > 1000 * getHeartbeatTimeout()) { + return false; + } + if (getUidlRequestTimeout() >= 0 + && now - ui.getLastUidlRequestTime() > 1000 * getUidlRequestTimeout()) { + return false; + } + return true; + } } diff --git a/server/src/com/vaadin/RootRequiresMoreInformationException.java b/server/src/com/vaadin/UIRequiresMoreInformationException.java index 74026dd161..493c31acb6 100644 --- a/server/src/com/vaadin/RootRequiresMoreInformationException.java +++ b/server/src/com/vaadin/UIRequiresMoreInformationException.java @@ -20,18 +20,18 @@ import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedRequest.BrowserDetails; /** - * Exception that is thrown to indicate that creating or initializing the root + * Exception that is thrown to indicate that creating or initializing the UI * requires information detailed from the web browser ({@link BrowserDetails}) * to be present. * * This exception may not be thrown if that information is already present in * the current WrappedRequest. * - * @see Application#getRoot(WrappedRequest) + * @see Application#getUI(WrappedRequest) * @see WrappedRequest#getBrowserDetails() * * @since 7.0 */ -public class RootRequiresMoreInformationException extends Exception { +public class UIRequiresMoreInformationException extends Exception { // Nothing of interest here } diff --git a/server/src/com/vaadin/annotations/EagerInit.java b/server/src/com/vaadin/annotations/EagerInit.java index 5131a79576..462c6bb5ac 100644 --- a/server/src/com/vaadin/annotations/EagerInit.java +++ b/server/src/com/vaadin/annotations/EagerInit.java @@ -21,15 +21,15 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** - * Indicates that the init method in a Root class can be called before full + * Indicates that the init method in a UI class can be called before full * browser details ({@link WrappedRequest#getBrowserDetails()}) are available. * This will make the UI appear more quickly, as ensuring the availability of * this information typically requires an additional round trip to the client. * - * @see Root#init(com.vaadin.terminal.WrappedRequest) + * @see UI#init(com.vaadin.terminal.WrappedRequest) * @see WrappedRequest#getBrowserDetails() * * @since 7.0 diff --git a/server/src/com/vaadin/annotations/Theme.java b/server/src/com/vaadin/annotations/Theme.java index e2610d2b3f..052bc245fd 100644 --- a/server/src/com/vaadin/annotations/Theme.java +++ b/server/src/com/vaadin/annotations/Theme.java @@ -21,10 +21,10 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** - * Defines a specific theme for a {@link Root}. + * Defines a specific theme for a {@link UI}. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/server/src/com/vaadin/annotations/Widgetset.java b/server/src/com/vaadin/annotations/Widgetset.java index e80f887691..69e3e19319 100644 --- a/server/src/com/vaadin/annotations/Widgetset.java +++ b/server/src/com/vaadin/annotations/Widgetset.java @@ -21,10 +21,10 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** - * Defines a specific theme for a {@link Root}. + * Defines a specific theme for a {@link UI}. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java index f772e2701c..13248f1e06 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java @@ -551,9 +551,7 @@ public class SQLContainer implements Container, Container.Filterable, @Override public void removeContainerFilter(Filter filter) { filters.remove(filter); - // TODO this cannot be added before ComboBox is fixed - // (Select.requestRepaint() must not affect filter string) - // refresh(); + refresh(); } /** diff --git a/server/src/com/vaadin/service/ApplicationContext.java b/server/src/com/vaadin/service/ApplicationContext.java index c6116d6e73..55495dcd5c 100644 --- a/server/src/com/vaadin/service/ApplicationContext.java +++ b/server/src/com/vaadin/service/ApplicationContext.java @@ -80,6 +80,12 @@ public interface ApplicationContext extends Serializable { public void removeTransactionListener(TransactionListener listener); /** + * Returns the time between requests, in seconds, before this context is + * invalidated. A negative time indicates the context should never timeout. + */ + public int getMaxInactiveInterval(); + + /** * Generate a URL that can be used as the relative location of e.g. an * {@link ApplicationResource}. * diff --git a/server/src/com/vaadin/terminal/AbstractClientConnector.java b/server/src/com/vaadin/terminal/AbstractClientConnector.java index d2490225fb..157bd17e41 100644 --- a/server/src/com/vaadin/terminal/AbstractClientConnector.java +++ b/server/src/com/vaadin/terminal/AbstractClientConnector.java @@ -43,7 +43,7 @@ import com.vaadin.terminal.gwt.server.RpcManager; import com.vaadin.terminal.gwt.server.RpcTarget; import com.vaadin.terminal.gwt.server.ServerRpcManager; import com.vaadin.ui.HasComponents; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * An abstract base class for ClientConnector implementations. This class @@ -94,9 +94,9 @@ public abstract class AbstractClientConnector implements ClientConnector { /* Documentation copied from interface */ @Override public void markAsDirty() { - Root root = getRoot(); - if (root != null) { - root.getConnectorTracker().markDirty(this); + UI uI = getUI(); + if (uI != null) { + uI.getConnectorTracker().markDirty(this); } } @@ -154,8 +154,8 @@ public abstract class AbstractClientConnector implements ClientConnector { sharedState = createState(); } - Root root = getRoot(); - if (root != null && !root.getConnectorTracker().isDirty(this)) { + UI uI = getUI(); + if (uI != null && !uI.getConnectorTracker().isDirty(this)) { requestRepaint(); } @@ -363,28 +363,28 @@ public abstract class AbstractClientConnector implements ClientConnector { * @return The connector's application, or <code>null</code> if not attached */ protected Application getApplication() { - Root root = getRoot(); - if (root == null) { + UI uI = getUI(); + if (uI == null) { return null; } else { - return root.getApplication(); + return uI.getApplication(); } } /** - * Finds a Root ancestor of this connector. <code>null</code> is returned if - * no Root ancestor is found (typically because the connector is not + * Finds a UI ancestor of this connector. <code>null</code> is returned if + * no UI ancestor is found (typically because the connector is not * attached to a proper hierarchy). * - * @return the Root ancestor of this connector, or <code>null</code> if none + * @return the UI ancestor of this connector, or <code>null</code> if none * is found. */ @Override - public Root getRoot() { + public UI getUI() { ClientConnector connector = this; while (connector != null) { - if (connector instanceof Root) { - return (Root) connector; + if (connector instanceof UI) { + return (UI) connector; } connector = connector.getParent(); } @@ -528,7 +528,7 @@ public abstract class AbstractClientConnector implements ClientConnector { public void attach() { markAsDirty(); - getRoot().getConnectorTracker().registerConnector(this); + getUI().getConnectorTracker().registerConnector(this); for (ClientConnector connector : getAllChildrenIterable(this)) { connector.attach(); @@ -540,7 +540,7 @@ public abstract class AbstractClientConnector implements ClientConnector { * {@inheritDoc} * * <p> - * The {@link #getApplication()} and {@link #getRoot()} methods might return + * The {@link #getApplication()} and {@link #getUI()} methods might return * <code>null</code> after this method is called. * </p> */ @@ -550,7 +550,7 @@ public abstract class AbstractClientConnector implements ClientConnector { connector.detach(); } - getRoot().getConnectorTracker().unregisterConnector(this); + getUI().getConnectorTracker().unregisterConnector(this); } @Override diff --git a/server/src/com/vaadin/terminal/AbstractRootProvider.java b/server/src/com/vaadin/terminal/AbstractUIProvider.java index 0b63003440..5bb4d35b30 100644 --- a/server/src/com/vaadin/terminal/AbstractRootProvider.java +++ b/server/src/com/vaadin/terminal/AbstractUIProvider.java @@ -17,13 +17,13 @@ package com.vaadin.terminal;
import com.vaadin.Application;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
-public abstract class AbstractRootProvider implements RootProvider {
+public abstract class AbstractUIProvider implements UIProvider {
@Override
- public Root instantiateRoot(Application application,
- Class<? extends Root> type, WrappedRequest request) {
+ public UI instantiateUI(Application application,
+ Class<? extends UI> type, WrappedRequest request) {
try {
return type.newInstance();
} catch (InstantiationException e) {
diff --git a/server/src/com/vaadin/terminal/DefaultRootProvider.java b/server/src/com/vaadin/terminal/DefaultUIProvider.java index cbf8c98828..8713c45b31 100644 --- a/server/src/com/vaadin/terminal/DefaultRootProvider.java +++ b/server/src/com/vaadin/terminal/DefaultUIProvider.java @@ -17,19 +17,19 @@ package com.vaadin.terminal;
import com.vaadin.Application;
-import com.vaadin.RootRequiresMoreInformationException;
-import com.vaadin.ui.Root;
+import com.vaadin.UIRequiresMoreInformationException;
+import com.vaadin.ui.UI;
-public class DefaultRootProvider extends AbstractRootProvider {
+public class DefaultUIProvider extends AbstractUIProvider {
@Override
- public Class<? extends Root> getRootClass(Application application,
- WrappedRequest request) throws RootRequiresMoreInformationException {
- Object rootClassNameObj = application
- .getProperty(Application.ROOT_PARAMETER);
+ public Class<? extends UI> getUIClass(Application application,
+ WrappedRequest request) throws UIRequiresMoreInformationException {
+ Object uiClassNameObj = application
+ .getProperty(Application.UI_PARAMETER);
- if (rootClassNameObj instanceof String) {
- String rootClassName = rootClassNameObj.toString();
+ if (uiClassNameObj instanceof String) {
+ String uiClassName = uiClassNameObj.toString();
ClassLoader classLoader = request.getDeploymentConfiguration()
.getClassLoader();
@@ -37,12 +37,12 @@ public class DefaultRootProvider extends AbstractRootProvider { classLoader = getClass().getClassLoader();
}
try {
- Class<? extends Root> rootClass = Class.forName(rootClassName,
- true, classLoader).asSubclass(Root.class);
+ Class<? extends UI> uiClass = Class.forName(uiClassName, true,
+ classLoader).asSubclass(UI.class);
- return rootClass;
+ return uiClass;
} catch (ClassNotFoundException e) {
- throw new RuntimeException("Could not find root class", e);
+ throw new RuntimeException("Could not find UI class", e);
}
}
diff --git a/server/src/com/vaadin/terminal/DeploymentConfiguration.java b/server/src/com/vaadin/terminal/DeploymentConfiguration.java index 14a5a3724f..0cfbdb7544 100644 --- a/server/src/com/vaadin/terminal/DeploymentConfiguration.java +++ b/server/src/com/vaadin/terminal/DeploymentConfiguration.java @@ -23,6 +23,7 @@ import java.util.Properties; import javax.portlet.PortletContext; import javax.servlet.ServletContext; +import com.vaadin.service.ApplicationContext; import com.vaadin.terminal.gwt.server.AddonContext; import com.vaadin.terminal.gwt.server.AddonContextListener; @@ -97,7 +98,7 @@ public interface DeploymentConfiguration extends Serializable { /** * Get the class loader to use for loading classes loaded by name, e.g. - * custom Root classes. <code>null</code> indicates that the default class + * custom UI classes. <code>null</code> indicates that the default class * loader should be used. * * @return the class loader to use, or <code>null</code> @@ -136,6 +137,8 @@ public interface DeploymentConfiguration extends Serializable { /** * Returns whether Vaadin is in production mode. * + * @since 7.0.0 + * * @return true if in production mode, false otherwise. */ public boolean isProductionMode(); @@ -143,6 +146,8 @@ public interface DeploymentConfiguration extends Serializable { /** * Returns whether cross-site request forgery protection is enabled. * + * @since 7.0.0 + * * @return true if XSRF protection is enabled, false otherwise. */ public boolean isXsrfProtectionEnabled(); @@ -150,7 +155,34 @@ public interface DeploymentConfiguration extends Serializable { /** * Returns the time resources can be cached in the browsers, in seconds. * + * @since 7.0.0 + * * @return The resource cache time. */ public int getResourceCacheTime(); + + /** + * Returns the number of seconds between heartbeat requests of a UI, or a + * non-positive number if heartbeat is disabled. + * + * @since 7.0.0 + * + * @return The time between heartbeats. + */ + public int getHeartbeatInterval(); + + /** + * Returns whether UIs that have no other activity than heartbeat requests + * should be closed after they have been idle the maximum inactivity time + * enforced by the session. + * + * @see ApplicationContext#getMaxInactiveInterval() + * + * @since 7.0.0 + * + * @return True if UIs receiving only heartbeat requests are eventually + * closed; false if heartbeat requests extend UI lifetime + * indefinitely. + */ + public boolean isIdleUICleanupEnabled(); } diff --git a/server/src/com/vaadin/terminal/Page.java b/server/src/com/vaadin/terminal/Page.java index 41ab8cc8b6..66ef7da296 100644 --- a/server/src/com/vaadin/terminal/Page.java +++ b/server/src/com/vaadin/terminal/Page.java @@ -25,27 +25,27 @@ import java.util.List; import com.vaadin.event.EventRouter; import com.vaadin.shared.ui.BorderStyle; -import com.vaadin.shared.ui.root.PageClientRpc; -import com.vaadin.shared.ui.root.RootConstants; +import com.vaadin.shared.ui.ui.PageClientRpc; +import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.terminal.WrappedRequest.BrowserDetails; import com.vaadin.terminal.gwt.server.WebApplicationContext; import com.vaadin.terminal.gwt.server.WebBrowser; import com.vaadin.tools.ReflectTools; import com.vaadin.ui.JavaScript; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class Page implements Serializable { /** * Listener that gets notified when the size of the browser window - * containing the root has changed. + * containing the uI has changed. * - * @see Root#addListener(BrowserWindowResizeListener) + * @see UI#addListener(BrowserWindowResizeListener) */ public interface BrowserWindowResizeListener extends Serializable { /** - * Invoked when the browser window containing a Root has been resized. + * Invoked when the browser window containing a UI has been resized. * * @param event * a browser window resize event @@ -54,7 +54,7 @@ public class Page implements Serializable { } /** - * Event that is fired when a browser window containing a root is resized. + * Event that is fired when a browser window containing a uI is resized. */ public class BrowserWindowResizeEvent extends EventObject { @@ -65,7 +65,7 @@ public class Page implements Serializable { * Creates a new event * * @param source - * the root for which the browser window has been resized + * the uI for which the browser window has been resized * @param width * the new width of the browser window * @param height @@ -254,9 +254,9 @@ public class Page implements Serializable { } /** - * Gets the root in which the fragment has changed. + * Gets the uI in which the fragment has changed. * - * @return the root in which the fragment has changed + * @return the uI in which the fragment has changed */ public Page getPage() { return (Page) getSource(); @@ -279,15 +279,15 @@ public class Page implements Serializable { */ private String fragment; - private final Root root; + private final UI uI; private int browserWindowWidth = -1; private int browserWindowHeight = -1; private JavaScript javaScript; - public Page(Root root) { - this.root = root; + public Page(UI uI) { + this.uI = uI; } private void addListener(Class<?> eventType, Object target, Method method) { @@ -332,7 +332,7 @@ public class Page implements Serializable { if (fireEvents) { fireEvent(new FragmentChangedEvent(this, newFragment)); } - root.markAsDirty(); + uI.markAsDirty(); } } @@ -374,7 +374,7 @@ public class Page implements Serializable { } public WebBrowser getWebBrowser() { - return ((WebApplicationContext) root.getApplication().getContext()) + return ((WebApplicationContext) uI.getApplication().getContext()) .getBrowser(); } @@ -399,8 +399,8 @@ public class Page implements Serializable { } /** - * Adds a new {@link BrowserWindowResizeListener} to this root. The listener - * will be notified whenever the browser window within which this root + * Adds a new {@link BrowserWindowResizeListener} to this uI. The listener + * will be notified whenever the browser window within which this uI * resides is resized. * * @param resizeListener @@ -415,7 +415,7 @@ public class Page implements Serializable { } /** - * Removes a {@link BrowserWindowResizeListener} from this root. The + * Removes a {@link BrowserWindowResizeListener} from this uI. The * listener will no longer be notified when the browser window is resized. * * @param resizeListener @@ -427,7 +427,7 @@ public class Page implements Serializable { } /** - * Gets the last known height of the browser window in which this root + * Gets the last known height of the browser window in which this uI * resides. * * @return the browser window height in pixels @@ -437,7 +437,7 @@ public class Page implements Serializable { } /** - * Gets the last known width of the browser window in which this root + * Gets the last known width of the browser window in which this uI * resides. * * @return the browser window width in pixels @@ -450,7 +450,7 @@ public class Page implements Serializable { if (javaScript == null) { // Create and attach on first use javaScript = new JavaScript(); - javaScript.extend(root); + javaScript.extend(uI); } return javaScript; @@ -474,32 +474,32 @@ public class Page implements Serializable { target.startTag("notification"); if (n.getCaption() != null) { target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_CAPTION, + UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION, n.getCaption()); } if (n.getDescription() != null) { target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_MESSAGE, + UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE, n.getDescription()); } if (n.getIcon() != null) { target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_ICON, + UIConstants.ATTRIBUTE_NOTIFICATION_ICON, n.getIcon()); } if (!n.isHtmlContentAllowed()) { target.addAttribute( - RootConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED, + UIConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED, true); } target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_POSITION, n + UIConstants.ATTRIBUTE_NOTIFICATION_POSITION, n .getPosition().ordinal()); - target.addAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_DELAY, + target.addAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY, n.getDelayMsec()); if (n.getStyleName() != null) { target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_STYLE, + UIConstants.ATTRIBUTE_NOTIFICATION_STYLE, n.getStyleName()); } target.endTag("notification"); @@ -509,21 +509,21 @@ public class Page implements Serializable { } if (fragment != null) { - target.addAttribute(RootConstants.FRAGMENT_VARIABLE, fragment); + target.addAttribute(UIConstants.FRAGMENT_VARIABLE, fragment); } } /** - * Opens the given resource in this root. The contents of this Root is + * Opens the given resource in this uI. The contents of this UI is * replaced by the {@code Resource}. * * @param resource - * the resource to show in this root + * the resource to show in this uI */ public void open(Resource resource) { openList.add(new OpenResource(resource, null, -1, -1, BORDER_DEFAULT)); - root.markAsDirty(); + uI.markAsDirty(); } /** @@ -566,7 +566,7 @@ public class Page implements Serializable { public void open(Resource resource, String windowName) { openList.add(new OpenResource(resource, windowName, -1, -1, BORDER_DEFAULT)); - root.markAsDirty(); + uI.markAsDirty(); } /** @@ -589,7 +589,7 @@ public class Page implements Serializable { int height, BorderStyle border) { openList.add(new OpenResource(resource, windowName, width, height, border)); - root.markAsDirty(); + uI.markAsDirty(); } /** @@ -603,7 +603,7 @@ public class Page implements Serializable { notifications = new LinkedList<Notification>(); } notifications.add(notification); - root.markAsDirty(); + uI.markAsDirty(); } /** @@ -622,21 +622,21 @@ public class Page implements Serializable { } /** - * Gets the Page to which the current root belongs. This is automatically + * Gets the Page to which the current uI belongs. This is automatically * defined when processing requests to the server. In other cases, (e.g. - * from background threads), the current root is not automatically defined. + * from background threads), the current uI is not automatically defined. * - * @see Root#getCurrent() + * @see UI#getCurrent() * * @return the current page instance if available, otherwise * <code>null</code> */ public static Page getCurrent() { - Root currentRoot = Root.getCurrent(); - if (currentRoot == null) { + UI currentUI = UI.getCurrent(); + if (currentUI == null) { return null; } - return currentRoot.getPage(); + return currentUI.getPage(); } /** @@ -647,7 +647,7 @@ public class Page implements Serializable { * the new page title to set */ public void setTitle(String title) { - root.getRpcProxy(PageClientRpc.class).setTitle(title); + uI.getRpcProxy(PageClientRpc.class).setTitle(title); } } diff --git a/server/src/com/vaadin/terminal/RootProvider.java b/server/src/com/vaadin/terminal/UIProvider.java index 476cf1bd78..27b63fbcac 100644 --- a/server/src/com/vaadin/terminal/RootProvider.java +++ b/server/src/com/vaadin/terminal/UIProvider.java @@ -17,13 +17,13 @@ package com.vaadin.terminal;
import com.vaadin.Application;
-import com.vaadin.RootRequiresMoreInformationException;
-import com.vaadin.ui.Root;
+import com.vaadin.UIRequiresMoreInformationException;
+import com.vaadin.ui.UI;
-public interface RootProvider {
- public Class<? extends Root> getRootClass(Application application,
- WrappedRequest request) throws RootRequiresMoreInformationException;
+public interface UIProvider {
+ public Class<? extends UI> getUIClass(Application application,
+ WrappedRequest request) throws UIRequiresMoreInformationException;
- public Root instantiateRoot(Application application,
- Class<? extends Root> type, WrappedRequest request);
+ public UI instantiateUI(Application application,
+ Class<? extends UI> type, WrappedRequest request);
}
diff --git a/server/src/com/vaadin/terminal/WrappedRequest.java b/server/src/com/vaadin/terminal/WrappedRequest.java index c317eae048..343a60848e 100644 --- a/server/src/com/vaadin/terminal/WrappedRequest.java +++ b/server/src/com/vaadin/terminal/WrappedRequest.java @@ -27,10 +27,10 @@ import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.annotations.EagerInit; import com.vaadin.terminal.gwt.server.WebBrowser; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * A generic request to the server, wrapping a more specific request type, e.g. @@ -219,9 +219,10 @@ public interface WrappedRequest extends Serializable { * for instance using javascript in the browser. * * This information is only guaranteed to be available in some special - * cases, for instance when {@link Application#getRoot} is called again - * after throwing {@link RootRequiresMoreInformationException} or in - * {@link Root#init(WrappedRequest)} for a Root class not annotated with + * cases, for instance when + * {@link Application#getUIForRequest(WrappedRequest)} is called again after + * throwing {@link UIRequiresMoreInformationException} or in + * {@link UI#init(WrappedRequest)} for a UI class not annotated with * {@link EagerInit} * * @return the browser details, or <code>null</code> if details are not diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index bd39504237..345f462239 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -56,13 +56,13 @@ import com.liferay.portal.kernel.util.PropsUtil; import com.vaadin.Application; import com.vaadin.Application.ApplicationStartEvent; import com.vaadin.Application.SystemMessages; -import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.terminal.DeploymentConfiguration; import com.vaadin.terminal.Terminal; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedResponse; import com.vaadin.terminal.gwt.server.AbstractCommunicationManager.Callback; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Portlet 2.0 base class. This replaces the servlet in servlet/portlet 1.0 @@ -340,7 +340,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet } protected enum RequestType { - FILE_UPLOAD, UIDL, RENDER, STATIC_FILE, APPLICATION_RESOURCE, DUMMY, EVENT, ACTION, UNKNOWN, BROWSER_DETAILS, CONNECTOR_RESOURCE; + FILE_UPLOAD, UIDL, RENDER, STATIC_FILE, APPLICATION_RESOURCE, DUMMY, EVENT, ACTION, UNKNOWN, BROWSER_DETAILS, CONNECTOR_RESOURCE, HEARTBEAT; } protected RequestType getRequestType(WrappedPortletRequest wrappedRequest) { @@ -361,6 +361,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet } else if (ServletPortletHelper .isApplicationResourceRequest(wrappedRequest)) { return RequestType.APPLICATION_RESOURCE; + } else if (ServletPortletHelper.isHeartbeatRequest(wrappedRequest)) { + return RequestType.HEARTBEAT; } else if (isDummyRequest(resourceRequest)) { return RequestType.DUMMY; } else { @@ -431,6 +433,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet Application application = null; boolean transactionStarted = false; boolean requestStarted = false; + boolean applicationRunning = false; try { // TODO What about PARAM_UNLOADBURST & redirectToApplication?? @@ -459,6 +462,10 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet applicationManager.serveConnectorResource(wrappedRequest, wrappedResponse); return; + } else if (requestType == RequestType.HEARTBEAT) { + applicationManager.handleHeartbeatRequest(wrappedRequest, + wrappedResponse, application); + return; } /* Update browser information from request */ @@ -477,6 +484,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet /* Start the newly created application */ startApplication(request, application, applicationContext); + applicationRunning = true; /* * Transaction starts. Call transaction listeners. Transaction @@ -488,36 +496,35 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet /* Notify listeners */ // Finds the window within the application - Root root = null; + UI uI = null; synchronized (application) { if (application.isRunning()) { switch (requestType) { case RENDER: case ACTION: // Both action requests and render requests are ok - // without a Root as they render the initial HTML + // without a UI as they render the initial HTML // and then do a second request try { - root = application - .getRootForRequest(wrappedRequest); - } catch (RootRequiresMoreInformationException e) { - // Ignore problem and continue without root + uI = application + .getUIForRequest(wrappedRequest); + } catch (UIRequiresMoreInformationException e) { + // Ignore problem and continue without UI } break; case BROWSER_DETAILS: - // Should not try to find a root here as the - // combined request details might change the root + // Should not try to find a UI here as the + // combined request details might change the UI break; case FILE_UPLOAD: // no window break; case APPLICATION_RESOURCE: // use main window - should not need any window - // root = application.getRoot(); + // UI = application.getUI(); break; default: - root = application - .getRootForRequest(wrappedRequest); + uI = application.getUIForRequest(wrappedRequest); } // if window not found, not a problem - use null } @@ -527,25 +534,24 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet // starts? if (request instanceof RenderRequest) { applicationContext.firePortletRenderRequest(application, - root, (RenderRequest) request, + uI, (RenderRequest) request, (RenderResponse) response); } else if (request instanceof ActionRequest) { applicationContext.firePortletActionRequest(application, - root, (ActionRequest) request, + uI, (ActionRequest) request, (ActionResponse) response); } else if (request instanceof EventRequest) { - applicationContext.firePortletEventRequest(application, - root, (EventRequest) request, - (EventResponse) response); + applicationContext.firePortletEventRequest(application, uI, + (EventRequest) request, (EventResponse) response); } else if (request instanceof ResourceRequest) { applicationContext.firePortletResourceRequest(application, - root, (ResourceRequest) request, + uI, (ResourceRequest) request, (ResourceResponse) response); } /* Handle the request */ if (requestType == RequestType.FILE_UPLOAD) { - // Root is resolved in handleFileUpload by + // UI is resolved in handleFileUpload by // PortletCommunicationManager applicationManager.handleFileUpload(application, wrappedRequest, wrappedResponse); @@ -557,7 +563,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet } else if (requestType == RequestType.UIDL) { // Handles AJAX UIDL requests applicationManager.handleUidlRequest(wrappedRequest, - wrappedResponse, portletWrapper, root); + wrappedResponse, portletWrapper, uI); return; } else { /* @@ -585,6 +591,11 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet handleServiceException(wrappedRequest, wrappedResponse, application, e); } finally { + + if (applicationRunning) { + application.closeInactiveUIs(); + } + // Notifies transaction end try { if (transactionStarted) { @@ -599,7 +610,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet } } finally { - Root.setCurrent(null); + UI.setCurrent(null); Application.setCurrent(null); PortletSession session = request @@ -895,7 +906,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet throws PortletException { try { final Application application = getApplicationClass().newInstance(); - application.setRootPreserved(true); + application.setUiPreserved(true); return application; } catch (final IllegalAccessException e) { throw new PortletException("getNewApplication failed", e); diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index 062ba6cdf7..13fd869166 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -56,7 +56,7 @@ import com.vaadin.terminal.ThemeResource; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedResponse; import com.vaadin.terminal.gwt.server.AbstractCommunicationManager.Callback; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Abstract implementation of the ApplicationServlet which handles all @@ -248,6 +248,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements Application application = null; boolean transactionStarted = false; boolean requestStarted = false; + boolean applicationRunning = false; try { // If a duplicate "close application" URL is received for an @@ -287,6 +288,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements if (requestType == RequestType.CONNECTOR_RESOURCE) { applicationManager.serveConnectorResource(request, response); return; + } else if (requestType == RequestType.HEARTBEAT) { + applicationManager.handleHeartbeatRequest(request, response, + application); + return; } /* Update browser information from the request */ @@ -304,6 +309,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements // Start the application if it's newly created startApplication(request, application, webApplicationContext); + applicationRunning = true; /* * Transaction starts. Call transaction listeners. Transaction end @@ -314,21 +320,21 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements /* Handle the request */ if (requestType == RequestType.FILE_UPLOAD) { - // Root is resolved in communication manager + // UI is resolved in communication manager applicationManager.handleFileUpload(application, request, response); return; } else if (requestType == RequestType.UIDL) { - Root root = application.getRootForRequest(request); - if (root == null) { - throw new ServletException(ERROR_NO_ROOT_FOUND); + UI uI = application.getUIForRequest(request); + if (uI == null) { + throw new ServletException(ERROR_NO_UI_FOUND); } // Handles AJAX UIDL requests applicationManager.handleUidlRequest(request, response, - servletWrapper, root); + servletWrapper, uI); return; } else if (requestType == RequestType.BROWSER_DETAILS) { - // Browser details - not related to a specific root + // Browser details - not related to a specific UI applicationManager.handleBrowserDetailsRequest(request, response, application); return; @@ -354,6 +360,11 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements } catch (final Throwable e) { handleServiceException(request, response, application, e); } finally { + + if (applicationRunning) { + application.closeInactiveUIs(); + } + // Notifies transaction end try { if (transactionStarted) { @@ -369,7 +380,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements .onRequestEnd(request, response); } } finally { - Root.setCurrent(null); + UI.setCurrent(null); Application.setCurrent(null); HttpSession session = request.getSession(false); @@ -1121,7 +1132,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements } protected enum RequestType { - FILE_UPLOAD, BROWSER_DETAILS, UIDL, OTHER, STATIC_FILE, APPLICATION_RESOURCE, CONNECTOR_RESOURCE; + FILE_UPLOAD, BROWSER_DETAILS, UIDL, OTHER, STATIC_FILE, APPLICATION_RESOURCE, CONNECTOR_RESOURCE, HEARTBEAT; } protected RequestType getRequestType(WrappedHttpServletRequest request) { @@ -1137,6 +1148,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements return RequestType.STATIC_FILE; } else if (ServletPortletHelper.isApplicationResourceRequest(request)) { return RequestType.APPLICATION_RESOURCE; + } else if (ServletPortletHelper.isHeartbeatRequest(request)) { + return RequestType.HEARTBEAT; } return RequestType.OTHER; diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 7ea4a7d097..81c497713b 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -60,7 +60,7 @@ import javax.servlet.http.HttpServletResponse; import com.vaadin.Application; import com.vaadin.Application.SystemMessages; -import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.annotations.JavaScript; import com.vaadin.annotations.StyleSheet; import com.vaadin.external.json.JSONArray; @@ -74,6 +74,7 @@ import com.vaadin.shared.communication.LegacyChangeVariablesInvocation; import com.vaadin.shared.communication.MethodInvocation; import com.vaadin.shared.communication.SharedState; import com.vaadin.shared.communication.UidlValue; +import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.terminal.AbstractClientConnector; import com.vaadin.terminal.CombinedRequest; import com.vaadin.terminal.LegacyPaint; @@ -97,15 +98,15 @@ import com.vaadin.ui.AbstractField; import com.vaadin.ui.Component; import com.vaadin.ui.ConnectorTracker; import com.vaadin.ui.HasComponents; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Window; /** * This is a common base class for the server-side implementations of the * communication system between the client code (compiled with GWT into * JavaScript) and the server side components. Its client side counterpart is - * {@link ApplicationConstants}. - * + * {@link com.vaadin.terminal.gwt.client.ApplicationConnection}. + * <p> * TODO Document better! */ @SuppressWarnings("serial") @@ -146,7 +147,7 @@ public abstract class AbstractCommunicationManager implements Serializable { public static final char VAR_ESCAPE_CHARACTER = '\u001b'; - private final HashMap<Integer, ClientCache> rootToClientCache = new HashMap<Integer, ClientCache>(); + private final HashMap<Integer, ClientCache> uiToClientCache = new HashMap<Integer, ClientCache>(); private static final int MAX_BUFFER_SIZE = 64 * 1024; @@ -506,7 +507,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * Internally process a UIDL request from the client. * * This method calls - * {@link #handleVariables(WrappedRequest, WrappedResponse, Callback, Application, Root)} + * {@link #handleVariables(WrappedRequest, WrappedResponse, Callback, Application, UI)} * to process any changes to variables by the client and then repaints * affected components using {@link #paintAfterVariableChanges()}. * @@ -520,7 +521,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * @param request * @param response * @param callback - * @param root + * @param uI * target window for the UIDL request, can be null if target not * found * @throws IOException @@ -528,7 +529,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * @throws JSONException */ public void handleUidlRequest(WrappedRequest request, - WrappedResponse response, Callback callback, Root root) + WrappedResponse response, Callback callback, UI uI) throws IOException, InvalidUIDLSecurityKeyException, JSONException { checkWidgetsetVersion(request); @@ -550,7 +551,7 @@ public abstract class AbstractCommunicationManager implements Serializable { if (request.getParameter(GET_PARAM_HIGHLIGHT_COMPONENT) != null) { String pid = request .getParameter(GET_PARAM_HIGHLIGHT_COMPONENT); - highlightedConnector = root.getConnectorTracker().getConnector( + highlightedConnector = uI.getConnectorTracker().getConnector( pid); highlightConnector(highlightedConnector); } @@ -567,10 +568,10 @@ public abstract class AbstractCommunicationManager implements Serializable { // Finds the window within the application if (application.isRunning()) { // Returns if no window found - if (root == null) { + if (uI == null) { // This should not happen, no windows exists but // application is still open. - getLogger().warning("Could not get root for application"); + getLogger().warning("Could not get UI for application"); return; } } else { @@ -579,8 +580,11 @@ public abstract class AbstractCommunicationManager implements Serializable { return; } + // Keep the UI alive + uI.setLastUidlRequestTime(System.currentTimeMillis()); + // Change all variables based on request parameters - if (!handleVariables(request, response, callback, application, root)) { + if (!handleVariables(request, response, callback, application, uI)) { // var inconsistency; the client is probably out-of-sync SystemMessages ci = null; @@ -611,8 +615,8 @@ public abstract class AbstractCommunicationManager implements Serializable { } paintAfterVariableChanges(request, response, callback, repaintAll, - outWriter, root, analyzeLayouts); - postPaint(root); + outWriter, uI, analyzeLayouts); + postPaint(uI); } outWriter.close(); @@ -645,20 +649,20 @@ public abstract class AbstractCommunicationManager implements Serializable { * Method called after the paint phase while still being synchronized on the * application * - * @param root + * @param uI * */ - protected void postPaint(Root root) { + protected void postPaint(UI uI) { // Remove connectors that have been detached from the application during // handling of the request - root.getConnectorTracker().cleanConnectorMap(); + uI.getConnectorTracker().cleanConnectorMap(); if (pidToNameToStreamVariable != null) { Iterator<String> iterator = pidToNameToStreamVariable.keySet() .iterator(); while (iterator.hasNext()) { String connectorId = iterator.next(); - if (root.getConnectorTracker().getConnector(connectorId) == null) { + if (uI.getConnectorTracker().getConnector(connectorId) == null) { // Owner is no longer attached to the application Map<String, StreamVariable> removed = pidToNameToStreamVariable .get(connectorId); @@ -746,7 +750,7 @@ public abstract class AbstractCommunicationManager implements Serializable { */ private void paintAfterVariableChanges(WrappedRequest request, WrappedResponse response, Callback callback, boolean repaintAll, - final PrintWriter outWriter, Root root, boolean analyzeLayouts) + final PrintWriter outWriter, UI uI, boolean analyzeLayouts) throws PaintException, IOException, JSONException { // Removes application if it has stopped during variable changes @@ -765,7 +769,7 @@ public abstract class AbstractCommunicationManager implements Serializable { outWriter.print(getSecurityKeyUIDL(request)); } - writeUidlResponse(request, repaintAll, outWriter, root, analyzeLayouts); + writeUidlResponse(request, repaintAll, outWriter, uI, analyzeLayouts); closeJsonMessage(outWriter); @@ -810,17 +814,17 @@ public abstract class AbstractCommunicationManager implements Serializable { @SuppressWarnings("unchecked") public void writeUidlResponse(WrappedRequest request, boolean repaintAll, - final PrintWriter outWriter, Root root, boolean analyzeLayouts) + final PrintWriter outWriter, UI ui, boolean analyzeLayouts) throws PaintException, JSONException { ArrayList<ClientConnector> dirtyVisibleConnectors = new ArrayList<ClientConnector>(); - Application application = root.getApplication(); + Application application = ui.getApplication(); // Paints components - ConnectorTracker rootConnectorTracker = root.getConnectorTracker(); + ConnectorTracker uiConnectorTracker = ui.getConnectorTracker(); getLogger().log(Level.FINE, "* Creating response to client"); if (repaintAll) { - getClientCache(root).clear(); - rootConnectorTracker.markAllConnectorsDirty(); - rootConnectorTracker.markAllClientSidesUninitialized(); + getClientCache(ui).clear(); + uiConnectorTracker.markAllConnectorsDirty(); + uiConnectorTracker.markAllClientSidesUninitialized(); // Reset sent locales locales = null; @@ -828,18 +832,18 @@ public abstract class AbstractCommunicationManager implements Serializable { } dirtyVisibleConnectors - .addAll(getDirtyVisibleConnectors(rootConnectorTracker)); + .addAll(getDirtyVisibleConnectors(uiConnectorTracker)); getLogger().log( Level.FINE, "Found " + dirtyVisibleConnectors.size() + " dirty connectors to paint"); for (ClientConnector connector : dirtyVisibleConnectors) { - boolean initialized = rootConnectorTracker + boolean initialized = uiConnectorTracker .isClientSideInitialized(connector); connector.beforeClientResponse(!initialized); } - rootConnectorTracker.markAllConnectorsClean(); + uiConnectorTracker.markAllConnectorsClean(); outWriter.print("\"changes\":["); @@ -851,12 +855,11 @@ public abstract class AbstractCommunicationManager implements Serializable { if (analyzeLayouts) { invalidComponentRelativeSizes = ComponentSizeValidator - .validateComponentRelativeSizes(root.getContent(), null, - null); + .validateComponentRelativeSizes(ui.getContent(), null, null); // Also check any existing subwindows - if (root.getWindows() != null) { - for (Window subWindow : root.getWindows()) { + if (ui.getWindows() != null) { + for (Window subWindow : ui.getWindows()) { invalidComponentRelativeSizes = ComponentSizeValidator .validateComponentRelativeSizes( subWindow.getContent(), @@ -951,10 +954,10 @@ public abstract class AbstractCommunicationManager implements Serializable { outWriter.append(hierarchyInfo.toString()); outWriter.print(", "); // close hierarchy - // send server to client RPC calls for components in the root, in call + // send server to client RPC calls for components in the UI, in call // order - // collect RPC calls from components in the root in the order in + // collect RPC calls from components in the UI in the order in // which they were performed, remove the calls from components LinkedList<ClientConnector> rpcPendingQueue = new LinkedList<ClientConnector>( @@ -983,9 +986,10 @@ public abstract class AbstractCommunicationManager implements Serializable { // + parameterType.getName()); // } // } - paramJson.put(JsonCodec.encode( + EncodeResult encodeResult = JsonCodec.encode( invocation.getParameters()[i], referenceParameter, - parameterType, root.getConnectorTracker())); + parameterType, ui.getConnectorTracker()); + paramJson.put(encodeResult.getEncodedValue()); } invocationJson.put(paramJson); rpcCalls.put(invocationJson); @@ -1087,7 +1091,7 @@ public abstract class AbstractCommunicationManager implements Serializable { final String resource = (String) i.next(); InputStream is = null; try { - is = getThemeResourceAsStream(root, getTheme(root), resource); + is = getThemeResourceAsStream(ui, getTheme(ui), resource); } catch (final Exception e) { // FIXME: Handle exception getLogger().log(Level.FINER, @@ -1124,7 +1128,7 @@ public abstract class AbstractCommunicationManager implements Serializable { Collection<Class<? extends ClientConnector>> usedClientConnectors = paintTarget .getUsedClientConnectors(); boolean typeMappingsOpen = false; - ClientCache clientCache = getClientCache(root); + ClientCache clientCache = getClientCache(ui); List<Class<? extends ClientConnector>> newConnectorTypes = new ArrayList<Class<? extends ClientConnector>>(); @@ -1237,7 +1241,7 @@ public abstract class AbstractCommunicationManager implements Serializable { } for (ClientConnector connector : dirtyVisibleConnectors) { - rootConnectorTracker.markClientSideInitialized(connector); + uiConnectorTracker.markClientSideInitialized(connector); } writePerformanceData(outWriter); @@ -1245,33 +1249,35 @@ public abstract class AbstractCommunicationManager implements Serializable { public static JSONObject encodeState(ClientConnector connector, SharedState state) throws JSONException { - Root root = connector.getRoot(); - ConnectorTracker connectorTracker = root.getConnectorTracker(); + UI uI = connector.getUI(); + ConnectorTracker connectorTracker = uI.getConnectorTracker(); Class<? extends SharedState> stateType = connector.getStateType(); Object diffState = connectorTracker.getDiffState(connector); - if (diffState == null) { - diffState = new JSONObject(); + boolean supportsDiffState = !JavaScriptConnectorState.class + .isAssignableFrom(stateType); + if (diffState == null && supportsDiffState) { // Use an empty state object as reference for full // repaints - boolean emptyInitialState = JavaScriptConnectorState.class - .isAssignableFrom(stateType); - if (!emptyInitialState) { - try { - SharedState referenceState = stateType.newInstance(); - diffState = JsonCodec.encode(referenceState, null, - stateType, root.getConnectorTracker()); - } catch (Exception e) { - getLogger().log( - Level.WARNING, - "Error creating reference object for state of type " - + stateType.getName()); - } + + try { + SharedState referenceState = stateType.newInstance(); + EncodeResult encodeResult = JsonCodec.encode(referenceState, + null, stateType, uI.getConnectorTracker()); + diffState = encodeResult.getEncodedValue(); + } catch (Exception e) { + getLogger().log( + Level.WARNING, + "Error creating reference object for state of type " + + stateType.getName()); } - connectorTracker.setDiffState(connector, diffState); } - JSONObject stateJson = (JSONObject) JsonCodec.encode(state, diffState, - stateType, root.getConnectorTracker()); - return stateJson; + EncodeResult encodeResult = JsonCodec.encode(state, diffState, + stateType, uI.getConnectorTracker()); + if (supportsDiffState) { + connectorTracker.setDiffState(connector, + encodeResult.getEncodedValue()); + } + return (JSONObject) encodeResult.getDiff(); } /** @@ -1388,12 +1394,12 @@ public abstract class AbstractCommunicationManager implements Serializable { } - private ClientCache getClientCache(Root root) { - Integer rootId = Integer.valueOf(root.getRootId()); - ClientCache cache = rootToClientCache.get(rootId); + private ClientCache getClientCache(UI uI) { + Integer uiId = Integer.valueOf(uI.getUIId()); + ClientCache cache = uiToClientCache.get(uiId); if (cache == null) { cache = new ClientCache(); - rootToClientCache.put(rootId, cache); + uiToClientCache.put(uiId, cache); } return cache; } @@ -1409,7 +1415,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * @return <code>true</code> if the connector is visible to the client, * <code>false</code> otherwise */ - static boolean isVisible(ClientConnector connector) { + public static boolean isVisible(ClientConnector connector) { if (connector instanceof Component) { return isVisible((Component) connector); } else { @@ -1439,7 +1445,7 @@ public abstract class AbstractCommunicationManager implements Serializable { HasComponents parent = child.getParent(); if (parent == null) { - if (child instanceof Root) { + if (child instanceof UI) { return child.isVisible(); } else { return false; @@ -1506,15 +1512,15 @@ public abstract class AbstractCommunicationManager implements Serializable { return pendingInvocations; } - protected abstract InputStream getThemeResourceAsStream(Root root, + protected abstract InputStream getThemeResourceAsStream(UI uI, String themeName, String resource); private int getTimeoutInterval() { return maxInactiveInterval; } - private String getTheme(Root root) { - String themeName = root.getApplication().getThemeForRoot(root); + private String getTheme(UI uI) { + String themeName = uI.getApplication().getThemeForUI(uI); String requestThemeName = getRequestTheme(); if (requestThemeName != null) { @@ -1553,7 +1559,7 @@ public abstract class AbstractCommunicationManager implements Serializable { */ private boolean handleVariables(WrappedRequest request, WrappedResponse response, Callback callback, - Application application2, Root root) throws IOException, + Application application2, UI uI) throws IOException, InvalidUIDLSecurityKeyException, JSONException { boolean success = true; @@ -1589,7 +1595,7 @@ public abstract class AbstractCommunicationManager implements Serializable { for (int bi = 1; bi < bursts.length; bi++) { // unescape any encoded separator characters in the burst final String burst = unescapeBurst(bursts[bi]); - success &= handleBurst(request, root, burst); + success &= handleBurst(request, uI, burst); // In case that there were multiple bursts, we know that this is // a special synchronous case for closing window. Thus we are @@ -1604,7 +1610,7 @@ public abstract class AbstractCommunicationManager implements Serializable { new CharArrayWriter()); paintAfterVariableChanges(request, response, callback, - true, outWriter, root, false); + true, outWriter, uI, false); } @@ -1631,23 +1637,22 @@ public abstract class AbstractCommunicationManager implements Serializable { * directly. * * @param source - * @param root - * the root receiving the burst + * @param uI + * the UI receiving the burst * @param burst * the content of the burst as a String to be parsed * @return true if the processing of the burst was successful and there were * no messages to non-existent components */ - public boolean handleBurst(WrappedRequest source, Root root, - final String burst) { + public boolean handleBurst(WrappedRequest source, UI uI, final String burst) { boolean success = true; try { Set<Connector> enabledConnectors = new HashSet<Connector>(); List<MethodInvocation> invocations = parseInvocations( - root.getConnectorTracker(), burst); + uI.getConnectorTracker(), burst); for (MethodInvocation invocation : invocations) { - final ClientConnector connector = getConnector(root, + final ClientConnector connector = getConnector(uI, invocation.getConnectorId()); if (connector != null && connector.isConnectorEnabled()) { @@ -1658,7 +1663,7 @@ public abstract class AbstractCommunicationManager implements Serializable { for (int i = 0; i < invocations.size(); i++) { MethodInvocation invocation = invocations.get(i); - final ClientConnector connector = getConnector(root, + final ClientConnector connector = getConnector(uI, invocation.getConnectorId()); if (connector == null) { @@ -1714,7 +1719,7 @@ public abstract class AbstractCommunicationManager implements Serializable { if (connector instanceof Component) { errorComponent = (Component) connector; } - handleChangeVariablesError(root.getApplication(), + handleChangeVariablesError(uI.getApplication(), errorComponent, realException, null); } } else { @@ -1746,7 +1751,7 @@ public abstract class AbstractCommunicationManager implements Serializable { errorComponent = (Component) dropHandlerOwner; } } - handleChangeVariablesError(root.getApplication(), + handleChangeVariablesError(uI.getApplication(), errorComponent, e, changes); } } @@ -1876,9 +1881,8 @@ public abstract class AbstractCommunicationManager implements Serializable { owner.changeVariables(source, m); } - protected ClientConnector getConnector(Root root, String connectorId) { - ClientConnector c = root.getConnectorTracker() - .getConnector(connectorId); + protected ClientConnector getConnector(UI uI, String connectorId) { + ClientConnector c = uI.getConnectorTracker().getConnector(connectorId); if (c == null && connectorId.equals(getDragAndDropService().getConnectorId())) { return getDragAndDropService(); @@ -2230,7 +2234,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * invisible subtrees are omitted. * * @param w - * root window for which dirty components is to be fetched + * UI window for which dirty components is to be fetched * @return */ private ArrayList<ClientConnector> getDirtyVisibleConnectors( @@ -2343,7 +2347,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * We will use the same APP/* URI space as ApplicationResources but * prefix url with UPLOAD * - * eg. APP/UPLOAD/[ROOTID]/[PID]/[NAME]/[SECKEY] + * eg. APP/UPLOAD/[UIID]/[PID]/[NAME]/[SECKEY] * * SECKEY is created on each paint to make URL's unpredictable (to * prevent CSRF attacks). @@ -2352,8 +2356,8 @@ public abstract class AbstractCommunicationManager implements Serializable { * handling post */ String paintableId = owner.getConnectorId(); - int rootId = owner.getRoot().getRootId(); - String key = rootId + "/" + paintableId + "/" + name; + int uiId = owner.getUI().getUIId(); + String key = uiId + "/" + paintableId + "/" + name; if (pidToNameToStreamVariable == null) { pidToNameToStreamVariable = new HashMap<String, Map<String, StreamVariable>>(); @@ -2414,34 +2418,34 @@ public abstract class AbstractCommunicationManager implements Serializable { WrappedResponse response, Application application) throws IOException { - // if we do not yet have a currentRoot, it should be initialized + // if we do not yet have a currentUI, it should be initialized // shortly, and we should send the initial UIDL - boolean sendUIDL = Root.getCurrent() == null; + boolean sendUIDL = UI.getCurrent() == null; try { CombinedRequest combinedRequest = new CombinedRequest(request); - Root root = application.getRootForRequest(combinedRequest); + UI uI = application.getUIForRequest(combinedRequest); response.setContentType("application/json; charset=UTF-8"); - // Use the same logic as for determined roots + // Use the same logic as for determined UIs BootstrapHandler bootstrapHandler = getBootstrapHandler(); BootstrapContext context = bootstrapHandler.createContext( - combinedRequest, response, application, root.getRootId()); + combinedRequest, response, application, uI.getUIId()); String widgetset = context.getWidgetsetName(); String theme = context.getThemeName(); String themeUri = bootstrapHandler.getThemeUri(context, theme); - // TODO These are not required if it was only the init of the root + // TODO These are not required if it was only the init of the UI // that was delayed JSONObject params = new JSONObject(); params.put("widgetset", widgetset); params.put("themeUri", themeUri); - // Root id might have changed based on e.g. window.name - params.put(ApplicationConstants.ROOT_ID_PARAMETER, root.getRootId()); + // UI id might have changed based on e.g. window.name + params.put(UIConstants.UI_ID_PARAMETER, uI.getUIId()); if (sendUIDL) { - String initialUIDL = getInitialUIDL(combinedRequest, root); + String initialUIDL = getInitialUIDL(combinedRequest, uI); params.put("uidl", initialUIDL); } @@ -2456,7 +2460,7 @@ public abstract class AbstractCommunicationManager implements Serializable { // NOTE GateIn requires the buffers to be flushed to work outWriter.flush(); out.flush(); - } catch (RootRequiresMoreInformationException e) { + } catch (UIRequiresMoreInformationException e) { // Requiring more information at this point is not allowed // TODO handle in a better way throw new RuntimeException(e); @@ -2472,24 +2476,24 @@ public abstract class AbstractCommunicationManager implements Serializable { * * @param request * the request that caused the initialization - * @param root - * the root for which the UIDL should be generated + * @param uI + * the UI for which the UIDL should be generated * @return a string with the initial UIDL message * @throws PaintException * if an exception occurs while painting * @throws JSONException * if an exception occurs while encoding output */ - protected String getInitialUIDL(WrappedRequest request, Root root) + protected String getInitialUIDL(WrappedRequest request, UI uI) throws PaintException, JSONException { // TODO maybe unify writeUidlResponse()? StringWriter sWriter = new StringWriter(); PrintWriter pWriter = new PrintWriter(sWriter); pWriter.print("{"); - if (isXSRFEnabled(root.getApplication())) { + if (isXSRFEnabled(uI.getApplication())) { pWriter.print(getSecurityKeyUIDL(request)); } - writeUidlResponse(request, true, pWriter, root, false); + writeUidlResponse(request, true, pWriter, uI, false); pWriter.print("}"); String initialUIDL = sWriter.toString(); getLogger().log(Level.FINE, "Initial UIDL:" + initialUIDL); @@ -2522,7 +2526,7 @@ public abstract class AbstractCommunicationManager implements Serializable { final String mimetype = response.getDeploymentConfiguration() .getMimeType(resourceName); - // Security check: avoid accidentally serving from the root of the + // Security check: avoid accidentally serving from the UI of the // classpath instead of relative to the context class if (resourceName.startsWith("/")) { getLogger().warning( @@ -2597,8 +2601,8 @@ public abstract class AbstractCommunicationManager implements Serializable { /** * Handles file upload request submitted via Upload component. * - * @param root - * The root for this request + * @param UI + * The UI for this request * * @see #getStreamVariableTargetUrl(ReceiverOwner, String, StreamVariable) * @@ -2612,7 +2616,7 @@ public abstract class AbstractCommunicationManager implements Serializable { throws IOException, InvalidUIDLSecurityKeyException { /* - * URI pattern: APP/UPLOAD/[ROOTID]/[PID]/[NAME]/[SECKEY] See + * URI pattern: APP/UPLOAD/[UIID]/[PID]/[NAME]/[SECKEY] See * #createReceiverUrl */ @@ -2622,20 +2626,20 @@ public abstract class AbstractCommunicationManager implements Serializable { .indexOf(ServletPortletHelper.UPLOAD_URL_PREFIX) + ServletPortletHelper.UPLOAD_URL_PREFIX.length(); String uppUri = pathInfo.substring(startOfData); - String[] parts = uppUri.split("/", 4); // 0= rootid, 1 = cid, 2= name, 3 + String[] parts = uppUri.split("/", 4); // 0= UIid, 1 = cid, 2= name, 3 // = sec key - String rootId = parts[0]; + String uiId = parts[0]; String connectorId = parts[1]; String variableName = parts[2]; - Root root = application.getRootById(Integer.parseInt(rootId)); - Root.setCurrent(root); + UI uI = application.getUIById(Integer.parseInt(uiId)); + UI.setCurrent(uI); StreamVariable streamVariable = getStreamVariable(connectorId, variableName); String secKey = streamVariableToSeckey.get(streamVariable); if (secKey.equals(parts[3])) { - ClientConnector source = getConnector(root, connectorId); + ClientConnector source = getConnector(uI, connectorId); String contentType = request.getContentType(); if (contentType.contains("boundary")) { // Multipart requests contain boundary string @@ -2655,6 +2659,37 @@ public abstract class AbstractCommunicationManager implements Serializable { } + /** + * Handles a heartbeat request. Heartbeat requests are periodically sent by + * the client-side to inform the server that the UI sending the heartbeat is + * still alive (the browser window is open, the connection is up) even when + * there are no UIDL requests for a prolonged period of time. UIs that do + * not receive either heartbeat or UIDL requests are eventually removed from + * the application and garbage collected. + * + * @param request + * @param response + * @param application + * @throws IOException + */ + public void handleHeartbeatRequest(WrappedRequest request, + WrappedResponse response, Application application) + throws IOException { + UI ui = null; + try { + int uiId = Integer.parseInt(request + .getParameter(UIConstants.UI_ID_PARAMETER)); + ui = application.getUIById(uiId); + } catch (NumberFormatException nfe) { + // null-check below handles this as well + } + if (ui != null) { + ui.setLastHeartbeatTime(System.currentTimeMillis()); + } else { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "UI not found"); + } + } + public StreamVariable getStreamVariable(String connectorId, String variableName) { Map<String, StreamVariable> map = pidToNameToStreamVariable diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java b/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java index ad5acad5e9..4052f5a400 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java @@ -33,6 +33,8 @@ public abstract class AbstractDeploymentConfiguration implements private boolean productionMode; private boolean xsrfProtectionEnabled; private int resourceCacheTime; + private int heartbeatInterval; + private boolean idleRootCleanupEnabled; public AbstractDeploymentConfiguration(Class<?> systemPropertyBaseClass, Properties applicationProperties) { @@ -42,12 +44,13 @@ public abstract class AbstractDeploymentConfiguration implements checkProductionMode(); checkXsrfProtection(); checkResourceCacheTime(); + checkHeartbeatInterval(); + checkIdleUICleanup(); } @Override public String getApplicationOrSystemProperty(String propertyName, String defaultValue) { - String val = null; // Try application properties @@ -163,22 +166,52 @@ public abstract class AbstractDeploymentConfiguration implements return addonContext; } + /** + * {@inheritDoc} + * + * The default is false. + */ @Override public boolean isProductionMode() { return productionMode; } + /** + * {@inheritDoc} + * + * The default is true. + */ @Override public boolean isXsrfProtectionEnabled() { return xsrfProtectionEnabled; } + /** + * {@inheritDoc} + * + * The default interval is 3600 seconds (1 hour). + */ @Override public int getResourceCacheTime() { return resourceCacheTime; } /** + * {@inheritDoc} + * + * The default interval is 300 seconds (5 minutes). + */ + @Override + public int getHeartbeatInterval() { + return heartbeatInterval; + } + + @Override + public boolean isIdleUICleanupEnabled() { + return idleRootCleanupEnabled; + } + + /** * Log a warning if Vaadin is not running in production mode. */ private void checkProductionMode() { @@ -218,6 +251,24 @@ public abstract class AbstractDeploymentConfiguration implements } } + private void checkHeartbeatInterval() { + try { + heartbeatInterval = Integer + .parseInt(getApplicationOrSystemProperty( + Constants.SERVLET_PARAMETER_HEARTBEAT_RATE, "300")); + } catch (NumberFormatException e) { + getLogger().warning( + Constants.WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC); + heartbeatInterval = 300; + } + } + + private void checkIdleUICleanup() { + idleRootCleanupEnabled = getApplicationOrSystemProperty( + Constants.SERVLET_PARAMETER_CLOSE_IDLE_UIS, "false").equals( + "true"); + } + private Logger getLogger() { return Logger.getLogger(getClass().getName()); } diff --git a/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java b/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java index 52885f3fbb..857c7c738c 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java +++ b/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java @@ -20,7 +20,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import com.vaadin.Application; -import com.vaadin.terminal.DefaultRootProvider; +import com.vaadin.terminal.DefaultUIProvider; import com.vaadin.terminal.gwt.server.ServletPortletHelper.ApplicationClassException; /** @@ -70,7 +70,7 @@ public class ApplicationServlet extends AbstractApplicationServlet { // Creates a new application instance try { final Application application = getApplicationClass().newInstance(); - application.addRootProvider(new DefaultRootProvider()); + application.addUIProvider(new DefaultUIProvider()); return application; } catch (final IllegalAccessException e) { diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java index fabb69784f..6f69086523 100644 --- a/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java +++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java @@ -48,17 +48,16 @@ public class BootstrapFragmentResponse extends BootstrapResponse { * @param application * the application for which the bootstrap page should be * generated - * @param rootId - * the generated id of the Root that will be displayed on the - * page + * @param uiId + * the generated id of the UI that will be displayed on the page * @param fragmentNodes * a mutable list containing the DOM nodes that will make up the * application HTML */ public BootstrapFragmentResponse(BootstrapHandler handler, - WrappedRequest request, Application application, Integer rootId, + WrappedRequest request, Application application, Integer uiId, List<Node> fragmentNodes) { - super(handler, request, application, rootId); + super(handler, request, application, uiId); this.fragmentNodes = fragmentNodes; } diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java index fad80cacaa..02005e8d22 100644 --- a/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java +++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java @@ -37,17 +37,18 @@ import org.jsoup.nodes.Node; import org.jsoup.parser.Tag; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.Version; +import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.terminal.DeploymentConfiguration; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.RequestHandler; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedResponse; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public abstract class BootstrapHandler implements RequestHandler { @@ -78,19 +79,19 @@ public abstract class BootstrapHandler implements RequestHandler { return bootstrapResponse.getApplication(); } - public Integer getRootId() { - return bootstrapResponse.getRootId(); + public Integer getUIId() { + return bootstrapResponse.getUIId(); } - public Root getRoot() { - return bootstrapResponse.getRoot(); + public UI getUI() { + return bootstrapResponse.getUI(); } public String getWidgetsetName() { if (widgetsetName == null) { - Root root = getRoot(); - if (root != null) { - widgetsetName = getWidgetsetForRoot(this); + UI uI = getUI(); + if (uI != null) { + widgetsetName = getWidgetsetForUI(this); } } return widgetsetName; @@ -98,8 +99,8 @@ public abstract class BootstrapHandler implements RequestHandler { public String getThemeName() { if (themeName == null) { - Root root = getRoot(); - if (root != null) { + UI uI = getUI(); + if (uI != null) { themeName = findAndEscapeThemeName(this); } } @@ -125,22 +126,22 @@ public abstract class BootstrapHandler implements RequestHandler { throws IOException { // TODO Should all urls be handled here? - Integer rootId = null; + Integer uiId = null; try { - Root root = application.getRootForRequest(request); - if (root == null) { - writeError(response, new Throwable("No Root found")); + UI uI = application.getUIForRequest(request); + if (uI == null) { + writeError(response, new Throwable("No UI found")); return true; } - rootId = Integer.valueOf(root.getRootId()); - } catch (RootRequiresMoreInformationException e) { - // Just keep going without rootId + uiId = Integer.valueOf(uI.getUIId()); + } catch (UIRequiresMoreInformationException e) { + // Just keep going without uiId } try { BootstrapContext context = createContext(request, response, - application, rootId); + application, uiId); setupMainDiv(context); BootstrapFragmentResponse fragmentResponse = context @@ -170,8 +171,8 @@ public abstract class BootstrapHandler implements RequestHandler { Map<String, Object> headers = new LinkedHashMap<String, Object>(); Document document = Document.createShell(""); BootstrapPageResponse pageResponse = new BootstrapPageResponse( - this, request, context.getApplication(), context.getRootId(), document, - headers); + this, request, context.getApplication(), context.getUIId(), + document, headers); List<Node> fragmentNodes = fragmentResponse.getFragmentNodes(); Element body = document.body(); for (Node node : fragmentNodes) { @@ -246,8 +247,8 @@ public abstract class BootstrapHandler implements RequestHandler { head.appendElement("meta").attr("http-equiv", "X-UA-Compatible") .attr("content", "chrome=1"); - Root root = context.getRoot(); - String title = ((root == null || root.getCaption() == null) ? "" : root + UI uI = context.getUI(); + String title = ((uI == null || uI.getCaption() == null) ? "" : uI .getCaption()); head.appendElement("title").appendText(title); @@ -272,10 +273,10 @@ public abstract class BootstrapHandler implements RequestHandler { } public BootstrapContext createContext(WrappedRequest request, - WrappedResponse response, Application application, Integer rootId) { + WrappedResponse response, Application application, Integer uiId) { BootstrapContext context = new BootstrapContext(response, - new BootstrapFragmentResponse(this, request, - application, rootId, new ArrayList<Node>())); + new BootstrapFragmentResponse(this, request, application, uiId, + new ArrayList<Node>())); return context; } @@ -293,11 +294,11 @@ public abstract class BootstrapHandler implements RequestHandler { */ protected abstract String getApplicationId(BootstrapContext context); - public String getWidgetsetForRoot(BootstrapContext context) { - Root root = context.getRoot(); + public String getWidgetsetForUI(BootstrapContext context) { + UI uI = context.getUI(); WrappedRequest request = context.getRequest(); - String widgetset = root.getApplication().getWidgetsetForRoot(root); + String widgetset = uI.getApplication().getWidgetsetForUI(uI); if (widgetset == null) { widgetset = request.getDeploymentConfiguration() .getConfiguredWidgetset(request); @@ -417,12 +418,12 @@ public abstract class BootstrapHandler implements RequestHandler { protected JSONObject getApplicationParameters(BootstrapContext context) throws JSONException, PaintException { Application application = context.getApplication(); - Integer rootId = context.getRootId(); + Integer uiId = context.getUIId(); JSONObject appConfig = new JSONObject(); - if (rootId != null) { - appConfig.put(ApplicationConstants.ROOT_ID_PARAMETER, rootId); + if (uiId != null) { + appConfig.put(UIConstants.UI_ID_PARAMETER, uiId); } if (context.getThemeName() != null) { @@ -437,7 +438,7 @@ public abstract class BootstrapHandler implements RequestHandler { appConfig.put("widgetset", context.getWidgetsetName()); - if (rootId == null || application.isRootInitPending(rootId.intValue())) { + if (uiId == null || application.isUIInitPending(uiId.intValue())) { appConfig.put("initialPath", context.getRequest() .getRequestPathInfo()); @@ -447,7 +448,7 @@ public abstract class BootstrapHandler implements RequestHandler { } else { // write the initial UIDL into the config appConfig.put("uidl", - getInitialUIDL(context.getRequest(), context.getRoot())); + getInitialUIDL(context.getRequest(), context.getUI())); } return appConfig; @@ -500,6 +501,9 @@ public abstract class BootstrapHandler implements RequestHandler { defaults.put("standalone", true); } + defaults.put("heartbeatInterval", + deploymentConfiguration.getHeartbeatInterval()); + defaults.put("appUri", getAppUri(context)); return defaults; @@ -533,7 +537,7 @@ public abstract class BootstrapHandler implements RequestHandler { * @return */ public String getThemeName(BootstrapContext context) { - return context.getApplication().getThemeForRoot(context.getRoot()); + return context.getApplication().getThemeForUI(context.getUI()); } /** @@ -568,15 +572,15 @@ public abstract class BootstrapHandler implements RequestHandler { * * @param request * the originating request - * @param root - * the root for which the UIDL should be generated + * @param ui + * the UI for which the UIDL should be generated * @return a string with the initial UIDL message * @throws PaintException * if an exception occurs while painting the components * @throws JSONException * if an exception occurs while formatting the output */ - protected abstract String getInitialUIDL(WrappedRequest request, Root root) + protected abstract String getInitialUIDL(WrappedRequest request, UI ui) throws PaintException, JSONException; } diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java index e7440f4c22..847578ef97 100644 --- a/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java +++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java @@ -51,8 +51,8 @@ public class BootstrapPageResponse extends BootstrapResponse { * @param application * the application for which the bootstrap page should be * generated - * @param rootId - * the generated id of the Root that will be displayed on the + * @param uiId + * the generated id of the UI that will be displayed on the * page * @param document * the DOM document making up the HTML page @@ -60,9 +60,9 @@ public class BootstrapPageResponse extends BootstrapResponse { * a map into which header data can be added */ public BootstrapPageResponse(BootstrapHandler handler, - WrappedRequest request, Application application, Integer rootId, + WrappedRequest request, Application application, Integer uiId, Document document, Map<String, Object> headers) { - super(handler, request, application, rootId); + super(handler, request, application, uiId); this.headers = headers; this.document = document; } diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java index 10f97e7e79..a422cba345 100644 --- a/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java +++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java @@ -19,9 +19,9 @@ package com.vaadin.terminal.gwt.server; import java.util.EventObject; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Base class providing common functionality used in different bootstrap @@ -33,7 +33,7 @@ import com.vaadin.ui.Root; public abstract class BootstrapResponse extends EventObject { private final WrappedRequest request; private final Application application; - private final Integer rootId; + private final Integer uiId; /** * Creates a new bootstrap event. @@ -46,16 +46,15 @@ public abstract class BootstrapResponse extends EventObject { * @param application * the application for which the bootstrap page should be * generated - * @param rootId - * the generated id of the Root that will be displayed on the - * page + * @param uiId + * the generated id of the UI that will be displayed on the page */ public BootstrapResponse(BootstrapHandler handler, WrappedRequest request, - Application application, Integer rootId) { + Application application, Integer uiId) { super(handler); this.request = request; this.application = application; - this.rootId = rootId; + this.uiId = uiId; } /** @@ -91,32 +90,32 @@ public abstract class BootstrapResponse extends EventObject { } /** - * Gets the root id that has been generated for this response. Please note - * that if {@link Application#isRootPreserved()} is enabled, a previously - * created Root with a different id might eventually end up being used. + * Gets the UI id that has been generated for this response. Please note + * that if {@link Application#isUiPreserved()} is enabled, a previously + * created UI with a different id might eventually end up being used. * - * @return the root id + * @return the UI id */ - public Integer getRootId() { - return rootId; + public Integer getUIId() { + return uiId; } /** - * Gets the Root for which this page is being rendered, if available. Some - * features of the framework will postpone the Root selection until after - * the bootstrap page has been rendered and required information from the + * Gets the UI for which this page is being rendered, if available. Some + * features of the framework will postpone the UI selection until after the + * bootstrap page has been rendered and required information from the * browser has been sent back. This method will return <code>null</code> if - * no Root instance is yet available. + * no UI instance is yet available. * - * @see Application#isRootPreserved() - * @see Application#getRoot(WrappedRequest) - * @see RootRequiresMoreInformationException + * @see Application#isUiPreserved() + * @see Application#getUI(WrappedRequest) + * @see UIRequiresMoreInformationException * - * @return The Root that will be displayed in the page being generated, or + * @return The UI that will be displayed in the page being generated, or * <code>null</code> if all required information is not yet * available. */ - public Root getRoot() { - return Root.getCurrent(); + public UI getUI() { + return UI.getCurrent(); } } diff --git a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java index 24675c9e45..c2fbbe37d4 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java +++ b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java @@ -26,7 +26,7 @@ import com.vaadin.terminal.AbstractClientConnector; import com.vaadin.terminal.Extension; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Interface implemented by all connectors that are capable of communicating @@ -175,12 +175,12 @@ public interface ClientConnector extends Connector, RpcTarget { public void removeExtension(Extension extension); /** - * Returns the root this connector is attached to + * Returns the UI this connector is attached to * - * @return The Root this connector is attached to or null if it is not - * attached to any Root + * @return The UI this connector is attached to or null if it is not + * attached to any UI */ - public Root getRoot(); + public UI getUI(); /** * Called before the shared state and RPC invocations are sent to the diff --git a/server/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java b/server/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java index 25d0b23725..7cc5159bc0 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java +++ b/server/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java @@ -34,7 +34,7 @@ public class ClientMethodInvocation implements Serializable, private final Object[] parameters; private Type[] parameterTypes; - // used for sorting calls between different connectors in the same Root + // used for sorting calls between different connectors in the same UI private final long sequenceNumber; // TODO may cause problems when clustering etc. private static long counter = 0; diff --git a/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java index e0386b51b4..7551e849a1 100644 --- a/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java @@ -25,7 +25,7 @@ import com.vaadin.Application; import com.vaadin.external.json.JSONException; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Application manager processes changes and paints for single application @@ -111,17 +111,17 @@ public class CommunicationManager extends AbstractCommunicationManager { } @Override - protected String getInitialUIDL(WrappedRequest request, Root root) + protected String getInitialUIDL(WrappedRequest request, UI uI) throws PaintException, JSONException { - return CommunicationManager.this.getInitialUIDL(request, root); + return CommunicationManager.this.getInitialUIDL(request, uI); } }; } @Override - protected InputStream getThemeResourceAsStream(Root root, String themeName, + protected InputStream getThemeResourceAsStream(UI uI, String themeName, String resource) { - WebApplicationContext context = (WebApplicationContext) root + WebApplicationContext context = (WebApplicationContext) uI .getApplication().getContext(); ServletContext servletContext = context.getHttpSession() .getServletContext(); diff --git a/server/src/com/vaadin/terminal/gwt/server/Constants.java b/server/src/com/vaadin/terminal/gwt/server/Constants.java index 78c043da69..9640216488 100644 --- a/server/src/com/vaadin/terminal/gwt/server/Constants.java +++ b/server/src/com/vaadin/terminal/gwt/server/Constants.java @@ -41,6 +41,12 @@ public interface Constants { + "in web.xml. The default of 1h will be used.\n" + "==========================================================="; + static final String WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC = "\n" + + "===========================================================\n" + + "WARNING: heartbeatInterval has been set to a non integer value " + + "in web.xml. The default of 5min will be used.\n" + + "==========================================================="; + static final String WIDGETSET_MISMATCH_INFO = "\n" + "=================================================================\n" + "The widgetset in use does not seem to be built for the Vaadin\n" @@ -58,6 +64,8 @@ public interface Constants { static final String SERVLET_PARAMETER_PRODUCTION_MODE = "productionMode"; static final String SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION = "disable-xsrf-protection"; static final String SERVLET_PARAMETER_RESOURCE_CACHE_TIME = "resourceCacheTime"; + static final String SERVLET_PARAMETER_HEARTBEAT_RATE = "heartbeatRate"; + static final String SERVLET_PARAMETER_CLOSE_IDLE_UIS = "closeIdleUIs"; // Configurable parameter names static final String PARAMETER_VAADIN_RESOURCES = "Resources"; @@ -78,7 +86,7 @@ public interface Constants { // Widget set parameter name static final String PARAMETER_WIDGETSET = "widgetset"; - static final String ERROR_NO_ROOT_FOUND = "Application did not return a root for the request and did not request extra information either. Something is wrong."; + static final String ERROR_NO_UI_FOUND = "No UIProvider returned a UI for the request."; static final String DEFAULT_THEME_NAME = "reindeer"; @@ -88,5 +96,4 @@ public interface Constants { static final String PORTAL_PARAMETER_VAADIN_WIDGETSET = "vaadin.widgetset"; static final String PORTAL_PARAMETER_VAADIN_RESOURCE_PATH = "vaadin.resources.path"; static final String PORTAL_PARAMETER_VAADIN_THEME = "vaadin.theme"; - } diff --git a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java index 221598171c..0106f466fc 100644 --- a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java +++ b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java @@ -40,7 +40,7 @@ import com.vaadin.terminal.Extension; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.VariableOwner; import com.vaadin.ui.Component; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class DragAndDropService implements VariableOwner, ClientConnector { @@ -327,7 +327,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector { } @Override - public Root getRoot() { + public UI getUI() { return null; } diff --git a/server/src/com/vaadin/terminal/gwt/server/EncodeResult.java b/server/src/com/vaadin/terminal/gwt/server/EncodeResult.java new file mode 100644 index 0000000000..a62df2e632 --- /dev/null +++ b/server/src/com/vaadin/terminal/gwt/server/EncodeResult.java @@ -0,0 +1,48 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.terminal.gwt.server; + +public class EncodeResult { + private final Object encodedValue; + private final Object diff; + + public EncodeResult(Object encodedValue) { + this(encodedValue, null); + } + + public EncodeResult(Object encodedValue, Object diff) { + this.encodedValue = encodedValue; + this.diff = diff; + } + + public Object getEncodedValue() { + return encodedValue; + } + + public Object getDiff() { + return diff; + } + + public Object getDiffOrValue() { + Object diff = getDiff(); + if (diff != null) { + return diff; + } else { + return getEncodedValue(); + } + } +} diff --git a/server/src/com/vaadin/terminal/gwt/server/JsonCodec.java b/server/src/com/vaadin/terminal/gwt/server/JsonCodec.java index 1eee9c4f52..3ba52a4e91 100644 --- a/server/src/com/vaadin/terminal/gwt/server/JsonCodec.java +++ b/server/src/com/vaadin/terminal/gwt/server/JsonCodec.java @@ -595,8 +595,9 @@ public class JsonCodec implements Serializable { } } - public static Object encode(Object value, Object diffState, Type valueType, - ConnectorTracker connectorTracker) throws JSONException { + public static EncodeResult encode(Object value, Object diffState, + Type valueType, ConnectorTracker connectorTracker) + throws JSONException { if (valueType == null) { throw new IllegalArgumentException("type must be defined"); @@ -617,37 +618,37 @@ public class JsonCodec implements Serializable { for (int i = 0; i < array.length; ++i) { jsonArray.put(array[i]); } - return jsonArray; + return new EncodeResult(jsonArray); } else if (value instanceof String) { - return value; + return new EncodeResult(value); } else if (value instanceof Boolean) { - return value; + return new EncodeResult(value); } else if (value instanceof Number) { - return value; + return new EncodeResult(value); } else if (value instanceof Character) { // Character is not a Number - return value; + return new EncodeResult(value); } else if (value instanceof Collection) { Collection<?> collection = (Collection<?>) value; JSONArray jsonArray = encodeCollection(valueType, collection, connectorTracker); - return jsonArray; + return new EncodeResult(jsonArray); } else if (valueType instanceof Class<?> && ((Class<?>) valueType).isArray()) { JSONArray jsonArray = encodeArrayContents( ((Class<?>) valueType).getComponentType(), value, connectorTracker); - return jsonArray; + return new EncodeResult(jsonArray); } else if (valueType instanceof GenericArrayType) { Type componentType = ((GenericArrayType) valueType) .getGenericComponentType(); JSONArray jsonArray = encodeArrayContents(componentType, value, connectorTracker); - return jsonArray; + return new EncodeResult(jsonArray); } else if (value instanceof Map) { Object jsonMap = encodeMap(valueType, (Map<?, ?>) value, connectorTracker); - return jsonMap; + return new EncodeResult(jsonMap); } else if (value instanceof Connector) { Connector connector = (Connector) value; if (value instanceof Component @@ -655,11 +656,11 @@ public class JsonCodec implements Serializable { .isVisible((Component) value))) { return encodeNull(); } - return connector.getConnectorId(); + return new EncodeResult(connector.getConnectorId()); } else if (value instanceof Enum) { return encodeEnum((Enum<?>) value, connectorTracker); } else if (value instanceof JSONArray || value instanceof JSONObject) { - return value; + return new EncodeResult(value); } else { // Any object that we do not know how to encode we encode by looping // through fields @@ -667,8 +668,8 @@ public class JsonCodec implements Serializable { } } - private static Object encodeNull() { - return JSONObject.NULL; + private static EncodeResult encodeNull() { + return new EncodeResult(JSONObject.NULL); } public static Collection<BeanProperty> getProperties(Class<?> type) @@ -681,9 +682,11 @@ public class JsonCodec implements Serializable { return properties; } - private static Object encodeObject(Object value, JSONObject diffState, - ConnectorTracker connectorTracker) throws JSONException { - JSONObject jsonMap = new JSONObject(); + private static EncodeResult encodeObject(Object value, + JSONObject referenceValue, ConnectorTracker connectorTracker) + throws JSONException { + JSONObject encoded = new JSONObject(); + JSONObject diff = new JSONObject(); try { for (BeanProperty property : getProperties(value.getClass())) { @@ -692,49 +695,39 @@ public class JsonCodec implements Serializable { // not support generics Type fieldType = property.getType(); Object fieldValue = property.getValue(value); - boolean equals = false; - Object diffStateValue = null; - if (diffState != null && diffState.has(fieldName)) { - diffStateValue = diffState.get(fieldName); - Object referenceFieldValue = decodeInternalOrCustomType( - fieldType, diffStateValue, connectorTracker); - if (JSONObject.NULL.equals(diffStateValue)) { - diffStateValue = null; - } - equals = equals(fieldValue, referenceFieldValue); + + if (encoded.has(fieldName)) { + throw new RuntimeException( + "Can't encode " + + value.getClass().getName() + + " as it has multiple fields with the name " + + fieldName.toLowerCase() + + ". This can happen if only casing distinguishes one property name from another."); } - if (!equals) { - if (jsonMap.has(fieldName)) { - throw new RuntimeException( - "Can't encode " - + value.getClass().getName() - + " as it has multiple fields with the name " - + fieldName.toLowerCase() - + ". This can happen if only casing distinguishes one property name from another."); - } - jsonMap.put( - fieldName, - encode(fieldValue, diffStateValue, fieldType, - connectorTracker)); - if (diffState != null) { - diffState.put( - fieldName, - encode(fieldValue, null, fieldType, - connectorTracker)); + + Object fieldReference; + if (referenceValue != null) { + fieldReference = referenceValue.get(fieldName); + if (JSONObject.NULL.equals(fieldReference)) { + fieldReference = null; } + } else { + fieldReference = null; + } + + EncodeResult encodeResult = encode(fieldValue, fieldReference, + fieldType, connectorTracker); + encoded.put(fieldName, encodeResult.getEncodedValue()); - // } else { - // System.out.println("Skipping field " + fieldName - // + " of type " + fieldType.getName() - // + " for object " + value.getClass().getName() - // + " as " + fieldValue + "==" + referenceFieldValue); + if (!jsonEquals(encodeResult.getEncodedValue(), fieldReference)) { + diff.put(fieldName, encodeResult.getDiffOrValue()); } } } catch (Exception e) { // TODO: Should exceptions be handled in a different way? throw new JSONException(e); } - return jsonMap; + return new EncodeResult(encoded, diff); } /** @@ -744,21 +737,19 @@ public class JsonCodec implements Serializable { * @param referenceValue * @return */ - private static boolean equals(Object fieldValue, Object referenceValue) { - if (fieldValue == null) { - return referenceValue == null; - } - - if (fieldValue.equals(referenceValue)) { + private static boolean jsonEquals(Object fieldValue, Object referenceValue) { + if (fieldValue == referenceValue) { return true; + } else if (fieldValue == null || referenceValue == null) { + return false; + } else { + return fieldValue.toString().equals(referenceValue.toString()); } - - return false; } - private static String encodeEnum(Enum<?> e, + private static EncodeResult encodeEnum(Enum<?> e, ConnectorTracker connectorTracker) throws JSONException { - return e.name(); + return new EncodeResult(e.name()); } private static JSONArray encodeArrayContents(Type componentType, @@ -766,8 +757,9 @@ public class JsonCodec implements Serializable { throws JSONException { JSONArray jsonArray = new JSONArray(); for (int i = 0; i < Array.getLength(array); i++) { - jsonArray.put(encode(Array.get(array, i), null, componentType, - connectorTracker)); + EncodeResult encodeResult = encode(Array.get(array, i), null, + componentType, connectorTracker); + jsonArray.put(encodeResult.getEncodedValue()); } return jsonArray; } @@ -788,7 +780,9 @@ public class JsonCodec implements Serializable { Type childType = ((ParameterizedType) targetType) .getActualTypeArguments()[typeIndex]; // Encode using the given type - return encode(o, null, childType, connectorTracker); + EncodeResult encodeResult = encode(o, null, childType, + connectorTracker); + return encodeResult.getEncodedValue(); } else { throw new JSONException("Collection is missing generics"); } @@ -827,13 +821,13 @@ public class JsonCodec implements Serializable { JSONArray values = new JSONArray(); for (Entry<?, ?> entry : map.entrySet()) { - Object encodedKey = encode(entry.getKey(), null, keyType, - connectorTracker); - Object encodedValue = encode(entry.getValue(), null, valueType, + EncodeResult encodedKey = encode(entry.getKey(), null, keyType, connectorTracker); + EncodeResult encodedValue = encode(entry.getValue(), null, + valueType, connectorTracker); - keys.put(encodedKey); - values.put(encodedValue); + keys.put(encodedKey.getEncodedValue()); + values.put(encodedValue.getEncodedValue()); } return new JSONArray(Arrays.asList(keys, values)); @@ -844,10 +838,13 @@ public class JsonCodec implements Serializable { JSONObject jsonMap = new JSONObject(); for (Entry<?, ?> entry : map.entrySet()) { - Connector key = (Connector) entry.getKey(); - Object encodedValue = encode(entry.getValue(), null, valueType, - connectorTracker); - jsonMap.put(key.getConnectorId(), encodedValue); + ClientConnector key = (ClientConnector) entry.getKey(); + if (AbstractCommunicationManager.isVisible(key)) { + EncodeResult encodedValue = encode(entry.getValue(), null, + valueType, connectorTracker); + jsonMap.put(key.getConnectorId(), + encodedValue.getEncodedValue()); + } } return jsonMap; @@ -859,9 +856,9 @@ public class JsonCodec implements Serializable { for (Entry<?, ?> entry : map.entrySet()) { String key = (String) entry.getKey(); - Object encodedValue = encode(entry.getValue(), null, valueType, - connectorTracker); - jsonMap.put(key, encodedValue); + EncodeResult encodedValue = encode(entry.getValue(), null, + valueType, connectorTracker); + jsonMap.put(key, encodedValue.getEncodedValue()); } return jsonMap; diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java b/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java index eba7d6e3a3..3e0f8d6b99 100644 --- a/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java +++ b/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java @@ -46,7 +46,7 @@ import javax.xml.namespace.QName; import com.vaadin.Application; import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * TODO Write documentation, fix JavaDoc tags. @@ -180,18 +180,18 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { } } - public void firePortletRenderRequest(Application app, Root root, + public void firePortletRenderRequest(Application app, UI uI, RenderRequest request, RenderResponse response) { Set<PortletListener> listeners = portletListeners.get(app); if (listeners != null) { for (PortletListener l : listeners) { l.handleRenderRequest(request, new RestrictedRenderResponse( - response), root); + response), uI); } } } - public void firePortletActionRequest(Application app, Root root, + public void firePortletActionRequest(Application app, UI uI, ActionRequest request, ActionResponse response) { String key = request.getParameter(ActionRequest.ACTION_NAME); if (eventActionDestinationMap.containsKey(key)) { @@ -213,28 +213,28 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { Set<PortletListener> listeners = portletListeners.get(app); if (listeners != null) { for (PortletListener l : listeners) { - l.handleActionRequest(request, response, root); + l.handleActionRequest(request, response, uI); } } } } - public void firePortletEventRequest(Application app, Root root, + public void firePortletEventRequest(Application app, UI uI, EventRequest request, EventResponse response) { Set<PortletListener> listeners = portletListeners.get(app); if (listeners != null) { for (PortletListener l : listeners) { - l.handleEventRequest(request, response, root); + l.handleEventRequest(request, response, uI); } } } - public void firePortletResourceRequest(Application app, Root root, + public void firePortletResourceRequest(Application app, UI uI, ResourceRequest request, ResourceResponse response) { Set<PortletListener> listeners = portletListeners.get(app); if (listeners != null) { for (PortletListener l : listeners) { - l.handleResourceRequest(request, response, root); + l.handleResourceRequest(request, response, uI); } } } @@ -242,16 +242,16 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { public interface PortletListener extends Serializable { public void handleRenderRequest(RenderRequest request, - RenderResponse response, Root root); + RenderResponse response, UI uI); public void handleActionRequest(ActionRequest request, - ActionResponse response, Root root); + ActionResponse response, UI uI); public void handleEventRequest(EventRequest request, - EventResponse response, Root root); + EventResponse response, UI uI); public void handleResourceRequest(ResourceRequest request, - ResourceResponse response, Root root); + ResourceResponse response, UI uI); } /** @@ -295,7 +295,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { * Event names for events sent and received by a portlet need to be declared * in portlet.xml . * - * @param root + * @param uI * a window in which a temporary action URL can be opened if * necessary * @param name @@ -304,7 +304,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { * event value object that is Serializable and, if appropriate, * has a valid JAXB annotation */ - public void sendPortletEvent(Root root, QName name, Serializable value) + public void sendPortletEvent(UI uI, QName name, Serializable value) throws IllegalStateException { if (response instanceof MimeResponse) { String actionKey = "" + System.currentTimeMillis(); @@ -315,7 +315,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { if (actionUrl != null) { eventActionDestinationMap.put(actionKey, name); eventActionValueMap.put(actionKey, value); - root.getPage().open(new ExternalResource(actionUrl.toString())); + uI.getPage().open(new ExternalResource(actionUrl.toString())); } else { // this should never happen as we already know the response is a // MimeResponse @@ -342,7 +342,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { * Shared parameters set or read by a portlet need to be declared in * portlet.xml . * - * @param root + * @param uI * a window in which a temporary action URL can be opened if * necessary * @param name @@ -350,7 +350,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { * @param value * parameter value */ - public void setSharedRenderParameter(Root root, String name, String value) + public void setSharedRenderParameter(UI uI, String name, String value) throws IllegalStateException { if (response instanceof MimeResponse) { String actionKey = "" + System.currentTimeMillis(); @@ -361,7 +361,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { if (actionUrl != null) { sharedParameterActionNameMap.put(actionKey, name); sharedParameterActionValueMap.put(actionKey, value); - root.getPage().open(new ExternalResource(actionUrl.toString())); + uI.getPage().open(new ExternalResource(actionUrl.toString())); } else { // this should never happen as we already know the response is a // MimeResponse @@ -381,7 +381,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { * * Portlet modes used by a portlet need to be declared in portlet.xml . * - * @param root + * @param uI * a window in which the render URL can be opened if necessary * @param portletMode * the portlet mode to switch to @@ -389,13 +389,13 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { * if the portlet mode is not allowed for some reason * (configuration, permissions etc.) */ - public void setPortletMode(Root root, PortletMode portletMode) + public void setPortletMode(UI uI, PortletMode portletMode) throws IllegalStateException, PortletModeException { if (response instanceof MimeResponse) { PortletURL url = ((MimeResponse) response).createRenderURL(); url.setPortletMode(portletMode); - throw new RuntimeException("Root.open has not yet been implemented"); - // root.open(new ExternalResource(url.toString())); + throw new RuntimeException("UI.open has not yet been implemented"); + // UI.open(new ExternalResource(url.toString())); } else if (response instanceof StateAwareResponse) { ((StateAwareResponse) response).setPortletMode(portletMode); } else { @@ -404,6 +404,11 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { } } + @Override + public int getMaxInactiveInterval() { + return getPortletSession().getMaxInactiveInterval(); + } + private Logger getLogger() { return Logger.getLogger(PortletApplicationContext2.class.getName()); } diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java index b6fbbec298..e127425786 100644 --- a/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java @@ -34,7 +34,7 @@ import com.vaadin.terminal.DeploymentConfiguration; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedResponse; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * TODO document me! @@ -142,10 +142,10 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { } @Override - protected String getInitialUIDL(WrappedRequest request, Root root) + protected String getInitialUIDL(WrappedRequest request, UI uI) throws PaintException, JSONException { return PortletCommunicationManager.this.getInitialUIDL(request, - root); + uI); } @Override @@ -168,9 +168,9 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { } @Override - protected InputStream getThemeResourceAsStream(Root root, String themeName, + protected InputStream getThemeResourceAsStream(UI uI, String themeName, String resource) { - PortletApplicationContext2 context = (PortletApplicationContext2) root + PortletApplicationContext2 context = (PortletApplicationContext2) uI .getApplication().getContext(); PortletContext portletContext = context.getPortletSession() .getPortletContext(); diff --git a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java index 200f9a9103..1d35785a57 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java +++ b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java @@ -6,10 +6,10 @@ import com.vaadin.Application; import com.vaadin.shared.ApplicationConstants; import com.vaadin.terminal.DeploymentConfiguration; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /* - * Copyright 2011 Vaadin Ltd. + * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -43,14 +43,14 @@ class ServletPortletHelper implements Serializable { throws ApplicationClassException { String applicationParameter = deploymentConfiguration .getInitParameters().getProperty("application"); - String rootParameter = deploymentConfiguration.getInitParameters() - .getProperty(Application.ROOT_PARAMETER); + String uiParameter = deploymentConfiguration.getInitParameters() + .getProperty(Application.UI_PARAMETER); ClassLoader classLoader = deploymentConfiguration.getClassLoader(); if (applicationParameter == null) { // Validate the parameter value - verifyRootClass(rootParameter, classLoader); + verifyUIClass(uiParameter, classLoader); // Application can be used if a valid rootLayout is defined return Application.class; @@ -66,22 +66,22 @@ class ServletPortletHelper implements Serializable { } } - private static void verifyRootClass(String className, - ClassLoader classLoader) throws ApplicationClassException { + private static void verifyUIClass(String className, ClassLoader classLoader) + throws ApplicationClassException { if (className == null) { - throw new ApplicationClassException(Application.ROOT_PARAMETER + throw new ApplicationClassException(Application.UI_PARAMETER + " init parameter not defined"); } - // Check that the root layout class can be found + // Check that the UI layout class can be found try { - Class<?> rootClass = classLoader.loadClass(className); - if (!Root.class.isAssignableFrom(rootClass)) { + Class<?> uiClass = classLoader.loadClass(className); + if (!UI.class.isAssignableFrom(uiClass)) { throw new ApplicationClassException(className - + " does not implement Root"); + + " does not implement UI"); } // Try finding a default constructor, else throw exception - rootClass.getConstructor(); + uiClass.getConstructor(); } catch (ClassNotFoundException e) { throw new ApplicationClassException(className + " could not be loaded", e); @@ -129,4 +129,9 @@ class ServletPortletHelper implements Serializable { return hasPathPrefix(request, ApplicationConstants.APP_REQUEST_PATH); } + public static boolean isHeartbeatRequest(WrappedRequest request) { + return hasPathPrefix(request, + ApplicationConstants.HEARTBEAT_REQUEST_PATH); + } + } diff --git a/server/src/com/vaadin/terminal/gwt/server/WebApplicationContext.java b/server/src/com/vaadin/terminal/gwt/server/WebApplicationContext.java index 4cc0ed188d..bfcc0c1038 100644 --- a/server/src/com/vaadin/terminal/gwt/server/WebApplicationContext.java +++ b/server/src/com/vaadin/terminal/gwt/server/WebApplicationContext.java @@ -187,4 +187,8 @@ public class WebApplicationContext extends AbstractWebApplicationContext { return mgr; } + @Override + public int getMaxInactiveInterval() { + return getHttpSession().getMaxInactiveInterval(); + } } diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index b1393488f7..a52a07f266 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -557,16 +557,6 @@ public abstract class AbstractComponent extends AbstractClientConnector } /* - * Gets the parent window of the component. Don't add a JavaDoc comment - * here, we use the default documentation from implemented interface. - */ - @Override - public Root getRoot() { - // Just make method from implemented Component interface public - return super.getRoot(); - } - - /* * Notify the component that it's attached to a window. Don't add a JavaDoc * comment here, we use the default documentation from implemented * interface. @@ -588,9 +578,9 @@ public abstract class AbstractComponent extends AbstractClientConnector public void detach() { super.detach(); if (actionManager != null) { - // Remove any existing viewer. Root cast is just to make the + // Remove any existing viewer. UI cast is just to make the // compiler happy - actionManager.setViewer((Root) null); + actionManager.setViewer((UI) null); } } @@ -601,7 +591,7 @@ public abstract class AbstractComponent extends AbstractClientConnector if (this instanceof Focusable) { final Application app = getApplication(); if (app != null) { - getRoot().setFocusedComponent((Focusable) this); + getUI().setFocusedComponent((Focusable) this); delayedFocus = false; } else { delayedFocus = true; @@ -1304,19 +1294,19 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Set a viewer for the action manager to be the parent sub window (if the - * component is in a window) or the root (otherwise). This is still a + * component is in a window) or the UI (otherwise). This is still a * simplification of the real case as this should be handled by the parent * VOverlay (on the client side) if the component is inside an VOverlay * component. */ private void setActionManagerViewer() { - if (actionManager != null && getRoot() != null) { + if (actionManager != null && getUI() != null) { // Attached and has action manager Window w = findAncestor(Window.class); if (w != null) { actionManager.setViewer(w); } else { - actionManager.setViewer(getRoot()); + actionManager.setViewer(getUI()); } } diff --git a/server/src/com/vaadin/ui/AbstractEmbedded.java b/server/src/com/vaadin/ui/AbstractEmbedded.java new file mode 100644 index 0000000000..9396af5c44 --- /dev/null +++ b/server/src/com/vaadin/ui/AbstractEmbedded.java @@ -0,0 +1,84 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.ui; + +import com.vaadin.shared.ui.AbstractEmbeddedState; +import com.vaadin.terminal.Resource; +import com.vaadin.terminal.gwt.server.ResourceReference; + +/** + * Abstract base for embedding components. + * + * @author Vaadin Ltd. + * @version + * @VERSION@ + * @since 7.0 + */ +@SuppressWarnings("serial") +public abstract class AbstractEmbedded extends AbstractComponent { + + @Override + public AbstractEmbeddedState getState() { + return (AbstractEmbeddedState) super.getState(); + } + + /** + * Sets the object source resource. The dimensions are assumed if possible. + * The type is guessed from resource. + * + * @param source + * the source to set. + */ + public void setSource(Resource source) { + if (source == null) { + getState().setSource(null); + } else { + getState().setSource(new ResourceReference(source)); + } + requestRepaint(); + } + + /** + * Get the object source resource. + * + * @return the source + */ + public Resource getSource() { + ResourceReference ref = ((ResourceReference) getState().getSource()); + if (ref == null) { + return null; + } else { + return ref.getResource(); + } + } + + /** + * Sets this component's alternate text that can be presented instead of the + * component's normal content for accessibility purposes. + * + * @param altText + * A short, human-readable description of this component's + * content. + */ + public void setAlternateText(String altText) { + if (altText != getState().getAlternateText() + || (altText != null && !altText.equals(getState() + .getAlternateText()))) { + getState().setAlternateText(altText); + requestRepaint(); + } + } + + /** + * Gets this component's alternate text that can be presented instead of the + * component's normal content for accessibility purposes. + * + * @returns Alternate text + */ + public String getAlternateText() { + return getState().getAlternateText(); + } + +} diff --git a/server/src/com/vaadin/ui/Button.java b/server/src/com/vaadin/ui/Button.java index 8546d8f830..68b9f1392f 100644 --- a/server/src/com/vaadin/ui/Button.java +++ b/server/src/com/vaadin/ui/Button.java @@ -472,6 +472,10 @@ public class Button extends AbstractComponent implements * Determines if a button is automatically disabled when clicked. If this is * set to true the button will be automatically disabled when clicked, * typically to prevent (accidental) extra clicks on a button. + * <p> + * Note that this is only used when the click comes from the user, not when + * calling {@link #click()}. + * </p> * * @param disableOnClick * true to disable button when it is clicked, false otherwise diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index 89e282d4e1..400dd66cac 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -507,18 +507,18 @@ public interface Component extends ClientConnector, Sizeable, Serializable { public void setIcon(Resource icon); /** - * Gets the Root the component is attached to. + * Gets the UI the component is attached to. * * <p> - * If the component is not attached to a Root through a component + * If the component is not attached to a UI through a component * containment hierarchy, <code>null</code> is returned. * </p> * - * @return the Root of the component or <code>null</code> if it is not - * attached to a Root + * @return the UI of the component or <code>null</code> if it is not + * attached to a UI */ @Override - public Root getRoot(); + public UI getUI(); /** * Gets the application object to which the component is attached. @@ -548,7 +548,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * <p> * Reimplementing the {@code attach()} method is useful for tasks that need * to get a reference to the parent, window, or application object with the - * {@link #getParent()}, {@link #getRoot()}, and {@link #getApplication()} + * {@link #getParent()}, {@link #getUI()}, and {@link #getApplication()} * methods. A component does not yet know these objects in the constructor, * so in such case, the methods will return {@code null}. For example, the * following is invalid: @@ -574,8 +574,8 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * {@link #setParent(Component)}. * </p> * <p> - * This method must call {@link Root#componentAttached(Component)} to let - * the Root know that a new Component has been attached. + * This method must call {@link UI#componentAttached(Component)} to let + * the UI know that a new Component has been attached. * </p> * * diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java index 72879e0a25..b44189f838 100644 --- a/server/src/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/com/vaadin/ui/ConnectorTracker.java @@ -26,11 +26,12 @@ import java.util.logging.Level; import java.util.logging.Logger; import com.vaadin.terminal.AbstractClientConnector; +import com.vaadin.terminal.gwt.server.AbstractCommunicationManager; import com.vaadin.terminal.gwt.server.ClientConnector; /** * A class which takes care of book keeping of {@link ClientConnector}s for a - * Root. + * UI. * <p> * Provides {@link #getConnector(String)} which can be used to lookup a * connector from its id. This is for framework use only and should not be @@ -54,7 +55,7 @@ public class ConnectorTracker implements Serializable { private Set<ClientConnector> dirtyConnectors = new HashSet<ClientConnector>(); private Set<ClientConnector> uninitializedConnectors = new HashSet<ClientConnector>(); - private Root root; + private UI uI; private Map<ClientConnector, Object> diffStates = new HashMap<ClientConnector, Object>(); /** @@ -68,15 +69,15 @@ public class ConnectorTracker implements Serializable { } /** - * Creates a new ConnectorTracker for the given root. A tracker is always - * attached to a root and the root cannot be changed during the lifetime of - * a {@link ConnectorTracker}. + * Creates a new ConnectorTracker for the given uI. A tracker is always + * attached to a uI and the uI cannot be changed during the lifetime of a + * {@link ConnectorTracker}. * - * @param root - * The root to attach to. Cannot be null. + * @param uI + * The uI to attach to. Cannot be null. */ - public ConnectorTracker(Root root) { - this.root = root; + public ConnectorTracker(UI uI) { + this.uI = uI; } /** @@ -210,8 +211,8 @@ public class ConnectorTracker implements Serializable { while (iterator.hasNext()) { String connectorId = iterator.next(); ClientConnector connector = connectorIdToConnector.get(connectorId); - if (getRootForConnector(connector) != root) { - // If connector is no longer part of this root, + if (getUIForConnector(connector) != uI) { + // If connector is no longer part of this uI, // remove it from the map. If it is re-attached to the // application at some point it will be re-added through // registerConnector(connector) @@ -226,28 +227,36 @@ public class ConnectorTracker implements Serializable { uninitializedConnectors.remove(connector); diffStates.remove(connector); iterator.remove(); + } else if (!AbstractCommunicationManager.isVisible(connector) + && !uninitializedConnectors.contains(connector)) { + uninitializedConnectors.add(connector); + diffStates.remove(connector); + getLogger().fine( + "cleanConnectorMap removed state for " + + getConnectorAndParentInfo(connector) + + " as it is not visible"); } } } /** - * Finds the root that the connector is attached to. + * Finds the uI that the connector is attached to. * * @param connector * The connector to lookup - * @return The root the connector is attached to or null if it is not - * attached to any root. + * @return The uI the connector is attached to or null if it is not attached + * to any uI. */ - private Root getRootForConnector(ClientConnector connector) { + private UI getUIForConnector(ClientConnector connector) { if (connector == null) { return null; } if (connector instanceof Component) { - return ((Component) connector).getRoot(); + return ((Component) connector).getUI(); } - return getRootForConnector(connector.getParent()); + return getUIForConnector(connector.getParent()); } /** @@ -330,15 +339,15 @@ public class ConnectorTracker implements Serializable { } /** - * Mark all connectors in this root as dirty. + * Mark all connectors in this uI as dirty. */ public void markAllConnectorsDirty() { - markConnectorsDirtyRecursively(root); + markConnectorsDirtyRecursively(uI); getLogger().fine("All connectors are now dirty"); } /** - * Mark all connectors in this root as clean. + * Mark all connectors in this uI as clean. */ public void markAllConnectorsClean() { dirtyConnectors.clear(); @@ -370,7 +379,7 @@ public class ConnectorTracker implements Serializable { * client in the following request. * </p> * - * @return A collection of all dirty connectors for this root. This list may + * @return A collection of all dirty connectors for this uI. This list may * contain invisible connectors. */ public Collection<ClientConnector> getDirtyConnectors() { diff --git a/server/src/com/vaadin/ui/EmbeddedBrowser.java b/server/src/com/vaadin/ui/EmbeddedBrowser.java new file mode 100644 index 0000000000..4e2ae18de8 --- /dev/null +++ b/server/src/com/vaadin/ui/EmbeddedBrowser.java @@ -0,0 +1,19 @@ +package com.vaadin.ui; + +import com.vaadin.shared.ui.embeddedbrowser.EmbeddedBrowserState; + +/** + * Component for embedding browser "iframe". + * + * @author Vaadin Ltd. + * @version + * @VERSION@ + * @since 7.0 + */ +public class EmbeddedBrowser extends AbstractEmbedded { + + @Override + public EmbeddedBrowserState getState() { + return (EmbeddedBrowserState) super.getState(); + } +} diff --git a/server/src/com/vaadin/ui/Flash.java b/server/src/com/vaadin/ui/Flash.java new file mode 100644 index 0000000000..0e6cf63a91 --- /dev/null +++ b/server/src/com/vaadin/ui/Flash.java @@ -0,0 +1,136 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.ui; + +import java.util.HashMap; + +import com.vaadin.shared.ui.flash.FlashState; + +/** + * Component for embedding flash objects. + * + * @author Vaadin Ltd. + * @version + * @VERSION@ + * @since 7.0 + */ +@SuppressWarnings("serial") +public class Flash extends AbstractEmbedded { + + @Override + public FlashState getState() { + return (FlashState) super.getState(); + } + + /** + * This attribute specifies the base path used to resolve relative URIs + * specified by the classid, data, and archive attributes. When absent, its + * default value is the base URI of the current document. + * + * @param codebase + * The base path + */ + public void setCodebase(String codebase) { + if (codebase != getState().getCodebase() + || (codebase != null && !codebase.equals(getState() + .getCodebase()))) { + getState().setCodebase(codebase); + requestRepaint(); + } + } + + /** + * This attribute specifies the content type of data expected when + * downloading the object specified by classid. This attribute is optional + * but recommended when classid is specified since it allows the user agent + * to avoid loading information for unsupported content types. When absent, + * it defaults to the value of the type attribute. + * + * @param codetype + * the codetype to set. + */ + public void setCodetype(String codetype) { + if (codetype != getState().getCodetype() + || (codetype != null && !codetype.equals(getState() + .getCodetype()))) { + getState().setCodetype(codetype); + requestRepaint(); + } + } + + /** + * This attribute may be used to specify a space-separated list of URIs for + * archives containing resources relevant to the object, which may include + * the resources specified by the classid and data attributes. Preloading + * archives will generally result in reduced load times for objects. + * Archives specified as relative URIs should be interpreted relative to the + * codebase attribute. + * + * @param archive + * Space-separated list of URIs with resources relevant to the + * object + */ + public void setArchive(String archive) { + if (archive != getState().getArchive() + || (archive != null && !archive.equals(getState().getArchive()))) { + getState().setArchive(archive); + requestRepaint(); + } + } + + public void setStandby(String standby) { + if (standby != getState().getStandby() + || (standby != null && !standby.equals(getState().getStandby()))) { + getState().setStandby(standby); + requestRepaint(); + } + } + + /** + * Sets an object parameter. Parameters are optional information, and they + * are passed to the instantiated object. Parameters are are stored as name + * value pairs. This overrides the previous value assigned to this + * parameter. + * + * @param name + * the name of the parameter. + * @param value + * the value of the parameter. + */ + public void setParameter(String name, String value) { + if (getState().getEmbedParams() == null) { + getState().setEmbedParams(new HashMap<String, String>()); + } + getState().getEmbedParams().put(name, value); + requestRepaint(); + } + + /** + * Gets the value of an object parameter. Parameters are optional + * information, and they are passed to the instantiated object. Parameters + * are are stored as name value pairs. + * + * @return the Value of parameter or null if not found. + */ + public String getParameter(String name) { + return getState().getEmbedParams() != null ? getState() + .getEmbedParams().get(name) : null; + } + + /** + * Removes an object parameter from the list. + * + * @param name + * the name of the parameter to remove. + */ + public void removeParameter(String name) { + if (getState().getEmbedParams() == null) { + return; + } + getState().getEmbedParams().remove(name); + requestRepaint(); + } + +} diff --git a/server/src/com/vaadin/ui/Image.java b/server/src/com/vaadin/ui/Image.java new file mode 100644 index 0000000000..b0dbc9e629 --- /dev/null +++ b/server/src/com/vaadin/ui/Image.java @@ -0,0 +1,94 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.ui; + +import com.vaadin.event.MouseEvents.ClickEvent; +import com.vaadin.event.MouseEvents.ClickListener; +import com.vaadin.shared.EventId; +import com.vaadin.shared.MouseEventDetails; +import com.vaadin.shared.ui.image.ImageServerRpc; +import com.vaadin.shared.ui.image.ImageState; +import com.vaadin.terminal.Resource; + +/** + * Component for embedding images. + * + * @author Vaadin Ltd. + * @version + * @VERSION@ + * @since 7.0 + */ +@SuppressWarnings("serial") +public class Image extends AbstractEmbedded { + + protected ImageServerRpc rpc = new ImageServerRpc() { + @Override + public void click(MouseEventDetails mouseDetails) { + fireEvent(new ClickEvent(Image.this, mouseDetails)); + } + }; + + /** + * Creates a new empty Image. + */ + public Image() { + registerRpc(rpc); + } + + /** + * Creates a new empty Image with caption. + * + * @param caption + */ + public Image(String caption) { + this(); + setCaption(caption); + } + + /** + * Creates a new Image whose contents is loaded from given resource. The + * dimensions are assumed if possible. The type is guessed from resource. + * + * @param caption + * @param source + * the Source of the embedded object. + */ + public Image(String caption, Resource source) { + this(caption); + setSource(source); + } + + @Override + public ImageState getState() { + return (ImageState) super.getState(); + } + + /** + * Add a click listener to the component. The listener is called whenever + * the user clicks inside the component. Depending on the content the event + * may be blocked and in that case no event is fired. + * + * Use {@link #removeListener(ClickListener)} to remove the listener. + * + * @param listener + * The listener to add + */ + public void addListener(ClickListener listener) { + addListener(EventId.CLICK_EVENT_IDENTIFIER, ClickEvent.class, listener, + ClickListener.clickMethod); + } + + /** + * Remove a click listener from the component. The listener should earlier + * have been added using {@link #addListener(ClickListener)}. + * + * @param listener + * The listener to remove + */ + public void removeListener(ClickListener listener) { + removeListener(EventId.CLICK_EVENT_IDENTIFIER, ClickEvent.class, + listener); + } +} diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java index bb7767084c..1c154699d8 100644 --- a/server/src/com/vaadin/ui/LoginForm.java +++ b/server/src/com/vaadin/ui/LoginForm.java @@ -99,8 +99,8 @@ public class LoginForm extends CustomComponent { throws IOException { String requestPathInfo = request.getRequestPathInfo(); if ("/loginHandler".equals(requestPathInfo)) { - // Ensure Root.getCurrent() works in listeners - Root.setCurrent(getRoot()); + // Ensure UI.getCurrent() works in listeners + UI.setCurrent(getUI()); response.setCacheTime(-1); response.setContentType("text/html; charset=utf-8"); diff --git a/server/src/com/vaadin/ui/Select.java b/server/src/com/vaadin/ui/Select.java index 20345b55e0..6ff7c9c9bc 100644 --- a/server/src/com/vaadin/ui/Select.java +++ b/server/src/com/vaadin/ui/Select.java @@ -654,7 +654,7 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering, if (filterstring != null) { filterstring = filterstring.toLowerCase(); } - optionRepaint(); + requestRepaint(); } else if (isNewItemsAllowed()) { // New option entered (and it is allowed) final String newitem = (String) variables.get("newitem"); @@ -682,18 +682,6 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering, } @Override - public void markAsDirty() { - super.markAsDirty(); - optionRequest = false; - prevfilterstring = filterstring; - filterstring = null; - } - - private void optionRepaint() { - super.markAsDirty(); - } - - @Override public void setFilteringMode(int filteringMode) { this.filteringMode = filteringMode; } diff --git a/server/src/com/vaadin/ui/Slider.java b/server/src/com/vaadin/ui/Slider.java index d4e2db4853..a0b1d01b01 100644 --- a/server/src/com/vaadin/ui/Slider.java +++ b/server/src/com/vaadin/ui/Slider.java @@ -16,11 +16,9 @@ package com.vaadin.ui; -import java.util.Map; - -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Vaadin6Component; +import com.vaadin.shared.ui.slider.SliderOrientation; +import com.vaadin.shared.ui.slider.SliderServerRpc; +import com.vaadin.shared.ui.slider.SliderState; /** * A component for selecting a numerical value within a range. @@ -41,9 +39,9 @@ import com.vaadin.terminal.Vaadin6Component; * vl.addComponent(volumeIndicator); * volumeIndicator.setValue("Current volume:" + 50.0); * slider.addListener(this); - * + * * } - * + * * public void setVolume(double d) { * volumeIndicator.setValue("Current volume: " + d); * } @@ -58,28 +56,29 @@ import com.vaadin.terminal.Vaadin6Component; * * @author Vaadin Ltd. */ -public class Slider extends AbstractField<Double> implements Vaadin6Component { - - public static final int ORIENTATION_HORIZONTAL = 0; - - public static final int ORIENTATION_VERTICAL = 1; +public class Slider extends AbstractField<Double> { - /** Minimum value of slider */ - private double min = 0; + private SliderServerRpc rpc = new SliderServerRpc() { - /** Maximum value of slider */ - private double max = 100; + @Override + public void valueChanged(double value) { - /** - * Resolution, how many digits are considered relevant after the decimal - * point. Must be a non-negative value - */ - private int resolution = 0; + try { + setValue(value, true); + } catch (final ValueOutOfBoundsException e) { + // Convert to nearest bound + double out = e.getValue().doubleValue(); + if (out < getState().getMinValue()) { + out = getState().getMinValue(); + } + if (out > getState().getMaxValue()) { + out = getState().getMaxValue(); + } + Slider.super.setValue(new Double(out), false); + } + } - /** - * Slider orientation (horizontal/vertical), defaults . - */ - private int orientation = ORIENTATION_HORIZONTAL; + }; /** * Default slider constructor. Sets all values to defaults and the slide @@ -88,7 +87,8 @@ public class Slider extends AbstractField<Double> implements Vaadin6Component { */ public Slider() { super(); - super.setValue(new Double(min)); + registerRpc(rpc); + super.setValue(new Double(getState().getMinValue())); } /** @@ -153,13 +153,18 @@ public class Slider extends AbstractField<Double> implements Vaadin6Component { setCaption(caption); } + @Override + public SliderState getState() { + return (SliderState) super.getState(); + } + /** * Gets the maximum slider value * * @return the largest value the slider can have */ public double getMax() { - return max; + return getState().getMaxValue(); } /** @@ -170,11 +175,10 @@ public class Slider extends AbstractField<Double> implements Vaadin6Component { * The new maximum slider value */ public void setMax(double max) { - this.max = max; + getState().setMaxValue(max); if (getValue() > max) { setValue(max); } - markAsDirty(); } /** @@ -183,7 +187,7 @@ public class Slider extends AbstractField<Double> implements Vaadin6Component { * @return the smallest value the slider can have */ public double getMin() { - return min; + return getState().getMinValue(); } /** @@ -194,33 +198,32 @@ public class Slider extends AbstractField<Double> implements Vaadin6Component { * The new minimum slider value */ public void setMin(double min) { - this.min = min; + getState().setMinValue(min); if (getValue() < min) { setValue(min); } - markAsDirty(); } /** * Get the current orientation of the slider (horizontal or vertical). * - * @return {@link #ORIENTATION_HORIZONTAL} or - * {@link #ORIENTATION_HORIZONTAL} + * @return {@link SliderOrientation#HORIZONTAL} or + * {@link SliderOrientation#VERTICAL} */ - public int getOrientation() { - return orientation; + public SliderOrientation getOrientation() { + return getState().getOrientation(); } /** * Set the orientation of the slider. * - * @param The - * new orientation, either {@link #ORIENTATION_HORIZONTAL} or - * {@link #ORIENTATION_VERTICAL} + * @param orientation + * The new orientation, either + * {@link SliderOrientation#HORIZONTAL} or + * {@link SliderOrientation#VERTICAL} */ - public void setOrientation(int orientation) { - this.orientation = orientation; - markAsDirty(); + public void setOrientation(SliderOrientation orientation) { + getState().setOrientation(orientation); } /** @@ -230,21 +233,24 @@ public class Slider extends AbstractField<Double> implements Vaadin6Component { * @return resolution */ public int getResolution() { - return resolution; + return getState().getResolution(); } /** * Set a new resolution for the slider. The resolution is the number of * digits after the decimal point. * + * @throws IllegalArgumentException + * if resolution is negative. + * * @param resolution */ public void setResolution(int resolution) { if (resolution < 0) { - return; + throw new IllegalArgumentException( + "Cannot set a negative resolution to Slider"); } - this.resolution = resolution; - markAsDirty(); + getState().setResolution(resolution); } /** @@ -261,87 +267,36 @@ public class Slider extends AbstractField<Double> implements Vaadin6Component { @Override protected void setValue(Double value, boolean repaintIsNotNeeded) { final double v = value.doubleValue(); + final int resolution = getResolution(); double newValue; + if (resolution > 0) { // Round up to resolution newValue = (int) (v * Math.pow(10, resolution)); newValue = newValue / Math.pow(10, resolution); - if (min > newValue || max < newValue) { + if (getMin() > newValue || getMax() < newValue) { throw new ValueOutOfBoundsException(value); } } else { newValue = (int) v; - if (min > newValue || max < newValue) { + if (getMin() > newValue || getMax() < newValue) { throw new ValueOutOfBoundsException(value); } } + + getState().setValue(newValue); super.setValue(newValue, repaintIsNotNeeded); } @Override - public void setValue(Object newFieldValue) - throws com.vaadin.data.Property.ReadOnlyException { - if (newFieldValue != null && newFieldValue instanceof Number - && !(newFieldValue instanceof Double)) { + public void setValue(Object newFieldValue) { + if (newFieldValue instanceof Number) { // Support setting all types of Numbers newFieldValue = ((Number) newFieldValue).doubleValue(); } - - super.setValue(newFieldValue); - } - - @Override - public void paintContent(PaintTarget target) throws PaintException { - - target.addAttribute("min", min); - if (max > min) { - target.addAttribute("max", max); - } else { - target.addAttribute("max", min); - } - target.addAttribute("resolution", resolution); - - if (resolution > 0) { - target.addVariable(this, "value", getValue().doubleValue()); - } else { - target.addVariable(this, "value", getValue().intValue()); - } - - if (orientation == ORIENTATION_VERTICAL) { - target.addAttribute("vertical", true); - } - - } - - /** - * Invoked when the value of a variable has changed. Slider listeners are - * notified if the slider value has changed. - * - * @param source - * @param variables - */ - @Override - public void changeVariables(Object source, Map<String, Object> variables) { - if (variables.containsKey("value")) { - final Object value = variables.get("value"); - final Double newValue = new Double(value.toString()); - if (newValue != null && newValue != getValue() - && !newValue.equals(getValue())) { - try { - setValue(newValue, true); - } catch (final ValueOutOfBoundsException e) { - // Convert to nearest bound - double out = e.getValue().doubleValue(); - if (out < min) { - out = min; - } - if (out > max) { - out = max; - } - super.setValue(new Double(out), false); - } - } - } + setValue(newFieldValue); + // The cast is safe if the above call returned without throwing + getState().setValue((Double) newFieldValue); } /** @@ -373,7 +328,6 @@ public class Slider extends AbstractField<Double> implements Vaadin6Component { public Double getValue() { return value; } - } @Override diff --git a/server/src/com/vaadin/ui/Root.java b/server/src/com/vaadin/ui/UI.java index 67f2e04a65..17a028bcdf 100644 --- a/server/src/com/vaadin/ui/Root.java +++ b/server/src/com/vaadin/ui/UI.java @@ -16,11 +16,13 @@ package com.vaadin.ui; +import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.EventListener; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Map; @@ -35,9 +37,9 @@ import com.vaadin.event.MouseEvents.ClickListener; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.BorderStyle; -import com.vaadin.shared.ui.root.RootConstants; -import com.vaadin.shared.ui.root.RootServerRpc; -import com.vaadin.shared.ui.root.RootState; +import com.vaadin.shared.ui.ui.UIConstants; +import com.vaadin.shared.ui.ui.UIServerRpc; +import com.vaadin.shared.ui.ui.UIState; import com.vaadin.terminal.Page; import com.vaadin.terminal.Page.BrowserWindowResizeEvent; import com.vaadin.terminal.Page.BrowserWindowResizeListener; @@ -47,27 +49,28 @@ import com.vaadin.terminal.Resource; import com.vaadin.terminal.Vaadin6Component; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedRequest.BrowserDetails; -import com.vaadin.ui.Window.CloseListener; +import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; +import com.vaadin.tools.ReflectTools; /** - * The topmost component in any component hierarchy. There is one root for every - * Vaadin instance in a browser window. A root may either represent an entire + * The topmost component in any component hierarchy. There is one UI for every + * Vaadin instance in a browser window. A UI may either represent an entire * browser window (or tab) or some part of a html page where a Vaadin * application is embedded. * <p> - * The root is the server side entry point for various client side features that + * The UI is the server side entry point for various client side features that * are not represented as components added to a layout, e.g notifications, sub * windows, and executing javascript in the browser. * </p> * <p> - * When a new application instance is needed, typically because the user opens - * the application in a browser window, - * {@link Application#gerRoot(WrappedRequest)} is invoked to get a root. That - * method does by default create a root according to the - * {@value Application#ROOT_PARAMETER} parameter from web.xml. + * When a new UI instance is needed, typically because the user opens a URL in a + * browser window which points to {@link AbstractApplicationServlet}, + * {@link Application#getUIForRequest(WrappedRequest)} is invoked to get a UI. + * That method does by default create a UI according to the + * {@value Application#UI_PARAMETER} parameter from web.xml. * </p> * <p> - * After a root has been created by the application, it is initialized using + * After a UI has been created by the application, it is initialized using * {@link #init(WrappedRequest)}. This method is intended to be overridden by * the developer to add components to the user interface and initialize * non-component functionality. The component hierarchy is initialized by @@ -76,27 +79,27 @@ import com.vaadin.ui.Window.CloseListener; * </p> * <p> * If a {@link EagerInit} annotation is present on a class extending - * <code>Root</code>, the framework will use a faster initialization method - * which will not ensure that {@link BrowserDetails} are present in the + * <code>UI</code>, the framework will use a faster initialization method which + * will not ensure that {@link BrowserDetails} are present in the * {@link WrappedRequest} passed to the init method. * </p> * * @see #init(WrappedRequest) - * @see Application#getRoot(WrappedRequest) + * @see Application#getUI(WrappedRequest) * * @since 7.0 */ -public abstract class Root extends AbstractComponentContainer implements +public abstract class UI extends AbstractComponentContainer implements Action.Container, Action.Notifier, Vaadin6Component { /** - * Helper class to emulate the main window from Vaadin 6 using roots. This + * Helper class to emulate the main window from Vaadin 6 using UIs. This * class should be used in the same way as Window used as a browser level * window in Vaadin 6 with {@link com.vaadin.Application.LegacyApplication} */ @Deprecated @EagerInit - public static class LegacyWindow extends Root { + public static class LegacyWindow extends UI { private String name; /** @@ -210,11 +213,11 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Opens the given resource in this root. The contents of this Root is + * Opens the given resource in this UI. The contents of this UI is * replaced by the {@code Resource}. * * @param resource - * the resource to show in this root + * the resource to show in this UI * * @deprecated As of 7.0, use getPage().open instead */ @@ -294,9 +297,9 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Adds a new {@link BrowserWindowResizeListener} to this root. The + * Adds a new {@link BrowserWindowResizeListener} to this UI. The * listener will be notified whenever the browser window within which - * this root resides is resized. + * this UI resides is resized. * * @param resizeListener * the listener to add @@ -312,7 +315,7 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Removes a {@link BrowserWindowResizeListener} from this root. The + * Removes a {@link BrowserWindowResizeListener} from this UI. The * listener will no longer be notified when the browser window is * resized. * @@ -326,7 +329,7 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Gets the last known height of the browser window in which this root + * Gets the last known height of the browser window in which this UI * resides. * * @return the browser window height in pixels @@ -338,7 +341,7 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Gets the last known width of the browser window in which this root + * Gets the last known width of the browser window in which this UI * resides. * * @return the browser window width in pixels @@ -389,12 +392,48 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * The application to which this root belongs + * Event fired when a UI is removed from the application. + */ + public static class CloseEvent extends Event { + + private static final String CLOSE_EVENT_IDENTIFIER = "uiClose"; + + public CloseEvent(UI source) { + super(source); + } + + public UI getUI() { + return (UI) getSource(); + } + } + + /** + * Interface for listening {@link UI.CloseEvent UI close events}. + * + */ + public interface CloseListener extends EventListener { + + public static final Method closeMethod = ReflectTools.findMethod( + CloseListener.class, "click", CloseEvent.class); + + /** + * Called when a CloseListener is notified of a CloseEvent. + * {@link UI#getCurrent()} returns <code>event.getUI()</code> within + * this method. + * + * @param event + * The close event that was fired. + */ + public void close(CloseEvent event); + } + + /** + * The application to which this UI belongs */ private Application application; /** - * List of windows in this root. + * List of windows in this UI. */ private final LinkedHashSet<Window> windows = new LinkedHashSet<Window>(); @@ -405,13 +444,13 @@ public abstract class Root extends AbstractComponentContainer implements private Component scrollIntoView; /** - * The id of this root, used to find the server side instance of the root - * form which a request originates. A negative value indicates that the root - * id has not yet been assigned by the Application. + * The id of this UI, used to find the server side instance of the UI form + * which a request originates. A negative value indicates that the UI id has + * not yet been assigned by the Application. * - * @see Application#nextRootId + * @see Application#nextUIId */ - private int rootId = -1; + private int uiId = -1; /** * Keeps track of the Actions added to this component, and manages the @@ -420,19 +459,19 @@ public abstract class Root extends AbstractComponentContainer implements protected ActionManager actionManager; /** - * Thread local for keeping track of the current root. + * Thread local for keeping track of the current UI. */ - private static final ThreadLocal<Root> currentRoot = new ThreadLocal<Root>(); + private static final ThreadLocal<UI> currentUI = new ThreadLocal<UI>(); /** Identifies the click event */ private ConnectorTracker connectorTracker = new ConnectorTracker(this); private Page page = new Page(this); - private RootServerRpc rpc = new RootServerRpc() { + private UIServerRpc rpc = new UIServerRpc() { @Override public void click(MouseEventDetails mouseDetails) { - fireEvent(new ClickEvent(Root.this, mouseDetails)); + fireEvent(new ClickEvent(UI.this, mouseDetails)); } @Override @@ -444,80 +483,89 @@ public abstract class Root extends AbstractComponentContainer implements }; /** - * Creates a new empty root without a caption. This root will have a + * Timestamp keeping track of the last heartbeat of this UI. Updated to the + * current time whenever the application receives a heartbeat or UIDL + * request from the client for this UI. + */ + private long lastHeartbeat = System.currentTimeMillis(); + + private long lastUidlRequest = System.currentTimeMillis(); + + /** + * Creates a new empty UI without a caption. This UI will have a * {@link VerticalLayout} with margins enabled as its content. */ - public Root() { + public UI() { this((ComponentContainer) null); } /** - * Creates a new root with the given component container as its content. + * Creates a new UI with the given component container as its content. * * @param content - * the content container to use as this roots content. + * the content container to use as this UIs content. * * @see #setContent(ComponentContainer) */ - public Root(ComponentContainer content) { + public UI(ComponentContainer content) { registerRpc(rpc); setSizeFull(); setContent(content); } /** - * Creates a new empty root with the given caption. This root will have a + * Creates a new empty UI with the given caption. This UI will have a * {@link VerticalLayout} with margins enabled as its content. * * @param caption - * the caption of the root, used as the page title if there's + * the caption of the UI, used as the page title if there's * nothing but the application on the web page * * @see #setCaption(String) */ - public Root(String caption) { + public UI(String caption) { this((ComponentContainer) null); setCaption(caption); } /** - * Creates a new root with the given caption and content. + * Creates a new UI with the given caption and content. * * @param caption - * the caption of the root, used as the page title if there's + * the caption of the UI, used as the page title if there's * nothing but the application on the web page * @param content - * the content container to use as this roots content. + * the content container to use as this UIs content. * * @see #setContent(ComponentContainer) * @see #setCaption(String) */ - public Root(String caption, ComponentContainer content) { + public UI(String caption, ComponentContainer content) { this(content); setCaption(caption); } @Override - protected RootState getState() { - return (RootState) super.getState(); + protected UIState getState() { + return (UIState) super.getState(); } @Override - public Class<? extends RootState> getStateType() { + public Class<? extends UIState> getStateType() { // This is a workaround for a problem with creating the correct state // object during build - return RootState.class; + return UIState.class; } /** * Overridden to return a value instead of referring to the parent. * - * @return this root + * @return this UI * - * @see com.vaadin.ui.AbstractComponent#getRoot() + * @see com.vaadin.ui.AbstractComponent#getUI() */ @Override - public Root getRoot() { + public UI getUI() { return this; } @@ -542,9 +590,9 @@ public abstract class Root extends AbstractComponentContainer implements if (pendingFocus != null) { // ensure focused component is still attached to this main window - if (pendingFocus.getRoot() == this - || (pendingFocus.getRoot() != null && pendingFocus - .getRoot().getParent() == this)) { + if (pendingFocus.getUI() == this + || (pendingFocus.getUI() != null && pendingFocus.getUI() + .getParent() == this)) { target.addAttribute("focused", pendingFocus); } pendingFocus = null; @@ -555,7 +603,7 @@ public abstract class Root extends AbstractComponentContainer implements } if (isResizeLazy()) { - target.addAttribute(RootConstants.RESIZE_LAZY, true); + target.addAttribute(UIConstants.RESIZE_LAZY, true); } } @@ -571,6 +619,16 @@ public abstract class Root extends AbstractComponentContainer implements fireEvent(new ClickEvent(this, mouseDetails)); } + /** + * For internal use only. + */ + public void fireCloseEvent() { + UI current = UI.getCurrent(); + UI.setCurrent(this); + fireEvent(new CloseEvent(this)); + UI.setCurrent(current); + } + @Override @SuppressWarnings("unchecked") public void changeVariables(Object source, Map<String, Object> variables) { @@ -584,9 +642,9 @@ public abstract class Root extends AbstractComponentContainer implements actionManager.handleActions(variables, this); } - if (variables.containsKey(RootConstants.FRAGMENT_VARIABLE)) { + if (variables.containsKey(UIConstants.FRAGMENT_VARIABLE)) { String fragment = (String) variables - .get(RootConstants.FRAGMENT_VARIABLE); + .get(UIConstants.FRAGMENT_VARIABLE); getPage().setFragment(fragment, true); } } @@ -622,7 +680,7 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Sets the application to which this root is assigned. It is not legal to + * Sets the application to which this UI is assigned. It is not legal to * change the application once it has been set nor to set a * <code>null</code> application. * <p> @@ -652,46 +710,46 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Sets the id of this root within its application. The root id is used to - * route requests to the right root. + * Sets the id of this UI within its application. The UI id is used to route + * requests to the right UI. * <p> * This method is mainly intended for internal use by the framework. * </p> * - * @param rootId - * the id of this root + * @param uiId + * the id of this UI * * @throws IllegalStateException - * if the root id has already been set + * if the UI id has already been set * - * @see #getRootId() + * @see #getUIId() */ - public void setRootId(int rootId) { - if (this.rootId != -1) { - throw new IllegalStateException("Root id has already been defined"); + public void setUIId(int uiId) { + if (this.uiId != -1) { + throw new IllegalStateException("UI id has already been defined"); } - this.rootId = rootId; + this.uiId = uiId; } /** - * Gets the id of the root, used to identify this root within its - * application when processing requests. The root id should be present in - * every request to the server that originates from this root. - * {@link Application#getRootForRequest(WrappedRequest)} uses this id to - * find the route to which the request belongs. + * Gets the id of the UI, used to identify this UI within its application + * when processing requests. The UI id should be present in every request to + * the server that originates from this UI. + * {@link Application#getUIForRequest(WrappedRequest)} uses this id to find + * the route to which the request belongs. * * @return */ - public int getRootId() { - return rootId; + public int getUIId() { + return uiId; } /** - * Adds a window as a subwindow inside this root. To open a new browser - * window or tab, you should instead use {@link open(Resource)} with an url + * Adds a window as a subwindow inside this UI. To open a new browser window + * or tab, you should instead use {@link open(Resource)} with an url * pointing to this application and ensure - * {@link Application#getRoot(WrappedRequest)} returns an appropriate root - * for the request. + * {@link Application#getUI(WrappedRequest)} returns an appropriate UI for + * the request. * * @param window * @throws IllegalArgumentException @@ -727,7 +785,7 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Remove the given subwindow from this root. + * Remove the given subwindow from this UI. * * Since Vaadin 6.5, {@link CloseListener}s are called also when explicitly * removing a window by calling this method. @@ -741,7 +799,7 @@ public abstract class Root extends AbstractComponentContainer implements */ public boolean removeWindow(Window window) { if (!windows.remove(window)) { - // Window window is not a subwindow of this root. + // Window window is not a subwindow of this UI. return false; } window.setParent(null); @@ -752,7 +810,7 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Gets all the windows added to this root. + * Gets all the windows added to this UI. * * @return an unmodifiable collection of windows */ @@ -792,28 +850,28 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Scrolls any component between the component and root to a suitable - * position so the component is visible to the user. The given component - * must belong to this root. + * Scrolls any component between the component and UI to a suitable position + * so the component is visible to the user. The given component must belong + * to this UI. * * @param component * the component to be scrolled into view * @throws IllegalArgumentException - * if {@code component} does not belong to this root + * if {@code component} does not belong to this UI */ public void scrollIntoView(Component component) throws IllegalArgumentException { - if (component.getRoot() != this) { + if (component.getUI() != this) { throw new IllegalArgumentException( - "The component where to scroll must belong to this root."); + "The component where to scroll must belong to this UI."); } scrollIntoView = component; markAsDirty(); } /** - * Gets the content of this root. The content is a component container that - * serves as the outermost item of the visual contents of this root. + * Gets the content of this UI. The content is a component container that + * serves as the outermost item of the visual contents of this UI. * * @return a component container to use as content * @@ -837,15 +895,15 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Sets the content of this root. The content is a component container that - * serves as the outermost item of the visual contents of this root. If no + * Sets the content of this UI. The content is a component container that + * serves as the outermost item of the visual contents of this UI. If no * content has been set, a {@link VerticalLayout} with margins enabled will * be used by default - see {@link #createDefaultLayout()}. The content can * also be set in a constructor. * * @return a component container to use as content * - * @see #Root(ComponentContainer) + * @see #UI(ComponentContainer) * @see #createDefaultLayout() */ public void setContent(ComponentContainer content) { @@ -863,11 +921,11 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Adds a component to this root. The component is not added directly to the - * root, but instead to the content container ({@link #getContent()}). + * Adds a component to this UI. The component is not added directly to the + * UI, but instead to the content container ({@link #getContent()}). * * @param component - * the component to add to this root + * the component to add to this UI * * @see #getContent() */ @@ -878,7 +936,7 @@ public abstract class Root extends AbstractComponentContainer implements /** * This implementation removes the component from the content container ( - * {@link #getContent()}) instead of from the actual root. + * {@link #getContent()}) instead of from the actual UI. */ @Override public void removeComponent(Component component) { @@ -887,7 +945,7 @@ public abstract class Root extends AbstractComponentContainer implements /** * This implementation removes the components from the content container ( - * {@link #getContent()}) instead of from the actual root. + * {@link #getContent()}) instead of from the actual UI. */ @Override public void removeAllComponents() { @@ -910,56 +968,55 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Initializes this root. This method is intended to be overridden by + * Initializes this UI. This method is intended to be overridden by * subclasses to build the view and configure non-component functionality. * Performing the initialization in a constructor is not suggested as the - * state of the root is not properly set up when the constructor is invoked. + * state of the UI is not properly set up when the constructor is invoked. * <p> * The {@link WrappedRequest} can be used to get information about the - * request that caused this root to be created. By default, the + * request that caused this UI to be created. By default, the * {@link BrowserDetails} will be available in the request. If the browser * details are not required, loading the application in the browser can take * some shortcuts giving a faster initial rendering. This can be indicated - * by adding the {@link EagerInit} annotation to the Root class. + * by adding the {@link EagerInit} annotation to the UI class. * </p> * * @param request - * the wrapped request that caused this root to be created + * the wrapped request that caused this UI to be created */ protected abstract void init(WrappedRequest request); /** - * Sets the thread local for the current root. This method is used by the + * Sets the thread local for the current UI. This method is used by the * framework to set the current application whenever a new request is * processed and it is cleared when the request has been processed. * <p> * The application developer can also use this method to define the current - * root outside the normal request handling, e.g. when initiating custom + * UI outside the normal request handling, e.g. when initiating custom * background threads. * </p> * - * @param root - * the root to register as the current root + * @param uI + * the UI to register as the current UI * * @see #getCurrent() * @see ThreadLocal */ - public static void setCurrent(Root root) { - currentRoot.set(root); + public static void setCurrent(UI ui) { + currentUI.set(ui); } /** - * Gets the currently used root. The current root is automatically defined - * when processing requests to the server. In other cases, (e.g. from - * background threads), the current root is not automatically defined. + * Gets the currently used UI. The current UI is automatically defined when + * processing requests to the server. In other cases, (e.g. from background + * threads), the current UI is not automatically defined. * - * @return the current root instance if available, otherwise - * <code>null</code> + * @return the current UI instance if available, otherwise <code>null</code> * - * @see #setCurrent(Root) + * @see #setCurrent(UI) */ - public static Root getCurrent() { - return currentRoot.get(); + public static UI getCurrent() { + return currentUI.get(); } public void setScrollTop(int scrollTop) { @@ -1027,10 +1084,10 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Add a click listener to the Root. The listener is called whenever the - * user clicks inside the Root. Also when the click targets a component - * inside the Root, provided the targeted component does not prevent the - * click event from propagating. + * Add a click listener to the UI. The listener is called whenever the user + * clicks inside the UI. Also when the click targets a component inside the + * UI, provided the targeted component does not prevent the click event from + * propagating. * * Use {@link #removeListener(ClickListener)} to remove the listener. * @@ -1043,7 +1100,7 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Remove a click listener from the Root. The listener should earlier have + * Remove a click listener from the UI. The listener should earlier have * been added using {@link #addListener(ClickListener)}. * * @param listener @@ -1054,9 +1111,33 @@ public abstract class Root extends AbstractComponentContainer implements listener); } + /** + * Adds a close listener to the UI. The listener is called when the UI is + * removed from the application. + * + * @param listener + * The listener to add. + */ + public void addListener(CloseListener listener) { + addListener(CloseEvent.CLOSE_EVENT_IDENTIFIER, CloseEvent.class, + listener, CloseListener.closeMethod); + } + + /** + * Removes a close listener from the UI if it has previously been added with + * {@link #addListener(ClickListener)}. Otherwise, has no effect. + * + * @param listener + * The listener to remove. + */ + public void removeListener(CloseListener listener) { + removeListener(CloseEvent.CLOSE_EVENT_IDENTIFIER, CloseEvent.class, + listener); + } + @Override public boolean isConnectorEnabled() { - // TODO How can a Root be invisible? What does it mean? + // TODO How can a UI be invisible? What does it mean? return isVisible() && isEnabled(); } @@ -1069,7 +1150,7 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Setting the caption of a Root is not supported. To set the title of the + * Setting the caption of a UI is not supported. To set the title of the * HTML page, use Page.setTitle * * @deprecated as of 7.0.0, use {@link Page#setTitle(String)} @@ -1078,11 +1159,11 @@ public abstract class Root extends AbstractComponentContainer implements @Deprecated public void setCaption(String caption) { throw new IllegalStateException( - "You can not set the title of a Root. To set the title of the HTML page, use Page.setTitle"); + "You can not set the title of a UI. To set the title of the HTML page, use Page.setTitle"); } /** - * Shows a notification message on the middle of the root. The message + * Shows a notification message on the middle of the UI. The message * automatically disappears ("humanized message"). * * Care should be taken to to avoid XSS vulnerabilities as the caption is @@ -1105,7 +1186,7 @@ public abstract class Root extends AbstractComponentContainer implements } /** - * Shows a notification message the root. The position and behavior of the + * Shows a notification message the UI. The position and behavior of the * message depends on the type, which is one of the basic types defined in * {@link Notification}, for instance Notification.TYPE_WARNING_MESSAGE. * @@ -1132,8 +1213,8 @@ public abstract class Root extends AbstractComponentContainer implements /** * Shows a notification consisting of a bigger caption and a smaller - * description on the middle of the root. The message automatically - * disappears ("humanized message"). + * description on the middle of the UI. The message automatically disappears + * ("humanized message"). * * Care should be taken to to avoid XSS vulnerabilities as the caption and * description are rendered as html. @@ -1238,4 +1319,43 @@ public abstract class Root extends AbstractComponentContainer implements getPage().showNotification(notification); } + /** + * Returns the timestamp (milliseconds since the epoch) of the last received + * heartbeat for this UI. + * + * @see #heartbeat() + * @see Application#closeInactiveUIs() + * + * @return The time the last heartbeat request occurred. + */ + public long getLastHeartbeatTime() { + return lastHeartbeat; + } + + /** + * Returns the timestamp (milliseconds since the epoch) of the last received + * UIDL request for this UI. + * + * @return + */ + public long getLastUidlRequestTime() { + return lastUidlRequest; + } + + /** + * Sets the last heartbeat request timestamp for this UI. Called by the + * framework whenever the application receives a valid heartbeat request for + * this UI. + */ + public void setLastHeartbeatTime(long lastHeartbeat) { + this.lastHeartbeat = lastHeartbeat; + } + + /** + * Sets the last UIDL request timestamp for this UI. Called by the framework + * whenever the application receives a valid UIDL request for this UI. + */ + public void setLastUidlRequestTime(long lastUidlRequest) { + this.lastUidlRequest = lastUidlRequest; + } } diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index d79588cc63..6102350566 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -40,8 +40,8 @@ import com.vaadin.terminal.Vaadin6Component; /** * A component that represents a floating popup window that can be added to a - * {@link Root}. A window is added to a {@code Root} using - * {@link Root#addWindow(Window)}. </p> + * {@link UI}. A window is added to a {@code UI} using + * {@link UI#addWindow(Window)}. </p> * <p> * The contents of a window is set using {@link #setContent(ComponentContainer)} * or by using the {@link #Window(String, ComponentContainer)} constructor. The @@ -57,7 +57,7 @@ import com.vaadin.terminal.Vaadin6Component; * </p> * <p> * In Vaadin versions prior to 7.0.0, Window was also used as application level - * windows. This function is now covered by the {@link Root} class. + * windows. This function is now covered by the {@link UI} class. * </p> * * @author Vaadin Ltd. @@ -222,14 +222,14 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * </p> */ public void close() { - Root root = getRoot(); + UI uI = getUI(); - // Don't do anything if not attached to a root - if (root != null) { + // Don't do anything if not attached to a UI + if (uI != null) { // focus is restored to the parent window - root.focus(); - // subwindow is removed from the root - root.removeWindow(this); + uI.focus(); + // subwindow is removed from the UI + uI.removeWindow(this); } } @@ -470,22 +470,22 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * If there are currently several windows visible, calling this method makes * this window topmost. * <p> - * This method can only be called if this window connected a root. Else an + * This method can only be called if this window connected a UI. Else an * illegal state exception is thrown. Also if there are modal windows and * this window is not modal, and illegal state exception is thrown. * <p> */ public void bringToFront() { - Root root = getRoot(); - if (root == null) { + UI uI = getUI(); + if (uI == null) { throw new IllegalStateException( "Window must be attached to parent before calling bringToFront method."); } int maxBringToFront = -1; - for (Window w : root.getWindows()) { + for (Window w : uI.getWindows()) { if (!isModal() && w.isModal()) { throw new IllegalStateException( - "The root contains modal windows, non-modal window cannot be brought to front."); + "The UI contains modal windows, non-modal window cannot be brought to front."); } if (w.bringToFront != null) { maxBringToFront = Math.max(maxBringToFront, diff --git a/server/src/org/jsoup/select/Evaluator.java b/server/src/org/jsoup/select/Evaluator.java index 16a083bd77..bd0cee481d 100644 --- a/server/src/org/jsoup/select/Evaluator.java +++ b/server/src/org/jsoup/select/Evaluator.java @@ -18,7 +18,7 @@ public abstract class Evaluator { /** * Test if the element meets the evaluator's requirements. * - * @param root Root of the matching subtree + * @param root UI of the matching subtree * @param element tested element */ public abstract boolean matches(Element root, Element element); diff --git a/shared/src/com/vaadin/shared/ApplicationConstants.java b/shared/src/com/vaadin/shared/ApplicationConstants.java index 31e633a210..0bacd2d256 100644 --- a/shared/src/com/vaadin/shared/ApplicationConstants.java +++ b/shared/src/com/vaadin/shared/ApplicationConstants.java @@ -23,16 +23,14 @@ public class ApplicationConstants { public static final String UIDL_REQUEST_PATH = "UIDL/"; + public static final String HEARTBEAT_REQUEST_PATH = "HEARTBEAT/"; + public static final String CONNECTOR_RESOURCE_PREFIX = APP_REQUEST_PATH + "CONNECTOR"; public static final String APP_PROTOCOL_PREFIX = "app://"; public static final String CONNECTOR_PROTOCOL_PREFIX = "connector://"; public static final String UIDL_SECURITY_TOKEN_ID = "Vaadin-Security-Key"; - /** - * Name of the parameter used to transmit root ids back and forth - */ - public static final String ROOT_ID_PARAMETER = "rootId"; public static final String PARAM_UNLOADBURST = "onunloadburst"; diff --git a/shared/src/com/vaadin/shared/Version.java b/shared/src/com/vaadin/shared/Version.java index 9320698318..16f466fc6e 100644 --- a/shared/src/com/vaadin/shared/Version.java +++ b/shared/src/com/vaadin/shared/Version.java @@ -47,10 +47,10 @@ public class Version implements Serializable { /* Initialize version numbers from string replaced by build-script. */ static { - if ("7.0.0.dev-20120816-12".equals("@" + "VERSION" + "@")) { + if ("@VERSION@".equals("@" + "VERSION" + "@")) { VERSION = "9.9.9.INTERNAL-DEBUG-BUILD"; } else { - VERSION = "7.0.0.dev-20120816-12"; + VERSION = "@VERSION@"; } final String[] digits = VERSION.split("\\.", 4); VERSION_MAJOR = Integer.parseInt(digits[0]); diff --git a/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java b/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java new file mode 100644 index 0000000000..0ac16ecea9 --- /dev/null +++ b/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java @@ -0,0 +1,25 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.shared.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; + +@Target({ ElementType.METHOD, ElementType.FIELD }) +public @interface DelegateToWidget { + public String value() default ""; + + public static class Helper { + public static String getDelegateTarget(String propertyName, + String annotationValue) { + String name = annotationValue; + if (name.isEmpty()) { + name = "set" + Character.toUpperCase(propertyName.charAt(0)) + + propertyName.substring(1); + } + return name; + } + } +} diff --git a/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java b/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java new file mode 100644 index 0000000000..96b785edd0 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java @@ -0,0 +1,27 @@ +package com.vaadin.shared.ui; + +import com.vaadin.shared.ComponentState; +import com.vaadin.shared.communication.URLReference; + +public class AbstractEmbeddedState extends ComponentState { + + protected URLReference source; + protected String alternateText; + + public URLReference getSource() { + return source; + } + + public void setSource(URLReference source) { + this.source = source; + } + + public String getAlternateText() { + return alternateText; + } + + public void setAlternateText(String alternateText) { + this.alternateText = alternateText; + } + +} diff --git a/shared/src/com/vaadin/shared/ui/AbstractMediaState.java b/shared/src/com/vaadin/shared/ui/AbstractMediaState.java index 2731529caf..80d41dd797 100644 --- a/shared/src/com/vaadin/shared/ui/AbstractMediaState.java +++ b/shared/src/com/vaadin/shared/ui/AbstractMediaState.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.List; import com.vaadin.shared.ComponentState; +import com.vaadin.shared.annotations.DelegateToWidget; import com.vaadin.shared.communication.URLReference; public class AbstractMediaState extends ComponentState { @@ -39,6 +40,7 @@ public class AbstractMediaState extends ComponentState { return showControls; } + @DelegateToWidget("setControls") public void setShowControls(boolean showControls) { this.showControls = showControls; } @@ -63,6 +65,7 @@ public class AbstractMediaState extends ComponentState { return autoplay; } + @DelegateToWidget public void setAutoplay(boolean autoplay) { this.autoplay = autoplay; } @@ -71,6 +74,7 @@ public class AbstractMediaState extends ComponentState { return muted; } + @DelegateToWidget public void setMuted(boolean muted) { this.muted = muted; } diff --git a/shared/src/com/vaadin/shared/ui/embeddedbrowser/EmbeddedBrowserState.java b/shared/src/com/vaadin/shared/ui/embeddedbrowser/EmbeddedBrowserState.java new file mode 100644 index 0000000000..cca47176a3 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/embeddedbrowser/EmbeddedBrowserState.java @@ -0,0 +1,7 @@ +package com.vaadin.shared.ui.embeddedbrowser; + +import com.vaadin.shared.ui.AbstractEmbeddedState; + +public class EmbeddedBrowserState extends AbstractEmbeddedState { + +} diff --git a/shared/src/com/vaadin/shared/ui/flash/FlashState.java b/shared/src/com/vaadin/shared/ui/flash/FlashState.java new file mode 100644 index 0000000000..2d33d1a711 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/flash/FlashState.java @@ -0,0 +1,68 @@ +package com.vaadin.shared.ui.flash; + +import java.util.Map; + +import com.vaadin.shared.ui.AbstractEmbeddedState; + +public class FlashState extends AbstractEmbeddedState { + + protected String classId; + + protected String codebase; + + protected String codetype; + + protected String archive; + + protected String standby; + + protected Map<String, String> embedParams; + + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public String getCodebase() { + return codebase; + } + + public void setCodebase(String codeBase) { + codebase = codebase; + } + + public String getCodetype() { + return codetype; + } + + public void setCodetype(String codetype) { + this.codetype = codetype; + } + + public String getArchive() { + return archive; + } + + public void setArchive(String archive) { + this.archive = archive; + } + + public String getStandby() { + return standby; + } + + public void setStandby(String standby) { + this.standby = standby; + } + + public Map<String, String> getEmbedParams() { + return embedParams; + } + + public void setEmbedParams(Map<String, String> embedParams) { + this.embedParams = embedParams; + } +} diff --git a/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java b/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java new file mode 100644 index 0000000000..aa48f10e5b --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java @@ -0,0 +1,8 @@ +package com.vaadin.shared.ui.image; + +import com.vaadin.shared.communication.ServerRpc; +import com.vaadin.shared.ui.ClickRpc; + +public interface ImageServerRpc extends ClickRpc, ServerRpc { + +} diff --git a/shared/src/com/vaadin/shared/ui/image/ImageState.java b/shared/src/com/vaadin/shared/ui/image/ImageState.java new file mode 100644 index 0000000000..4296c76847 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/image/ImageState.java @@ -0,0 +1,7 @@ +package com.vaadin.shared.ui.image; + +import com.vaadin.shared.ui.AbstractEmbeddedState; + +public class ImageState extends AbstractEmbeddedState { + +} diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java b/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java new file mode 100644 index 0000000000..d130550946 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java @@ -0,0 +1,5 @@ +package com.vaadin.shared.ui.slider; + +public enum SliderOrientation { + HORIZONTAL, VERTICAL; +} diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java b/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java new file mode 100644 index 0000000000..6ea02f0a95 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java @@ -0,0 +1,14 @@ +package com.vaadin.shared.ui.slider; + +import com.vaadin.shared.communication.ServerRpc; + +public interface SliderServerRpc extends ServerRpc { + + /** + * Invoked when the value of a variable has changed. Slider listeners are + * notified if the slider value has changed. + * + * @param value + */ + public void valueChanged(double value); +} diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderState.java b/shared/src/com/vaadin/shared/ui/slider/SliderState.java new file mode 100644 index 0000000000..98168b80af --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/slider/SliderState.java @@ -0,0 +1,60 @@ +package com.vaadin.shared.ui.slider; + +import com.vaadin.shared.AbstractFieldState; + +public class SliderState extends AbstractFieldState { + + protected double value; + + protected double maxValue; + protected double minValue; + + /** + * The number of fractional digits that are considered significant. Must be + * non-negative. + */ + protected int resolution; + + protected SliderOrientation orientation; + + public double getValue() { + return value; + } + + public void setValue(double value) { + this.value = value; + } + + public double getMaxValue() { + return maxValue; + } + + public void setMaxValue(double maxValue) { + this.maxValue = maxValue; + } + + public double getMinValue() { + return minValue; + } + + public void setMinValue(double minValue) { + this.minValue = minValue; + } + + public int getResolution() { + return resolution; + } + + public void setResolution(int resolution) { + this.resolution = resolution; + } + + public SliderOrientation getOrientation() { + return orientation; + } + + public void setOrientation(SliderOrientation orientation) { + this.orientation = orientation; + } + +} diff --git a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java index 46eb851edd..71f789b70d 100644 --- a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java +++ b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java @@ -19,6 +19,7 @@ import java.io.Serializable; import com.vaadin.shared.ComponentState; import com.vaadin.shared.Connector; +import com.vaadin.shared.annotations.DelegateToWidget; public class AbstractSplitPanelState extends ComponentState { @@ -120,6 +121,7 @@ public class AbstractSplitPanelState extends ComponentState { return positionReversed; } + @DelegateToWidget public void setPositionReversed(boolean positionReversed) { this.positionReversed = positionReversed; } @@ -128,6 +130,7 @@ public class AbstractSplitPanelState extends ComponentState { return locked; } + @DelegateToWidget public void setLocked(boolean locked) { this.locked = locked; } diff --git a/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java b/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java index 31cec77554..50dc1393a3 100644 --- a/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java +++ b/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java @@ -15,6 +15,7 @@ */ package com.vaadin.shared.ui.textarea; +import com.vaadin.shared.annotations.DelegateToWidget; import com.vaadin.shared.ui.textfield.AbstractTextFieldState; public class TextAreaState extends AbstractTextFieldState { @@ -33,6 +34,7 @@ public class TextAreaState extends AbstractTextFieldState { return rows; } + @DelegateToWidget public void setRows(int rows) { this.rows = rows; } @@ -41,6 +43,7 @@ public class TextAreaState extends AbstractTextFieldState { return wordwrap; } + @DelegateToWidget public void setWordwrap(boolean wordwrap) { this.wordwrap = wordwrap; } diff --git a/shared/src/com/vaadin/shared/ui/root/PageClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java index b7d9419057..a3cbc10cf6 100644 --- a/shared/src/com/vaadin/shared/ui/root/PageClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java @@ -14,7 +14,7 @@ * the License. */ -package com.vaadin.shared.ui.root; +package com.vaadin.shared.ui.ui; import com.vaadin.shared.communication.ClientRpc; diff --git a/shared/src/com/vaadin/shared/ui/root/RootConstants.java b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java index 34c17ac71f..76413628a4 100644 --- a/shared/src/com/vaadin/shared/ui/root/RootConstants.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java @@ -13,9 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.shared.ui.root; +package com.vaadin.shared.ui.ui; -public class RootConstants { +public class UIConstants { /** * Attribute name for the lazy resize setting . */ @@ -41,4 +41,9 @@ public class RootConstants { @Deprecated public static final String ATTRIBUTE_NOTIFICATION_DELAY = "delay"; + /** + * Name of the parameter used to transmit UI ids back and forth + */ + public static final String UI_ID_PARAMETER = "uiId"; + } diff --git a/shared/src/com/vaadin/shared/ui/root/RootServerRpc.java b/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java index df2031f7d5..ef28a12415 100644 --- a/shared/src/com/vaadin/shared/ui/root/RootServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java @@ -13,13 +13,13 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.shared.ui.root; +package com.vaadin.shared.ui.ui; import com.vaadin.shared.annotations.Delayed; import com.vaadin.shared.communication.ServerRpc; import com.vaadin.shared.ui.ClickRpc; -public interface RootServerRpc extends ClickRpc, ServerRpc { +public interface UIServerRpc extends ClickRpc, ServerRpc { @Delayed(lastonly = true) public void resize(int viewWidth, int viewHeight, int windowWidth, int windowHeight); diff --git a/shared/src/com/vaadin/shared/ui/root/RootState.java b/shared/src/com/vaadin/shared/ui/ui/UIState.java index b7c2c88ce5..01426bd8f3 100644 --- a/shared/src/com/vaadin/shared/ui/root/RootState.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIState.java @@ -13,12 +13,12 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.vaadin.shared.ui.root; +package com.vaadin.shared.ui.ui; import com.vaadin.shared.ComponentState; import com.vaadin.shared.Connector; -public class RootState extends ComponentState { +public class UIState extends ComponentState { private Connector content; public Connector getContent() { diff --git a/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java b/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java index 7775b667a1..3738da3c5c 100644 --- a/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java +++ b/tests/client-side/com/vaadin/terminal/gwt/server/JSONSerializerTest.java @@ -52,7 +52,7 @@ public class JSONSerializerTest extends TestCase { stringToStateMap.put("String - state 2", s2); Object encodedMap = JsonCodec.encode(stringToStateMap, null, mapType, - null); + null).getEncodedValue(); ensureDecodedCorrectly(stringToStateMap, encodedMap, mapType); } @@ -69,7 +69,7 @@ public class JSONSerializerTest extends TestCase { stateToStringMap.put(s2, "String - state 2"); Object encodedMap = JsonCodec.encode(stateToStringMap, null, mapType, - null); + null).getEncodedValue(); ensureDecodedCorrectly(stateToStringMap, encodedMap, mapType); } diff --git a/tests/server-side/com/vaadin/tests/VaadinClasses.java b/tests/server-side/com/vaadin/tests/VaadinClasses.java index 2f937bf58d..5d9e38398c 100644 --- a/tests/server-side/com/vaadin/tests/VaadinClasses.java +++ b/tests/server-side/com/vaadin/tests/VaadinClasses.java @@ -24,7 +24,7 @@ import com.vaadin.ui.Field; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.LoginForm; import com.vaadin.ui.PopupView; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.VerticalSplitPanel; import com.vaadin.ui.Window; import com.vaadin.ui.themes.BaseTheme; @@ -107,7 +107,7 @@ public class VaadinClasses { classes.remove(DragAndDropWrapper.class); classes.remove(CustomComponent.class); classes.remove(LoginForm.class); - classes.remove(Root.class); + classes.remove(UI.class); return classes; } diff --git a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java index ca1bb45330..5ea4bc52c4 100644 --- a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java +++ b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java @@ -8,7 +8,7 @@ import com.vaadin.Application; import com.vaadin.terminal.StreamVariable; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.gwt.server.CommunicationManager; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Upload; public class TestStreamVariableMapping extends TestCase { @@ -22,7 +22,7 @@ public class TestStreamVariableMapping extends TestCase { @Override protected void setUp() throws Exception { final Application application = new Application(); - final Root root = new Root() { + final UI uI = new UI() { @Override protected void init(WrappedRequest request) { // TODO Auto-generated method stub @@ -36,8 +36,8 @@ public class TestStreamVariableMapping extends TestCase { }; owner = new Upload() { @Override - public Root getRoot() { - return root; + public UI getUI() { + return uI; } }; streamVariable = EasyMock.createMock(StreamVariable.class); diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java index f66f523770..3a251ecbb9 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java @@ -10,7 +10,7 @@ import com.vaadin.data.util.AbstractProperty; import com.vaadin.data.util.converter.Converter.ConversionException; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class RemoveListenersOnDetach { @@ -18,7 +18,7 @@ public class RemoveListenersOnDetach { int numReadOnlyChanges = 0; AbstractField field = new AbstractField() { - private Root root = new Root() { + private UI uI = new UI() { @Override protected void init(WrappedRequest request) { @@ -49,8 +49,8 @@ public class RemoveListenersOnDetach { } @Override - public com.vaadin.ui.Root getRoot() { - return root; + public com.vaadin.ui.UI getUI() { + return uI; }; @Override diff --git a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java b/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java index 74770f8652..9b4d9492a2 100644 --- a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java +++ b/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java @@ -10,18 +10,18 @@ import org.easymock.EasyMock; import com.vaadin.Application; import com.vaadin.Application.ApplicationStartEvent; -import com.vaadin.RootRequiresMoreInformationException; -import com.vaadin.terminal.DefaultRootProvider; +import com.vaadin.UIRequiresMoreInformationException; +import com.vaadin.terminal.DefaultUIProvider; import com.vaadin.terminal.DeploymentConfiguration; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; -public class CustomRootClassLoader extends TestCase { +public class CustomUIClassLoader extends TestCase { /** * Stub root */ - public static class MyRoot extends Root { + public static class MyUI extends UI { @Override protected void init(WrappedRequest request) { // Nothing to see here @@ -45,7 +45,7 @@ public class CustomRootClassLoader extends TestCase { } /** - * Tests that a Root class can be loaded even if no classloader has been + * Tests that a UI class can be loaded even if no classloader has been * provided. * * @throws Exception @@ -56,8 +56,8 @@ public class CustomRootClassLoader extends TestCase { application.start(new ApplicationStartEvent(null, createConfigurationMock(), null)); - Root root = application.getRootForRequest(createRequestMock(null)); - assertTrue(root instanceof MyRoot); + UI uI = application.getUIForRequest(createRequestMock(null)); + assertTrue(uI instanceof MyUI); } private static DeploymentConfiguration createConfigurationMock() { @@ -89,7 +89,7 @@ public class CustomRootClassLoader extends TestCase { /** * Tests that the ClassLoader passed in the ApplicationStartEvent is used to - * load Root classes. + * load UI classes. * * @throws Exception * if thrown @@ -101,11 +101,11 @@ public class CustomRootClassLoader extends TestCase { application.start(new ApplicationStartEvent(null, createConfigurationMock(), null)); - Root root = application - .getRootForRequest(createRequestMock(loggingClassLoader)); - assertTrue(root instanceof MyRoot); + UI uI = application + .getUIForRequest(createRequestMock(loggingClassLoader)); + assertTrue(uI instanceof MyUI); assertEquals(1, loggingClassLoader.requestedClasses.size()); - assertEquals(MyRoot.class.getName(), + assertEquals(MyUI.class.getName(), loggingClassLoader.requestedClasses.get(0)); } @@ -113,24 +113,24 @@ public class CustomRootClassLoader extends TestCase { private Application createStubApplication() { return new Application() { { - addRootProvider(new DefaultRootProvider()); + addUIProvider(new DefaultUIProvider()); } @Override public String getProperty(String name) { - if (name.equals(ROOT_PARAMETER)) { - return MyRoot.class.getName(); + if (name.equals(UI_PARAMETER)) { + return MyUI.class.getName(); } else { return super.getProperty(name); } } @Override - public Root getRootForRequest(WrappedRequest request) - throws RootRequiresMoreInformationException { + public UI getUIForRequest(WrappedRequest request) + throws UIRequiresMoreInformationException { // Always create a new root for testing (can't directly use // getRoot as it's protected) - return getRoot(request); + return getUI(request); } }; } diff --git a/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java b/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java index f8901803c3..88bc28bbc8 100644 --- a/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java +++ b/tests/server-side/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java @@ -7,8 +7,8 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; import com.vaadin.Application; -import com.vaadin.ui.Root; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; public class AddRemoveSubWindow { @@ -27,7 +27,7 @@ public class AddRemoveSubWindow { TestApp app = new TestApp(); app.init(); Window subWindow = new Window("Sub window"); - Root mainWindow = app.getMainWindow(); + UI mainWindow = app.getMainWindow(); mainWindow.addWindow(subWindow); // Added to main window so the parent of the sub window should be the @@ -61,7 +61,7 @@ public class AddRemoveSubWindow { TestApp app = new TestApp(); app.init(); Window subWindow = new Window("Sub window"); - Root mainWindow = app.getMainWindow(); + UI mainWindow = app.getMainWindow(); mainWindow.addWindow(subWindow); // Added to main window so the parent of the sub window should be the diff --git a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java index e1435ea2ab..2a0a733140 100644 --- a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java +++ b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java @@ -8,7 +8,7 @@ import org.junit.Test; import com.vaadin.Application; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; @@ -100,12 +100,12 @@ public class AttachDetachWindow { } } - private class TestRoot extends Root implements TestContainer { + private class TestUI extends UI implements TestContainer { boolean rootAttachCalled = false; boolean rootDetachCalled = false; private TestContent testContent = new TestContent();; - public TestRoot() { + public TestUI() { setContent(testContent); } @@ -142,7 +142,7 @@ public class AttachDetachWindow { } } - TestRoot main = new TestRoot(); + TestUI main = new TestUI(); TestWindow sub = new TestWindow(); @Test diff --git a/tests/server-side/com/vaadin/tests/server/components/TestWindow.java b/tests/server-side/com/vaadin/tests/server/components/TestWindow.java index 7713f69f68..12d3a3c8f5 100644 --- a/tests/server-side/com/vaadin/tests/server/components/TestWindow.java +++ b/tests/server-side/com/vaadin/tests/server/components/TestWindow.java @@ -7,7 +7,7 @@ import junit.framework.TestCase; import org.easymock.EasyMock; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; import com.vaadin.ui.Window.CloseEvent; import com.vaadin.ui.Window.CloseListener; diff --git a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java index bb37082d30..8183ed2d0b 100644 --- a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -30,13 +30,13 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformationException; -import com.vaadin.terminal.AbstractRootProvider; +import com.vaadin.UIRequiresMoreInformationException; +import com.vaadin.terminal.AbstractUIProvider; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; import com.vaadin.terminal.gwt.server.WrappedHttpServletRequest; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; @SuppressWarnings("serial") public class ApplicationRunnerServlet extends AbstractApplicationServlet { @@ -110,15 +110,15 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet { // Creates a new application instance try { final Class<?> classToRun = getClassToRun(); - if (Root.class.isAssignableFrom(classToRun)) { + if (UI.class.isAssignableFrom(classToRun)) { Application application = new Application(); - application.addRootProvider(new AbstractRootProvider() { + application.addUIProvider(new AbstractUIProvider() { @Override - public Class<? extends Root> getRootClass( + public Class<? extends UI> getUIClass( Application application, WrappedRequest request) - throws RootRequiresMoreInformationException { - return (Class<? extends Root>) classToRun; + throws UIRequiresMoreInformationException { + return (Class<? extends UI>) classToRun; } }); return application; @@ -126,7 +126,7 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet { return (Application) classToRun.newInstance(); } else { throw new ServletException(classToRun.getCanonicalName() - + " is neither an Application nor a Root"); + + " is neither an Application nor a UI"); } } catch (final IllegalAccessException e) { throw new ServletException(e); @@ -215,13 +215,13 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet { protected Class<? extends Application> getApplicationClass() throws ClassNotFoundException { Class<?> classToRun = getClassToRun(); - if (Root.class.isAssignableFrom(classToRun)) { + if (UI.class.isAssignableFrom(classToRun)) { return Application.class; } else if (Application.class.isAssignableFrom(classToRun)) { return classToRun.asSubclass(Application.class); } else { throw new ClassCastException(classToRun.getCanonicalName() - + " is not an Application nor a Root"); + + " is not an Application nor a UI"); } } diff --git a/tests/testbench/com/vaadin/tests/Components.java b/tests/testbench/com/vaadin/tests/Components.java index f4fa1b6608..66e693a1de 100644 --- a/tests/testbench/com/vaadin/tests/Components.java +++ b/tests/testbench/com/vaadin/tests/Components.java @@ -25,7 +25,7 @@ import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.Embedded; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Tree; import com.vaadin.ui.Tree.ItemStyleGenerator; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java b/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java index ce99f6e70f..833340f678 100644 --- a/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java +++ b/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java @@ -26,7 +26,7 @@ import com.vaadin.ui.Field; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; import com.vaadin.ui.PasswordField; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.Tree; diff --git a/tests/testbench/com/vaadin/tests/LayoutDemo.java b/tests/testbench/com/vaadin/tests/LayoutDemo.java index 1a3801aecc..23997ac084 100644 --- a/tests/testbench/com/vaadin/tests/LayoutDemo.java +++ b/tests/testbench/com/vaadin/tests/LayoutDemo.java @@ -25,7 +25,7 @@ import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/ListenerOrder.java b/tests/testbench/com/vaadin/tests/ListenerOrder.java index 7f136b10ed..ab364a8781 100644 --- a/tests/testbench/com/vaadin/tests/ListenerOrder.java +++ b/tests/testbench/com/vaadin/tests/ListenerOrder.java @@ -13,7 +13,7 @@ import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Select; public class ListenerOrder extends com.vaadin.Application.LegacyApplication diff --git a/tests/testbench/com/vaadin/tests/ModalWindow.java b/tests/testbench/com/vaadin/tests/ModalWindow.java index 84fa761eb4..6153f14285 100644 --- a/tests/testbench/com/vaadin/tests/ModalWindow.java +++ b/tests/testbench/com/vaadin/tests/ModalWindow.java @@ -20,7 +20,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/NativeWindowing.java b/tests/testbench/com/vaadin/tests/NativeWindowing.java index 70f978a8b1..4bce92b668 100644 --- a/tests/testbench/com/vaadin/tests/NativeWindowing.java +++ b/tests/testbench/com/vaadin/tests/NativeWindowing.java @@ -24,7 +24,7 @@ import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; public class NativeWindowing extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/Parameters.java b/tests/testbench/com/vaadin/tests/Parameters.java index e9824d9c40..d6bc9007ed 100644 --- a/tests/testbench/com/vaadin/tests/Parameters.java +++ b/tests/testbench/com/vaadin/tests/Parameters.java @@ -30,7 +30,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Link; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java index 711e79a28d..0161a2a20e 100644 --- a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java +++ b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java @@ -29,7 +29,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Link; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Select; import com.vaadin.ui.TabSheet; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java b/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java index 9cd27e9d5c..7436bfc539 100644 --- a/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java +++ b/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java @@ -10,7 +10,7 @@ import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.OptionGroup; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/TestBench.java b/tests/testbench/com/vaadin/tests/TestBench.java index b58df225bc..32fff09455 100644 --- a/tests/testbench/com/vaadin/tests/TestBench.java +++ b/tests/testbench/com/vaadin/tests/TestBench.java @@ -37,7 +37,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Link; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java b/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java index 78ab9f61ca..c3fa269fba 100644 --- a/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java +++ b/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java @@ -19,7 +19,7 @@ package com.vaadin.tests; import com.vaadin.Application; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.VerticalSplitPanel; diff --git a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java index 628c3cc4e8..41b3309c57 100644 --- a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java +++ b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java @@ -24,7 +24,7 @@ import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; public class TestForNativeWindowing extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java index 120cf9a59a..af41ccc37b 100644 --- a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java +++ b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java @@ -36,7 +36,7 @@ import com.vaadin.ui.Layout; import com.vaadin.ui.Link; import com.vaadin.ui.Panel; import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Upload; import com.vaadin.ui.Upload.FailedEvent; import com.vaadin.ui.Upload.FailedListener; diff --git a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java index 621bdbfee2..3b5c7404e7 100644 --- a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java +++ b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java @@ -20,7 +20,7 @@ import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; public class TestForWindowOpen extends CustomComponent { @@ -37,7 +37,7 @@ public class TestForWindowOpen extends CustomComponent { public void buttonClick(ClickEvent event) { final ExternalResource r = new ExternalResource( "http://www.google.com"); - Root.getCurrent().getPage().open(r); + UI.getCurrent().getPage().open(r); } @@ -50,7 +50,7 @@ public class TestForWindowOpen extends CustomComponent { public void buttonClick(ClickEvent event) { final ExternalResource r = new ExternalResource( "http://www.google.com"); - Root.getCurrent().getPage().open(r, "mytarget"); + UI.getCurrent().getPage().open(r, "mytarget"); } @@ -63,7 +63,7 @@ public class TestForWindowOpen extends CustomComponent { public void buttonClick(ClickEvent event) { final ExternalResource r = new ExternalResource( "http://www.google.com"); - Root.getCurrent().getPage().open(r, "secondtarget"); + UI.getCurrent().getPage().open(r, "secondtarget"); } diff --git a/tests/testbench/com/vaadin/tests/TestForWindowing.java b/tests/testbench/com/vaadin/tests/TestForWindowing.java index 9a3362af8b..a59323b97c 100644 --- a/tests/testbench/com/vaadin/tests/TestForWindowing.java +++ b/tests/testbench/com/vaadin/tests/TestForWindowing.java @@ -26,7 +26,7 @@ import com.vaadin.ui.CheckBox; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Label; import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Select; import com.vaadin.ui.Slider; import com.vaadin.ui.VerticalLayout; @@ -99,7 +99,7 @@ public class TestForWindowing extends CustomComponent { w.addComponent(s); - Root.getCurrent().addWindow(w); + UI.getCurrent().addWindow(w); } diff --git a/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java b/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java index 5b3a93e065..6bb8bac200 100644 --- a/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java +++ b/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java @@ -21,7 +21,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class TestSetVisibleAndCaching extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java index f33132a709..a0ff6f0fc7 100644 --- a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java +++ b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java @@ -37,7 +37,7 @@ import com.vaadin.ui.Embedded; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/TestSplitPanel.java b/tests/testbench/com/vaadin/tests/TestSplitPanel.java index d1a6ede53c..4b0b47ed74 100644 --- a/tests/testbench/com/vaadin/tests/TestSplitPanel.java +++ b/tests/testbench/com/vaadin/tests/TestSplitPanel.java @@ -17,7 +17,7 @@ package com.vaadin.tests; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalSplitPanel; public class TestSplitPanel extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/TreeFilesystem.java b/tests/testbench/com/vaadin/tests/TreeFilesystem.java index b311ae32b1..f2a0d97b08 100644 --- a/tests/testbench/com/vaadin/tests/TreeFilesystem.java +++ b/tests/testbench/com/vaadin/tests/TreeFilesystem.java @@ -23,7 +23,7 @@ import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.util.SampleDirectory; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Tree; import com.vaadin.ui.Tree.ExpandEvent; diff --git a/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java b/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java index 52dd61dbee..672c518ea8 100644 --- a/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java +++ b/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java @@ -26,7 +26,7 @@ import com.vaadin.ui.Component.Listener; import com.vaadin.ui.Field; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/UpgradingSample.java b/tests/testbench/com/vaadin/tests/UpgradingSample.java index cf2516fbff..48e2222d7e 100644 --- a/tests/testbench/com/vaadin/tests/UpgradingSample.java +++ b/tests/testbench/com/vaadin/tests/UpgradingSample.java @@ -31,7 +31,7 @@ import com.vaadin.ui.CustomComponent; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java b/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java index 42a9d358c5..c5a836b4f1 100644 --- a/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java +++ b/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java @@ -24,7 +24,7 @@ import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Select; public class UsingObjectsInSelect extends diff --git a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java index fbf9e7b46e..9fa716a23e 100644 --- a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java +++ b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java @@ -12,7 +12,7 @@ import com.vaadin.ui.Embedded; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class GAESyncTest extends Application.LegacyApplication { @@ -93,8 +93,8 @@ public class GAESyncTest extends Application.LegacyApplication { @Override public void buttonClick(ClickEvent event) { - if (getRoot() == getMainWindow()) { - getRoot().getPage().showNotification( + if (getUI() == getMainWindow()) { + getUI().getPage().showNotification( new Notification("main")); try { Thread.sleep((5000)); diff --git a/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java b/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java index 690df3f360..2e6c188331 100644 --- a/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java +++ b/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java @@ -10,7 +10,7 @@ import com.vaadin.ui.FormLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.PasswordField; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java index bd2aea3756..1e6509ab85 100644 --- a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java +++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java @@ -1,34 +1,34 @@ package com.vaadin.tests.application; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformationException; -import com.vaadin.terminal.AbstractRootProvider; +import com.vaadin.UIRequiresMoreInformationException; +import com.vaadin.terminal.AbstractUIProvider; import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestApplication; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class RefreshStatePreserve extends AbstractTestApplication { - public static class RefreshStateRoot extends Root { + public static class RefreshStateUI extends UI { @Override public void init(WrappedRequest request) { getContent().addComponent( new Label("window.name: " + request.getBrowserDetails().getWindowName())); - getContent().addComponent(new Label("Root id: " + getRootId())); + getContent().addComponent(new Label("UI id: " + getUIId())); } } @Override public void init() { super.init(); - setRootPreserved(true); - addRootProvider(new AbstractRootProvider() { + setUiPreserved(true); + addUIProvider(new AbstractUIProvider() { @Override - public Class<? extends Root> getRootClass(Application application, + public Class<? extends UI> getUIClass(Application application, WrappedRequest request) - throws RootRequiresMoreInformationException { - return RefreshStateRoot.class; + throws UIRequiresMoreInformationException { + return RefreshStateUI.class; } }); } diff --git a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java index 77596da0f9..992a3afbca 100644 --- a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java +++ b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java @@ -19,7 +19,7 @@ import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class TerminalErrorNotification extends TestBase { @@ -41,7 +41,7 @@ public class TerminalErrorNotification extends TestBase { public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) { event.getThrowable().printStackTrace(); - Root mainWindow = getMainWindow(); + UI mainWindow = getMainWindow(); if (mainWindow != null) { Throwable throwable = event.getThrowable(); diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java index def68a7357..fa5ab7d100 100644 --- a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java @@ -1,7 +1,7 @@ package com.vaadin.tests.application; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.terminal.ApplicationResource; import com.vaadin.terminal.DownloadStream; import com.vaadin.terminal.PaintException; @@ -12,14 +12,14 @@ import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Embedded; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class ThreadLocalInstances extends AbstractTestApplication { private static final Application staticInitApplication = Application .getCurrent(); - private static final Root staticInitRoot = Root.getCurrent(); + private static final UI staticInitRoot = UI.getCurrent(); - private final Root mainWindow = new Root() { + private final UI mainWindow = new UI() { boolean paintReported = false; @Override @@ -77,14 +77,14 @@ public class ThreadLocalInstances extends AbstractTestApplication { } @Override - protected Root getRoot(WrappedRequest request) - throws RootRequiresMoreInformationException { + protected UI getUI(WrappedRequest request) + throws UIRequiresMoreInformationException { return mainWindow; } @Override protected String getTestDescription() { - return "Tests the precence of Application.getCurrentApplication() and Root.getCurrentRoot() from different contexts"; + return "Tests the precence of Application.getCurrentApplication() and UI.getCurrentRoot() from different contexts"; } @Override @@ -93,12 +93,12 @@ public class ThreadLocalInstances extends AbstractTestApplication { } private void reportCurrentStatus(String phase) { - reportStatus(phase, Application.getCurrent(), Root.getCurrent()); + reportStatus(phase, Application.getCurrent(), UI.getCurrent()); } - private void reportStatus(String phase, Application application, Root root) { + private void reportStatus(String phase, Application application, UI uI) { log.log(getState(application, this) + " app in " + phase); - log.log(getState(root, mainWindow) + " root in " + phase); + log.log(getState(uI, mainWindow) + " root in " + phase); } private static String getState(Object value, Object reference) { diff --git a/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java b/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java index abcdf232cd..3169806f27 100644 --- a/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java +++ b/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java @@ -6,7 +6,7 @@ import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class ChangeSessionId extends AbstractTestCase { diff --git a/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java b/tests/testbench/com/vaadin/tests/components/AbstractTestUI.java index d20f7a4a21..7dd742952f 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractTestUI.java @@ -8,10 +8,10 @@ import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext; import com.vaadin.terminal.gwt.server.WebBrowser; import com.vaadin.ui.Component; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; -public abstract class AbstractTestRoot extends Root { +public abstract class AbstractTestUI extends UI { @Override public void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/components/TestBase.java b/tests/testbench/com/vaadin/tests/components/TestBase.java index a66f0efe64..19c6826977 100644 --- a/tests/testbench/com/vaadin/tests/components/TestBase.java +++ b/tests/testbench/com/vaadin/tests/components/TestBase.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Component; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public abstract class TestBase extends AbstractTestCase { diff --git a/tests/testbench/com/vaadin/tests/components/TouchScrollables.java b/tests/testbench/com/vaadin/tests/components/TouchScrollables.java index 415f660c62..6c340804af 100644 --- a/tests/testbench/com/vaadin/tests/components/TouchScrollables.java +++ b/tests/testbench/com/vaadin/tests/components/TouchScrollables.java @@ -51,7 +51,7 @@ public class TouchScrollables extends TestBase { TestUtils .injectCSS( - getLayout().getRoot(), + getLayout().getUI(), "body * {-webkit-user-select: none;} .v-table-row-drag-middle .v-table-cell-content {" + " background-color: inherit ; border-bottom: 1px solid cyan;" + "}" @@ -81,7 +81,7 @@ public class TouchScrollables extends TestBase { new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { - getLayout().getRoot().scrollIntoView(l); + getLayout().getUI().scrollIntoView(l); } }); cssLayout.addComponent(button); diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java index 100c30cdc9..34655be91d 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java +++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java @@ -17,12 +17,12 @@ package com.vaadin.tests.components.abstractcomponent; import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.VaadinClasses; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Component; import com.vaadin.ui.GridLayout; -public class AllComponentTooltipTest extends AbstractTestRoot { +public class AllComponentTooltipTest extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java index f8931ecdea..e93529fad4 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java +++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java @@ -6,7 +6,7 @@ import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class EnableState extends AbstractTestCase { @Override diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java b/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java index bdabed3032..3a0afdce50 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components.button; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.themes.BaseTheme; diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java index c0490c127d..393a8ceb6b 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java @@ -25,7 +25,7 @@ public class ComboBoxInPopup extends TestBase { close.setClickShortcut(KeyCode.ESCAPE, null); w.addComponent(close); - getLayout().getRoot().addWindow(w); + getLayout().getUI().addWindow(w); } diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java index 5dc5a2efbd..10afb05ae3 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java @@ -8,7 +8,7 @@ import com.vaadin.data.util.IndexedContainer; import com.vaadin.ui.AbstractSelect; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; @SuppressWarnings("serial") diff --git a/tests/testbench/com/vaadin/tests/components/combobox/GridLayoutComboBoxZoomOut.java b/tests/testbench/com/vaadin/tests/components/combobox/GridLayoutComboBoxZoomOut.java index 37b0fe21a1..f64fd6f5fa 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/GridLayoutComboBoxZoomOut.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/GridLayoutComboBoxZoomOut.java @@ -5,7 +5,7 @@ import com.vaadin.ui.ComboBox; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Select; @SuppressWarnings("serial") @@ -13,7 +13,7 @@ public class GridLayoutComboBoxZoomOut extends AbstractTestCase { @Override public void init() { - Root.LegacyWindow mainWindow = new Root.LegacyWindow( + UI.LegacyWindow mainWindow = new UI.LegacyWindow( "Gridlayoutbug Application"); setMainWindow(mainWindow); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java index 85f1c80a08..4cf7b98679 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java @@ -13,7 +13,7 @@ import com.vaadin.ui.DefaultFieldFactory; import com.vaadin.ui.Field; import com.vaadin.ui.Form; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java index b87c458c01..ac3296724b 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java @@ -8,7 +8,7 @@ import com.vaadin.ui.Alignment; import com.vaadin.ui.DateField; import com.vaadin.ui.DateField.Resolution; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class DateFieldPopupOffScreen extends AbstractTestCase { diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java index 1bb3e7abe2..5091f3a929 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java @@ -38,6 +38,6 @@ public class EmbeddedApplet extends TestBase { Window window = new Window("Testwindow"); window.addComponent(new Label("I am inside the window")); - applet.getRoot().addWindow(window); + applet.getUI().addWindow(window); } } diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java index c3854d2420..252229cbe3 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java @@ -35,7 +35,7 @@ public class EmbeddedPdf extends TestBase { } })); - player.getRoot().addWindow(new Window("Testwindow")); + player.getUI().addWindow(new Window("Testwindow")); } } diff --git a/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.html b/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.html new file mode 100644 index 0000000000..2d76cd48b2 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.html @@ -0,0 +1,67 @@ +<?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>EmbeddedBrowserIsVisible</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">EmbeddedBrowserIsVisible</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.embeddedbrowser.EmbeddedBrowserIsVisible?restartApplication</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>show_initial</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>show_hello</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>show_lorem</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>show_alternative_text</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>show_lorem2</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java b/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java new file mode 100644 index 0000000000..fdf9405855 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java @@ -0,0 +1,112 @@ +package com.vaadin.tests.components.embeddedbrowser; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; + +import com.vaadin.terminal.StreamResource; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.EmbeddedBrowser; +import com.vaadin.ui.HorizontalLayout; + +public class EmbeddedBrowserIsVisible extends TestBase { + + @Override + protected void setup() { + + HorizontalLayout buttonLayout = new HorizontalLayout(); + addComponent(buttonLayout); + + Button page1 = new Button("Hello World"); + buttonLayout.addComponent(page1); + + Button page2 = new Button("Lorem ipsum"); + buttonLayout.addComponent(page2); + + Button page3 = new Button("null"); + buttonLayout.addComponent(page3); + + final EmbeddedBrowser browser = new EmbeddedBrowser(); + browser.setDebugId("browser"); + browser.setWidth("600px"); + browser.setHeight("300px"); + browser.setAlternateText("Browser alternative text"); + final TextSource textSource = new TextSource("initial"); + final StreamResource textResource = new StreamResource(textSource, + "initial.txt", this); + textResource.setMIMEType("text/plain"); + browser.setSource(textResource); + addComponent(browser); + + page1.addListener(new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + TextSource helloSource = new TextSource("Hello World"); + StreamResource helloResource = new StreamResource(helloSource, + "helloworld.txt", EmbeddedBrowserIsVisible.this); + helloResource.setMIMEType("text/plain"); + browser.setSource(helloResource); + } + }); + + page2.addListener(new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + TextSource helloSource = new TextSource("Lorem Ipsum"); + StreamResource helloResource = new StreamResource(helloSource, + "loremipsum.txt", EmbeddedBrowserIsVisible.this); + helloResource.setMIMEType("text/plain"); + browser.setSource(helloResource); + } + }); + + page3.addListener(new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + browser.setSource(null); + } + }); + } + + @Override + protected String getDescription() { + return "Embedded browser should be visible for all browsers"; + } + + @Override + protected Integer getTicketNumber() { + return null; + } + + public class TextSource implements StreamResource.StreamSource { + private String text; + + public TextSource(String text) { + this.text = text; + } + + public InputStream getStream() { + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 200; ++i) { + sb.append(text); + sb.append("\n"); + } + + ByteArrayInputStream istream; + try { + istream = new ByteArrayInputStream(sb.toString().getBytes( + "UTF-8")); + } catch (UnsupportedEncodingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + return istream; // new DownloadStream (istream,null,null); + + } + } + +} diff --git a/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.html b/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.html new file mode 100644 index 0000000000..82834cf405 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.html @@ -0,0 +1,33 @@ +<?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.components.flash.FlashIsVisible</td> + <td></td> +</tr> +<!--Allow the flash plugin to load before taking the screenshot--> +<tr> + <td>pause</td> + <td>5000</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.java b/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.java new file mode 100644 index 0000000000..66cb8819d4 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.java @@ -0,0 +1,31 @@ +package com.vaadin.tests.components.flash; + +import com.vaadin.terminal.ExternalResource; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Flash; + +public class FlashIsVisible extends TestBase { + + @Override + protected void setup() { + Flash player = new Flash(); + player.setWidth("400px"); + player.setHeight("300px"); + String url = "http://www.youtube.com/v/qQ9N742QB4g&autoplay=0"; + player.setSource(new ExternalResource(url)); + addComponent(player); + } + + @Override + protected String getDescription() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected Integer getTicketNumber() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/tests/testbench/com/vaadin/tests/components/flash/FlashPresentation.java b/tests/testbench/com/vaadin/tests/components/flash/FlashPresentation.java new file mode 100644 index 0000000000..843e61ace1 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/flash/FlashPresentation.java @@ -0,0 +1,33 @@ +package com.vaadin.tests.components.flash; + +import com.vaadin.terminal.ExternalResource; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Flash; + +public class FlashPresentation extends TestBase { + + @Override + protected String getDescription() { + return "The embedded flash should have the movie parameter set to \"someRandomValue\" and an allowFullScreen parameter set to \"true\"."; + } + + @Override + protected Integer getTicketNumber() { + return 3367; + } + + @Override + public void setup() { + Flash player = new Flash(); + player.setWidth("400px"); + player.setHeight("300px"); + String url = "http://www.youtube.com/v/qQ9N742QB4g&autoplay=1"; + player.setSource(new ExternalResource(url)); + player.setParameter("movie", "someRandomValue"); + player.setParameter("allowFullScreen", "true"); + player.setAlternateText("Flash alternative text"); + + addComponent(player); + } + +} diff --git a/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java b/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java index 21430d8936..b34db2170e 100644 --- a/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java +++ b/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.Form; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; @SuppressWarnings("serial") diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java index 184f8a9261..a73c88cf73 100644 --- a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java +++ b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java @@ -16,11 +16,11 @@ package com.vaadin.tests.components.formlayout; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.FormLayout; import com.vaadin.ui.PopupDateField; -public class FormLayoutErrorHover extends AbstractTestRoot { +public class FormLayoutErrorHover extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java b/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java index bbe88b1770..360c559086 100644 --- a/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java +++ b/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.formlayout; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.FormLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/components/image/ImageAltText.html b/tests/testbench/com/vaadin/tests/components/image/ImageAltText.html new file mode 100644 index 0000000000..743aa5caaf --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/image/ImageAltText.html @@ -0,0 +1,42 @@ +<?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>ImageAltText</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">ImageAltText</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.image.ImageAltText?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentsimageImageAltText::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]@alt</td> + <td>Original alt text</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsimageImageAltText::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentsimageImageAltText::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]@alt</td> + <td>New alt text!</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>image_alt_text</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/image/ImageAltText.java b/tests/testbench/com/vaadin/tests/components/image/ImageAltText.java new file mode 100644 index 0000000000..1f787fd64f --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/image/ImageAltText.java @@ -0,0 +1,38 @@ +package com.vaadin.tests.components.image; + +import com.vaadin.terminal.ThemeResource; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Image; + +public class ImageAltText extends TestBase { + + @Override + protected void setup() { + final Image image = new Image("Caption", new ThemeResource( + "../runo/icons/64/ok.png")); + image.setDebugId("image"); + image.setAlternateText("Original alt text"); + addComponent(image); + + Button changeAltTexts = new Button("Change alt text", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + image.setAlternateText("New alt text!"); + } + }); + addComponent(changeAltTexts); + } + + @Override + protected String getDescription() { + return "Test alternative text of image"; + } + + @Override + protected Integer getTicketNumber() { + return null; + } + +} diff --git a/tests/testbench/com/vaadin/tests/components/image/ImageClicks.html b/tests/testbench/com/vaadin/tests/components/image/ImageClicks.html new file mode 100644 index 0000000000..14afaab98d --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/image/ImageClicks.html @@ -0,0 +1,57 @@ +<?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>ImageClicks</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">ImageClicks</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.image.ImageClicks?restartApplication</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>0_clicks</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsimageImageClicks::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]</td> + <td>129,107</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>1_click</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsimageImageClicks::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]</td> + <td>129,107</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>2_clicks</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsimageImageClicks::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]</td> + <td>273,273</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>3_clicks</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/image/ImageClicks.java b/tests/testbench/com/vaadin/tests/components/image/ImageClicks.java new file mode 100644 index 0000000000..394e38a106 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/image/ImageClicks.java @@ -0,0 +1,133 @@ +package com.vaadin.tests.components.image; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; + +import javax.imageio.ImageIO; + +import com.vaadin.event.MouseEvents.ClickEvent; +import com.vaadin.event.MouseEvents.ClickListener; +import com.vaadin.terminal.StreamResource; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Image; +import com.vaadin.ui.Label; + +public class ImageClicks extends TestBase { + + private int clickCounter = 0; + + @Override + protected void setup() { + + final Label label = new Label(labelText()); + addComponent(label); + + Image image = new Image(); + final MyImageSource imageSource = new MyImageSource(); + final StreamResource imageResource = new StreamResource(imageSource, + "testimage.png", this); + image.setSource(imageResource); + image.addListener(new ClickListener() { + + public void click(ClickEvent event) { + ++clickCounter; + label.setValue(labelText()); + } + + }); + addComponent(image); + + } + + private String labelText() { + StringBuilder sb = new StringBuilder(); + sb.append("Image clicked "); + sb.append(clickCounter); + sb.append(" times."); + return sb.toString(); + } + + @Override + protected String getDescription() { + return "Test click event handling of images"; + } + + @Override + protected Integer getTicketNumber() { + return null; + } + + public class MyImageSource implements StreamResource.StreamSource { + public MyImageSource() { + } + + int intervalPos(int pos, int resolution, int cells) { + return (int) Math.round(pos * resolution / (cells * 1.0)); + } + + public InputStream getStream() { + // Create an image and draw some background on it. + BufferedImage image = new BufferedImage(300, 300, + BufferedImage.TYPE_INT_RGB); + Graphics drawable = image.getGraphics(); + + // Background + drawable.setColor(Color.white); + drawable.fillRect(0, 0, 300, 300); + + final int rows = 4; + final int cols = 4; + + // Grid + for (int row = 0; row < rows; row++) { + int gridy = intervalPos(row, 300, rows); + int gridynext = intervalPos(row + 1, 300, rows); + + // Horizontal grid line + if (row > 0) { + drawable.setColor(Color.lightGray); + drawable.drawLine(0, gridy, 300 - 1, gridy); + } + + for (int col = 0; col < cols; col++) { + int gridx = intervalPos(col, 300, cols); + int gridxnext = intervalPos(col + 1, 300, cols); + + // Vertical grid line + if (row == 0 && col > 0) { + drawable.setColor(Color.lightGray); + drawable.drawLine(gridx, 0, gridx, 300 - 1); + } + + // Cell + if (Math.random() < 0.5f) { + drawable.setColor(Color.white); + } else { + drawable.setColor(Color.black); + } + drawable.fillRect(gridx + 1, gridy + 1, gridxnext - gridx + - 1, gridynext - gridy - 1); + } + } + + try { + // Write the image to a buffer. + ByteArrayOutputStream imagebuffer = new ByteArrayOutputStream(); + ImageIO.write(image, "png", imagebuffer); + + // Return a stream from the buffer. + ByteArrayInputStream istream = new ByteArrayInputStream( + imagebuffer.toByteArray()); + return istream; // new DownloadStream (istream,null,null); + } catch (IOException e) { + return null; + } + } + + } +} diff --git a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java index 0b732e5948..a0df85a5b3 100644 --- a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java +++ b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java @@ -29,13 +29,13 @@ import com.vaadin.shared.ui.JavaScriptComponentState; import com.vaadin.terminal.ClassResource; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.gwt.server.ResourceReference; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; import com.vaadin.ui.AbstractJavaScriptComponent; import com.vaadin.ui.HasComponents; import com.vaadin.ui.JavaScriptFunction; -public class BasicJavaScriptComponent extends AbstractTestRoot { +public class BasicJavaScriptComponent extends AbstractTestUI { public interface TestRpc extends ServerRpc, ClientRpc { public void sendRpc(String message); diff --git a/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java b/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java index b1cf2957be..18d3b1e8ed 100644 --- a/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java +++ b/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.label; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbstractLayout; import com.vaadin.ui.Accordion; import com.vaadin.ui.GridLayout; @@ -10,7 +10,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; -public class MarginsInLabels extends AbstractTestRoot { +public class MarginsInLabels extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormUIInLoginHandler.html b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormUIInLoginHandler.html new file mode 100755 index 0000000000..9a80ce6013 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormUIInLoginHandler.html @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://arturwin.office.itmill.com:8888/" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.loginform.LoginFormUIInLoginHandler?restartApplication</td> + <td></td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>username</td> + <td></td> +</tr> +<tr> + <td>enterCharacter</td> + <td>username</td> + <td>abc</td> +</tr> +<tr> + <td>enterCharacter</td> + <td>password</td> + <td>def</td> +</tr> +<tr> + <td>click</td> + <td>//form[@id='loginf']/div[5]/div/span/span</td> + <td></td> +</tr> +<tr> + <td>pauseAndWait</td> + <td>1000</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentsloginformLoginFormUIInLoginHandler::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td> + <td>UI.getCurrent().data: This UI</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentsloginformLoginFormUIInLoginHandler::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td> + <td>event.getSource().data: This UI</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormUIInLoginHandler.java index 2c0a8744fc..b3ebb02751 100755 --- a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java +++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormUIInLoginHandler.java @@ -5,9 +5,9 @@ import com.vaadin.ui.Label; import com.vaadin.ui.LoginForm;
import com.vaadin.ui.LoginForm.LoginEvent;
import com.vaadin.ui.LoginForm.LoginListener;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
-public class LoginFormRootInLoginHandler extends TestBase {
+public class LoginFormUIInLoginHandler extends TestBase {
@Override
protected void setup() {
@@ -16,14 +16,14 @@ public class LoginFormRootInLoginHandler extends TestBase { @Override
public void onLogin(LoginEvent event) {
- Root r1 = Root.getCurrent();
+ UI r1 = UI.getCurrent();
if (r1 != null) {
- addComponent(new Label("Root.getCurrent().data: "
+ addComponent(new Label("UI.getCurrent().data: "
+ r1.getData()));
} else {
- addComponent(new Label("Root.getCurrent() is null"));
+ addComponent(new Label("UI.getCurrent() is null"));
}
- Root r2 = ((LoginForm) event.getSource()).getRoot();
+ UI r2 = ((LoginForm) event.getSource()).getUI();
if (r2 != null) {
addComponent(new Label("event.getSource().data: "
+ r2.getData()));
@@ -34,7 +34,7 @@ public class LoginFormRootInLoginHandler extends TestBase { }
});
addComponent(lf);
- getLayout().getRoot().setData("This root");
+ getLayout().getUI().setData("This UI");
}
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java index 83f89f0214..480c186df7 100644 --- a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java +++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java @@ -5,14 +5,14 @@ import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.LoginForm; import com.vaadin.ui.LoginForm.LoginEvent; import com.vaadin.ui.LoginForm.LoginListener; -import com.vaadin.ui.Root; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI; +import com.vaadin.ui.UI.LegacyWindow; @SuppressWarnings("serial") public class LoginFormWithMultipleWindows extends Application { @Override - protected Root getRoot(WrappedRequest request) { + protected UI getUI(WrappedRequest request) { return new LoginFormWindow(); } diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java index 2a6f952c0a..59aebd0bd7 100644 --- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java +++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java @@ -4,7 +4,7 @@ import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Label; import com.vaadin.ui.MenuBar; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java index 33e6c0b4a9..2c4a975f9b 100644 --- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java +++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java @@ -4,7 +4,7 @@ import com.vaadin.terminal.ThemeResource; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Alignment; import com.vaadin.ui.MenuBar; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class MenuBarRunsOutOfBrowser extends AbstractTestCase { diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java index aeae09e7b9..a10e69e188 100644 --- a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java +++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java @@ -9,7 +9,7 @@ import com.vaadin.annotations.Theme; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.TestUtils; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Alignment; @@ -22,57 +22,58 @@ import com.vaadin.ui.NativeSelect; import com.vaadin.ui.VerticalLayout; @Theme("tests-components") -public class OrderedLayoutCases extends AbstractTestRoot { +public class OrderedLayoutCases extends AbstractTestUI { + private static final String[] dimensionValues = { "-1px", "5px", "350px", - "800px", "100%", "50%" }; + "800px", "100%", "50%" }; private static class SampleChild extends VerticalLayout { public SampleChild() { setStyleName("sampleChild"); addComponent(createSimpleSelector("Child width", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - setWidth(event.getProperty().getValue().toString()); - } - }, dimensionValues)); + @Override + public void valueChange(ValueChangeEvent event) { + setWidth(event.getProperty().getValue().toString()); + } + }, dimensionValues)); addComponent(createSimpleSelector("Child height", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - setHeight(event.getProperty().getValue().toString()); - } - }, dimensionValues)); + @Override + public void valueChange(ValueChangeEvent event) { + setHeight(event.getProperty().getValue().toString()); + } + }, dimensionValues)); addComponent(createSimpleSelector("Caption", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - String value = event.getProperty().getValue() - .toString(); - if (value.length() == 0) { - setCaption(null); - } else if (value.equals("Long")) { - setCaption("A rather long caption just to see what happens"); - } else { - setCaption(value); - } - } - }, "", "Short", "Long")); + @Override + public void valueChange(ValueChangeEvent event) { + String value = event.getProperty().getValue() + .toString(); + if (value.length() == 0) { + setCaption(null); + } else if (value.equals("Long")) { + setCaption("A rather long caption just to see what happens"); + } else { + setCaption(value); + } + } + }, "", "Short", "Long")); addComponent(createSimpleSelector("Expand ratio", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - AbstractOrderedLayout parent = (AbstractOrderedLayout) getParent(); - if (parent == null) { - return; - } - String value = event.getProperty().getValue() - .toString(); - parent.setExpandRatio(SampleChild.this, - Float.parseFloat(value)); - } - }, "0", "1", "2")); + @Override + public void valueChange(ValueChangeEvent event) { + AbstractOrderedLayout parent = (AbstractOrderedLayout) getParent(); + if (parent == null) { + return; + } + String value = event.getProperty().getValue() + .toString(); + parent.setExpandRatio(SampleChild.this, + Float.parseFloat(value)); + } + }, "0", "1", "2")); // Why is Alignment not an enum? Now we have to use reflection just // to get the different values as hardcoding is never an option! ;) @@ -85,29 +86,29 @@ public class OrderedLayoutCases extends AbstractTestRoot { } addComponent(createSimpleSelector("Alignment", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - String value = event.getProperty().getValue() - .toString(); - AlignmentHandler parent = (AlignmentHandler) getParent(); - if (parent == null) { - return; - } - try { - Field field = Alignment.class - .getDeclaredField(value); - Alignment alignment = (Alignment) field - .get(null); - parent.setComponentAlignment(SampleChild.this, - alignment); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }, alignmentValues, "TOP_LEFT")); // Sorry for not using - // more reflection magic - // just to find the - // default value... + @Override + public void valueChange(ValueChangeEvent event) { + String value = event.getProperty().getValue() + .toString(); + AlignmentHandler parent = (AlignmentHandler) getParent(); + if (parent == null) { + return; + } + try { + Field field = Alignment.class + .getDeclaredField(value); + Alignment alignment = (Alignment) field + .get(null); + parent.setComponentAlignment(SampleChild.this, + alignment); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, alignmentValues, "TOP_LEFT")); // Sorry for not using + // more reflection magic + // just to find the + // default value... } } @@ -118,12 +119,12 @@ public class OrderedLayoutCases extends AbstractTestRoot { @Override protected void setup(WrappedRequest request) { TestUtils - .injectCSS( - getRoot(), - ".sampleChild, .theLayout {border: 1px solid black;}" - + ".theLayout > div:first-child {background: aqua;}" - + ".theLayout > div:first-child + div {background: yellow;}" - + ".theLayout > div:first-child + div + div {background: lightgrey;}"); + .injectCSS( + getUI(), + ".sampleChild, .theLayout {border: 1px solid black;}" + + ".theLayout > div:first-child {background: aqua;}" + + ".theLayout > div:first-child + div {background: yellow;}" + + ".theLayout > div:first-child + div + div {background: lightgrey;}"); currentLayout = new HorizontalLayout(); for (int i = 0; i < 3; i++) { @@ -135,196 +136,196 @@ public class OrderedLayoutCases extends AbstractTestRoot { sizeBar.addComponent(createSimpleSelector("Layout width", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - currentLayout.setWidth(event.getProperty().getValue() - .toString()); - } - }, dimensionValues)); + @Override + public void valueChange(ValueChangeEvent event) { + currentLayout.setWidth(event.getProperty().getValue() + .toString()); + } + }, dimensionValues)); sizeBar.addComponent(createSimpleSelector("Layout height", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - currentLayout.setHeight(event.getProperty().getValue() - .toString()); - } - }, dimensionValues)); + @Override + public void valueChange(ValueChangeEvent event) { + currentLayout.setHeight(event.getProperty().getValue() + .toString()); + } + }, dimensionValues)); sizeBar.addComponent(createSimpleSelector("Spacing", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - currentLayout.setSpacing(Boolean.parseBoolean(event - .getProperty().getValue().toString())); - } - }, "false", "true")); + @Override + public void valueChange(ValueChangeEvent event) { + currentLayout.setSpacing(Boolean.parseBoolean(event + .getProperty().getValue().toString())); + } + }, "false", "true")); sizeBar.addComponent(createSimpleSelector("Margin", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - currentLayout.setMargin(Boolean.parseBoolean(event - .getProperty().getValue().toString())); - } - }, "false", "true")); + @Override + public void valueChange(ValueChangeEvent event) { + currentLayout.setMargin(Boolean.parseBoolean(event + .getProperty().getValue().toString())); + } + }, "false", "true")); sizeBar.addComponent(createSimpleSelector("Direction", new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - Object value = event.getProperty().getValue(); - - AbstractOrderedLayout newLayout; - if (value.equals("Horizontal")) { - newLayout = new HorizontalLayout(); - } else { - newLayout = new VerticalLayout(); - } - - while (currentLayout.getComponentCount() > 0) { - newLayout.addComponent(currentLayout - .getComponent(0)); - } - newLayout.setStyleName("theLayout"); - - newLayout.setHeight(currentLayout.getHeight(), - currentLayout.getHeightUnits()); - newLayout.setWidth(currentLayout.getWidth(), - currentLayout.getWidthUnits()); - - newLayout.setMargin(currentLayout.getMargin()); - newLayout.setSpacing(currentLayout.isSpacing()); - - getLayout().replaceComponent(currentLayout, newLayout); - getLayout().setExpandRatio(newLayout, 1); - currentLayout = newLayout; - } - }, "Horizontal", "Vertical")); + @Override + public void valueChange(ValueChangeEvent event) { + Object value = event.getProperty().getValue(); + + AbstractOrderedLayout newLayout; + if (value.equals("Horizontal")) { + newLayout = new HorizontalLayout(); + } else { + newLayout = new VerticalLayout(); + } + + while (currentLayout.getComponentCount() > 0) { + newLayout.addComponent(currentLayout + .getComponent(0)); + } + newLayout.setStyleName("theLayout"); + + newLayout.setHeight(currentLayout.getHeight(), + currentLayout.getHeightUnits()); + newLayout.setWidth(currentLayout.getWidth(), + currentLayout.getWidthUnits()); + + newLayout.setMargin(currentLayout.getMargin()); + newLayout.setSpacing(currentLayout.isSpacing()); + + getLayout().replaceComponent(currentLayout, newLayout); + getLayout().setExpandRatio(newLayout, 1); + currentLayout = newLayout; + } + }, "Horizontal", "Vertical")); HorizontalLayout caseBar = new HorizontalLayout(); caseBar.addComponent(new Button("Undefined without relative", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - resetState(); - setState(sizeBar, 2, 1); - // width: 350px to middle child - setChildState(1, 0, 2); - // middle center allign to middle child - setChildState(1, 4, 5); - // long captions to right child - setChildState(2, 2, 2); - } - })); + @Override + public void buttonClick(ClickEvent event) { + resetState(); + setState(sizeBar, 2, 1); + // width: 350px to middle child + setChildState(1, 0, 2); + // middle center allign to middle child + setChildState(1, 4, 5); + // long captions to right child + setChildState(2, 2, 2); + } + })); caseBar.addComponent(new Button("Undefined with relative", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - resetState(); - // width: 100% to middle child - setChildState(1, 0, 4); - } - })); + @Override + public void buttonClick(ClickEvent event) { + resetState(); + // width: 100% to middle child + setChildState(1, 0, 4); + } + })); caseBar.addComponent(new Button("Fixed with overflow", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - resetState(); - // layout width: 350px - setState(sizeBar, 0, 2); - // layout margin enabled - setState(sizeBar, 3, 1); - } - })); + @Override + public void buttonClick(ClickEvent event) { + resetState(); + // layout width: 350px + setState(sizeBar, 0, 2); + // layout margin enabled + setState(sizeBar, 3, 1); + } + })); caseBar.addComponent(new Button("Fixed with extra space", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - resetState(); - // Layout width: 800px - setState(sizeBar, 0, 3); - // layout margin enabled - setState(sizeBar, 3, 1); - // width: 350px to middle child - setChildState(1, 0, 2); - // short caption for middle child - setChildState(1, 2, 1); - // top center align for middle child - setChildState(1, 4, 2); - } - })); + @Override + public void buttonClick(ClickEvent event) { + resetState(); + // Layout width: 800px + setState(sizeBar, 0, 3); + // layout margin enabled + setState(sizeBar, 3, 1); + // width: 350px to middle child + setChildState(1, 0, 2); + // short caption for middle child + setChildState(1, 2, 1); + // top center align for middle child + setChildState(1, 4, 2); + } + })); caseBar.addComponent(new Button("Expand with alignment", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - resetState(); - // Layout width: 800px - setState(sizeBar, 0, 3); - // Layout height: 350px - setState(sizeBar, 1, 2); - // Expand: 1 to middle child - setChildState(1, 3, 1); - // Align bottom left to middle child - setChildState(1, 4, 6); - // Long caption to middle child - setChildState(1, 2, 2); - } - })); + @Override + public void buttonClick(ClickEvent event) { + resetState(); + // Layout width: 800px + setState(sizeBar, 0, 3); + // Layout height: 350px + setState(sizeBar, 1, 2); + // Expand: 1 to middle child + setChildState(1, 3, 1); + // Align bottom left to middle child + setChildState(1, 4, 6); + // Long caption to middle child + setChildState(1, 2, 2); + } + })); caseBar.addComponent(new Button("Multiple expands", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - resetState(); - // Layout width: 800px - setState(sizeBar, 0, 3); - // Layout height: 350px - setState(sizeBar, 1, 2); - // Long caption to left child - setChildState(0, 2, 2); - // Width 350px to middle child - setChildState(1, 0, 2); - // Apply to left and middle child - for (int i = 0; i < 2; i++) { - // Expand: 1 - setChildState(i, 3, 1); - // Align: middle center - setChildState(i, 4, 5); - } - } - })); + @Override + public void buttonClick(ClickEvent event) { + resetState(); + // Layout width: 800px + setState(sizeBar, 0, 3); + // Layout height: 350px + setState(sizeBar, 1, 2); + // Long caption to left child + setChildState(0, 2, 2); + // Width 350px to middle child + setChildState(1, 0, 2); + // Apply to left and middle child + for (int i = 0; i < 2; i++) { + // Expand: 1 + setChildState(i, 3, 1); + // Align: middle center + setChildState(i, 4, 5); + } + } + })); caseBar.addComponent(new Button("Fixed + relative height", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - resetState(); - // Layout height: 100% - setState(sizeBar, 1, 4); - // Height: 350px to left child - setChildState(0, 1, 2); - // Height: 100% to middle child - setChildState(1, 1, 4); - // Short caption to middle child - setChildState(1, 2, 1); - // Alignment: bottom left to right child - setChildState(2, 4, 7); - } - })); + @Override + public void buttonClick(ClickEvent event) { + resetState(); + // Layout height: 100% + setState(sizeBar, 1, 4); + // Height: 350px to left child + setChildState(0, 1, 2); + // Height: 100% to middle child + setChildState(1, 1, 4); + // Short caption to middle child + setChildState(1, 2, 1); + // Alignment: bottom left to right child + setChildState(2, 4, 7); + } + })); caseBar.addComponent(new Button("Undefined + relative height", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - resetState(); - // Height: 350px to left child - setChildState(0, 1, 2); - // Short caption to left child - setChildState(0, 2, 1); - // Height: 100% to middle child - setChildState(1, 1, 4); - // Alignment: bottom left to right child - setChildState(2, 4, 7); - } - })); + @Override + public void buttonClick(ClickEvent event) { + resetState(); + // Height: 350px to left child + setChildState(0, 1, 2); + // Short caption to left child + setChildState(0, 2, 1); + // Height: 100% to middle child + setChildState(1, 1, 4); + // Alignment: bottom left to right child + setChildState(2, 4, 7); + } + })); caseBar.setSpacing(true); diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java index 945ccf0e28..bc76a0c0ce 100644 --- a/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java +++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java @@ -4,7 +4,7 @@ import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java b/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java index f822af0779..a4067c3dcb 100644 --- a/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java +++ b/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java @@ -16,7 +16,7 @@ package com.vaadin.tests.components.panel; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -25,7 +25,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; -public class PanelChangeContents extends AbstractTestRoot implements +public class PanelChangeContents extends AbstractTestUI implements ClickListener { VerticalLayout stats = new VerticalLayout(); diff --git a/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java b/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java index b450bfe811..99bfc7acfb 100644 --- a/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java +++ b/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java @@ -16,13 +16,13 @@ package com.vaadin.tests.components.popupview; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.PopupView; -public class ReopenPopupView extends AbstractTestRoot { +public class ReopenPopupView extends AbstractTestUI { private final Log log = new Log(5); @Override diff --git a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java index 73d7a95e9f..6eaffa5cf3 100644 --- a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java +++ b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java @@ -48,7 +48,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase { @Override protected void setup() { - getLayout().getRoot().addActionHandler(actionHandler); + getLayout().getUI().addActionHandler(actionHandler); getLayout().addComponent(createRichTextArea("InMainLayout")); Panel panel = new Panel("RTA Panel"); @@ -61,7 +61,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase { w.addComponent(createRichTextArea("InSubWindow")); w.getContent().setSizeUndefined(); - getLayout().getRoot().addWindow(w); + getLayout().getUI().addWindow(w); } diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html deleted file mode 100644 index 5448a24816..0000000000 --- a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html +++ /dev/null @@ -1,46 +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.components.root.LazyInitRoots/normalPath?restartApplication#normalFragment</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>NormalRoot<br />pathInfo: /normalPath<br />parameters: [restartApplication]<br />uri fragment: normalFragment</td> -</tr> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.root.LazyInitRoots/lazyCreatePath?lazyCreate#lazyCreateFragment</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>LazyCreateRoot<br />pathInfo: /lazyCreatePath<br />parameters: [lazyCreate]<br />uri fragment: lazyCreateFragment</td> -</tr> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.root.LazyInitRoots/eagerPath/?eagerInit#eagerFragment</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>EagerInitRoot<br />pathInfo: /eagerPath/<br />parameters: [eagerInit]<br />uri fragment: null</td> -</tr> -</tbody></table> -</body> -</html> diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java deleted file mode 100644 index ae3182401d..0000000000 --- a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.tests.components.root; - -import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformationException; -import com.vaadin.terminal.AbstractRootProvider; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestApplication; -import com.vaadin.ui.Label; -import com.vaadin.ui.Root; - -public class RootsInMultipleTabs extends AbstractTestApplication { - private int numberOfRootsOpened; - - public static class TabRoot extends Root { - @Override - protected void init(WrappedRequest request) { - RootsInMultipleTabs application = (RootsInMultipleTabs) getApplication(); - String message = "This is root number " - + ++application.numberOfRootsOpened; - - addComponent(new Label(message)); - } - } - - public RootsInMultipleTabs() { - addRootProvider(new AbstractRootProvider() { - @Override - public Class<? extends Root> getRootClass(Application application, - WrappedRequest request) - throws RootRequiresMoreInformationException { - return TabRoot.class; - } - }); - } - - @Override - protected String getTestDescription() { - return "Opening the same application again (e.g. in a new tab) should create a new Root."; - } - - @Override - protected Integer getTicketNumber() { - return Integer.valueOf(7894); - } -} diff --git a/tests/testbench/com/vaadin/tests/components/slider/SliderTest.java b/tests/testbench/com/vaadin/tests/components/slider/SliderTest.java index 9be1fea987..0b9c2d6c5a 100644 --- a/tests/testbench/com/vaadin/tests/components/slider/SliderTest.java +++ b/tests/testbench/com/vaadin/tests/components/slider/SliderTest.java @@ -2,6 +2,7 @@ package com.vaadin.tests.components.slider; import java.util.LinkedHashMap; +import com.vaadin.shared.ui.slider.SliderOrientation; import com.vaadin.tests.components.abstractfield.AbstractFieldTest; import com.vaadin.ui.Slider; @@ -21,9 +22,9 @@ public class SliderTest extends AbstractFieldTest<Slider> { } }; - private Command<Slider, Integer> orientationCommand = new Command<Slider, Integer>() { + private Command<Slider, SliderOrientation> orientationCommand = new Command<Slider, SliderOrientation>() { @Override - public void execute(Slider c, Integer value, Object data) { + public void execute(Slider c, SliderOrientation value, Object data) { c.setOrientation(value); } }; @@ -56,9 +57,9 @@ public class SliderTest extends AbstractFieldTest<Slider> { } private void createOrientationSelect(String category) { - LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>(); - options.put("Horizontal", Slider.ORIENTATION_HORIZONTAL); - options.put("Vertical", Slider.ORIENTATION_VERTICAL); + LinkedHashMap<String, SliderOrientation> options = new LinkedHashMap<String, SliderOrientation>(); + options.put("Horizontal", SliderOrientation.HORIZONTAL); + options.put("Vertical", SliderOrientation.VERTICAL); createSelectAction("Orientation", category, options, "Horizontal", orientationCommand); diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java index 00012522ca..5554b2b9f3 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java @@ -8,7 +8,7 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.NativeButton; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class SplitPanelExtraScrollbars extends AbstractTestCase implements ClickListener { diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java index e80ad29426..3cdc0c8913 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java @@ -5,7 +5,7 @@ import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.NativeButton; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/table/CtrlShiftMultiselect.java b/tests/testbench/com/vaadin/tests/components/table/CtrlShiftMultiselect.java index 02f4af045b..b9e23930e4 100644 --- a/tests/testbench/com/vaadin/tests/components/table/CtrlShiftMultiselect.java +++ b/tests/testbench/com/vaadin/tests/components/table/CtrlShiftMultiselect.java @@ -5,6 +5,7 @@ import com.vaadin.data.Item; import com.vaadin.data.util.IndexedContainer; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Table; +import com.vaadin.ui.Table.TableDragMode; @SuppressWarnings("serial") public class CtrlShiftMultiselect extends TestBase { @@ -18,6 +19,7 @@ public class CtrlShiftMultiselect extends TestBase { table.setSelectable(true); table.setMultiSelect(true); + table.setDragMode(TableDragMode.MULTIROW); table.setWidth("400px"); table.setHeight("400px"); diff --git a/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java b/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java index 75468af247..edd524d657 100644 --- a/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java +++ b/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java @@ -7,7 +7,7 @@ import com.vaadin.data.util.BeanItemContainer; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.tests.util.Person; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class ScrollCausesRequestLoop extends AbstractTestCase { diff --git a/tests/testbench/com/vaadin/tests/components/table/SelectionRangeDragging.html b/tests/testbench/com/vaadin/tests/components/table/SelectionRangeDragging.html new file mode 100644 index 0000000000..1e911699d1 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/SelectionRangeDragging.html @@ -0,0 +1,52 @@ +<?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.components.table.CtrlShiftMultiselect?restartApplication</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[5]/domChild[1]/domChild[0]</td> + <td>112,12</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[10]/domChild[1]/domChild[0]</td> + <td>82,16:shift</td> +</tr> +<tr> + <td>drag</td> + <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[8]/domChild[1]/domChild[0]</td> + <td>87,1</td> +</tr> +<tr> + <td>mouseMoveAt</td> + <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td> + <td>700,210</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>multiple-rows-dragged</td> +</tr> +<tr> + <td>drop</td> + <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td> + <td>700,210</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java b/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java index 15872aa849..afc63c0eda 100644 --- a/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java +++ b/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.table; import com.vaadin.tests.components.AbstractTestCase; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java b/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java index 010093bf8f..f8fb624c0b 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java @@ -4,7 +4,7 @@ import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.util.IndexedContainer; import com.vaadin.tests.components.AbstractTestCase; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/table/TableFirstRowFlicker.java b/tests/testbench/com/vaadin/tests/components/table/TableFirstRowFlicker.java index 3101615cfd..90df5610eb 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableFirstRowFlicker.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableFirstRowFlicker.java @@ -5,7 +5,7 @@ import com.vaadin.data.Container; import com.vaadin.data.util.IndexedContainer; import com.vaadin.ui.Label; import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java b/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java index bce96ebced..26f8e25d3b 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.table; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.CssLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class TableHeaderZoom extends TestBase { diff --git a/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java b/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java index 0173f928dd..6bbf06635a 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java @@ -4,7 +4,7 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; /** diff --git a/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java index 136dcfe9a5..f54f685a1d 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java @@ -4,7 +4,7 @@ import java.net.MalformedURLException; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbsoluteLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; @@ -14,11 +14,11 @@ import com.vaadin.ui.Table.Align; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.themes.Reindeer; -public class TableInTabsheet extends AbstractTestRoot { +public class TableInTabsheet extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { - getRoot().setCaption("test"); + getUI().setCaption("test"); VerticalLayout vPrinc = new VerticalLayout(); vPrinc.setStyleName(Reindeer.LAYOUT_BLUE); diff --git a/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java b/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java index 0465d2f886..9ca2605cd9 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java @@ -7,7 +7,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java b/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java index d629c9a917..c563312efa 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java +++ b/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java @@ -7,7 +7,7 @@ import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java index 8e4c4d40fb..1934649902 100644 --- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.TabSheet.Tab; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java index a12a5a8836..b38dd36284 100644 --- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java +++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java @@ -88,7 +88,7 @@ public class TextChangeEvents extends TestBase { @Override public void attach() { super.attach(); - TestUtils.injectCSS(getRoot(), ".match { background:green ;} " + TestUtils.injectCSS(getUI(), ".match { background:green ;} " + ".nomatch {background:red;}"); } diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java index 5b84ff20f2..5991ac6ff7 100644 --- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java +++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java @@ -24,7 +24,7 @@ public class TextChangeListenerChangingNonTextProperties extends TestBase { super.attach(); TestUtils .injectCSS( - getRoot(), + getUI(), ".red { background:red;} " + ".green { background:green;} .blue { background:blue;} .cyan { background:cyan;} .magenta { background:magenta;}"); } diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java index 3e1a709243..903226c87c 100644 --- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java +++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components.textfield; import com.vaadin.Application; import com.vaadin.ui.Component; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java b/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java index 9d58762f60..892b7e669a 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java +++ b/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.tree; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java b/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java index abc9a5385d..70c2d5d433 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.tree; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java b/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java index 329e5d291d..8f9c1deaf5 100644 --- a/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java +++ b/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components.treetable; import com.vaadin.terminal.ExternalResource; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Link; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TreeTable; public class DisappearingComponents extends AbstractTestCase { diff --git a/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.html b/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.html new file mode 100644 index 0000000000..d7e1544026 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.html @@ -0,0 +1,46 @@ +<?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.components.ui.LazyInitUIs/normalPath?restartApplication#normalFragment</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentsuilazyInitUIs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>NormalUI<br />pathInfo: /normalPath<br />parameters: [restartApplication]<br />uri fragment: normalFragment</td> +</tr> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.ui.LazyInitUIs/lazyCreatePath?lazyCreate#lazyCreateFragment</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentsuilazyInitUIs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>LazyCreateUI<br />pathInfo: /lazyCreatePath<br />parameters: [lazyCreate]<br />uri fragment: lazyCreateFragment</td> +</tr> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.ui.LazyInitUIs/eagerPath/?eagerInit#eagerFragment</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentsuiLazyInitUIs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>EagerInitUI<br />pathInfo: /eagerPath/<br />parameters: [eagerInit]<br />uri fragment: null</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java b/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.java index 254410a549..75a98ba14e 100644 --- a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java +++ b/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.java @@ -1,6 +1,6 @@ -package com.vaadin.tests.components.root; +package com.vaadin.tests.components.ui; -import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.annotations.EagerInit; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.terminal.ExternalResource; @@ -9,53 +9,53 @@ import com.vaadin.terminal.WrappedRequest.BrowserDetails; import com.vaadin.tests.components.AbstractTestApplication; import com.vaadin.ui.Label; import com.vaadin.ui.Link; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; -public class LazyInitRoots extends AbstractTestApplication { +public class LazyInitUIs extends AbstractTestApplication { @EagerInit - private static class EagerInitRoot extends Root { + private static class EagerInitUI extends UI { @Override public void init(WrappedRequest request) { - addComponent(getRequestInfo("EagerInitRoot", request)); + addComponent(getRequestInfo("EagerInitUI", request)); } } @Override - public Root getRoot(WrappedRequest request) - throws RootRequiresMoreInformationException { + public UI getUI(WrappedRequest request) + throws UIRequiresMoreInformationException { if (request.getParameter("lazyCreate") != null) { - // Root created on second request + // UI created on second request BrowserDetails browserDetails = request.getBrowserDetails(); if (browserDetails == null || browserDetails.getUriFragment() == null) { - throw new RootRequiresMoreInformationException(); + throw new UIRequiresMoreInformationException(); } else { - Root root = new Root() { + UI uI = new UI() { @Override protected void init(WrappedRequest request) { - addComponent(getRequestInfo("LazyCreateRoot", request)); + addComponent(getRequestInfo("LazyCreateUI", request)); } }; - return root; + return uI; } } else if (request.getParameter("eagerInit") != null) { - // Root inited on first request - return new EagerInitRoot(); + // UI inited on first request + return new EagerInitUI(); } else { - // The standard root - Root root = new Root() { + // The standard UI + UI uI = new UI() { @Override protected void init(WrappedRequest request) { - addComponent(getRequestInfo("NormalRoot", request)); + addComponent(getRequestInfo("NormalUI", request)); - Link lazyCreateLink = new Link("Open lazyCreate root", + Link lazyCreateLink = new Link("Open lazyCreate UI", new ExternalResource(getURL() + "?lazyCreate#lazyCreate")); lazyCreateLink.setTargetName("_blank"); addComponent(lazyCreateLink); - Link lazyInitLink = new Link("Open eagerInit root", + Link lazyInitLink = new Link("Open eagerInit UI", new ExternalResource(getURL() + "?eagerInit#eagerInit")); lazyInitLink.setTargetName("_blank"); @@ -63,7 +63,7 @@ public class LazyInitRoots extends AbstractTestApplication { } }; - return root; + return uI; } } @@ -78,7 +78,7 @@ public class LazyInitRoots extends AbstractTestApplication { @Override protected String getTestDescription() { - return "BrowserDetails should be available in Application.getRoot if RootRequiresMoreInformation has been thrown and in Root.init if the root has the @RootInitRequiresBrowserDetals annotation"; + return "BrowserDetails should be available in Application.getUI if UIRequiresMoreInformation has been thrown and in UI.init if the UI has the @UIInitRequiresBrowserDetals annotation"; } @Override diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.html index 7d0f638325..ed2c0ec971 100644 --- a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html +++ b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.html @@ -13,7 +13,7 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.root.TestRootTheme?restartApplication</td> + <td>/run/com.vaadin.tests.components.ui.TestUITheme?restartApplication</td> <td></td> </tr> <tr> diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.java index 77c0bdb150..39cc598094 100644 --- a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java +++ b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.java @@ -1,12 +1,12 @@ -package com.vaadin.tests.components.root; +package com.vaadin.tests.components.ui; import com.vaadin.annotations.Theme; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Label; @Theme("tests-tickets") -public class TestRootTheme extends AbstractTestRoot { +public class TestUITheme extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { @@ -17,7 +17,7 @@ public class TestRootTheme extends AbstractTestRoot { @Override public String getTestDescription() { - return "Root with @RootTheme(\"tests-tickets\")"; + return "UI with @Theme(\"tests-tickets\")"; } @Override diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.html index c91d742581..2f0858b4c7 100644 --- a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html +++ b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.html @@ -13,22 +13,22 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.root.TestRootWidgetset</td> + <td>/run/com.vaadin.tests.components.ui.TestUIWidgetset</td> <td></td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootTestRootWidgetset::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentsuiTestUIWidgetset::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td> <td>This component is available in TestingWidgetset, but not in DefaultWidgetset</td> </tr> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.root.TestRootWidgetset2</td> + <td>/run/com.vaadin.tests.components.ui.TestUIWidgetset2</td> <td></td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootTestRootWidgetset2::/VVerticalLayout[0]/VVerticalLayout[0]/VUnknownComponent[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsuiTestUIWidgetset2::/VVerticalLayout[0]/VVerticalLayout[0]/VUnknownComponent[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> <td>Widgetset does not contain implementation for com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent. Check its component connector's @Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.</td> </tr> </tbody></table> diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.java index b92815eeed..f26e94f243 100644 --- a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java +++ b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.java @@ -1,12 +1,12 @@ -package com.vaadin.tests.components.root; +package com.vaadin.tests.components.ui; import com.vaadin.annotations.Widgetset; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class TestRootWidgetset extends AbstractTestRoot { +public class TestUIWidgetset extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { @@ -15,7 +15,7 @@ public class TestRootWidgetset extends AbstractTestRoot { @Override public String getTestDescription() { - return "This contents if this root should work as the component is present in TestingWidgetSet"; + return "This contents if this UI should work as the component is present in TestingWidgetSet"; } @Override diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset2.java index d3be29215e..84c0780240 100644 --- a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java +++ b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset2.java @@ -1,10 +1,10 @@ -package com.vaadin.tests.components.root; +package com.vaadin.tests.components.ui; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; -public class TestRootWidgetset2 extends AbstractTestRoot { +public class TestUIWidgetset2 extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { @@ -13,7 +13,7 @@ public class TestRootWidgetset2 extends AbstractTestRoot { @Override public String getTestDescription() { - return "This contents if this root should not work as the component is not present in DefaultWidgetSet"; + return "This contents if this UI should not work as the component is not present in DefaultWidgetSet"; } @Override diff --git a/tests/testbench/com/vaadin/tests/components/root/RootInitException.java b/tests/testbench/com/vaadin/tests/components/ui/UIInitException.java index b4cfa2a28d..29de6f6ac3 100644 --- a/tests/testbench/com/vaadin/tests/components/root/RootInitException.java +++ b/tests/testbench/com/vaadin/tests/components/ui/UIInitException.java @@ -1,9 +1,9 @@ -package com.vaadin.tests.components.root; +package com.vaadin.tests.components.ui; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; -public class RootInitException extends AbstractTestRoot { +public class UIInitException extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java b/tests/testbench/com/vaadin/tests/components/ui/UIInitTest.java index 16fecc62d2..6efe1d1b28 100644 --- a/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java +++ b/tests/testbench/com/vaadin/tests/components/ui/UIInitTest.java @@ -2,22 +2,22 @@ @ITMillApache2LicenseForJavaFiles@ */ -package com.vaadin.tests.components.root; +package com.vaadin.tests.components.ui; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Label; -public class RootInitTest extends AbstractTestRoot { +public class UIInitTest extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { - addComponent(new Label("Hello root")); + addComponent(new Label("Hello UI")); } @Override public String getTestDescription() { - return "Testing basic root creation"; + return "Testing basic UI creation"; } @Override diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html b/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.html index c9b83fdc4e..08561588c4 100644 --- a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html +++ b/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.html @@ -13,33 +13,33 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.root.RootsInMultipleTabs?restartApplication</td> + <td>/run/com.vaadin.tests.components.ui.UIsInMultipleTabs?restartApplication</td> <td></td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>This is root number 1</td> + <td>vaadin=runcomvaadintestscomponentsuiUIsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>This is UI number 1</td> </tr> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.root.RootsInMultipleTabs</td> + <td>/run/com.vaadin.tests.components.ui.UIsInMultipleTabs</td> <td></td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>This is root number 2</td> + <td>vaadin=runcomvaadintestscomponentsuiUIsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>This is UI number 2</td> </tr> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.root.RootsInMultipleTabs?restartApplication</td> + <td>/run/com.vaadin.tests.components.ui.UIsInMultipleTabs?restartApplication</td> <td></td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>This is root number 1</td> + <td>vaadin=runcomvaadintestscomponentsuiUIsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>This is UI number 1</td> </tr> </tbody></table> diff --git a/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.java new file mode 100644 index 0000000000..8dd303a8e1 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.java @@ -0,0 +1,45 @@ +package com.vaadin.tests.components.ui; + +import com.vaadin.Application; +import com.vaadin.UIRequiresMoreInformationException; +import com.vaadin.terminal.AbstractUIProvider; +import com.vaadin.terminal.WrappedRequest; +import com.vaadin.tests.components.AbstractTestApplication; +import com.vaadin.ui.Label; +import com.vaadin.ui.UI; + +public class UIsInMultipleTabs extends AbstractTestApplication { + private int numberOfUIsOpened; + + public static class TabUI extends UI { + @Override + protected void init(WrappedRequest request) { + UIsInMultipleTabs application = (UIsInMultipleTabs) getApplication(); + String message = "This is UI number " + + ++application.numberOfUIsOpened; + + addComponent(new Label(message)); + } + } + + public UIsInMultipleTabs() { + addUIProvider(new AbstractUIProvider() { + @Override + public Class<? extends UI> getUIClass(Application application, + WrappedRequest request) + throws UIRequiresMoreInformationException { + return TabUI.class; + } + }); + } + + @Override + protected String getTestDescription() { + return "Opening the same application again (e.g. in a new tab) should create a new UI."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(7894); + } +} diff --git a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.html index d4704fea65..bcb9f52afe 100644 --- a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html +++ b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.html @@ -13,22 +13,22 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.root.UriFragmentTest?restartApplication#urifragment</td> + <td>/run/com.vaadin.tests.components.ui.UriFragmentTest?restartApplication#urifragment</td> <td></td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> <td>Current URI fragment: urifragment</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> <td>Current URI fragment: test</td> </tr> <tr> @@ -48,7 +48,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> <td>Current URI fragment: urifragment</td> </tr> <tr> @@ -68,7 +68,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> <td>Current URI fragment: test</td> </tr> diff --git a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.java index d34c7718ce..d2167e67c7 100644 --- a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java +++ b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.java @@ -1,14 +1,14 @@ -package com.vaadin.tests.components.root; +package com.vaadin.tests.components.ui; import com.vaadin.terminal.Page; import com.vaadin.terminal.Page.FragmentChangedEvent; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -public class UriFragmentTest extends AbstractTestRoot { +public class UriFragmentTest extends AbstractTestUI { private final Label fragmentLabel = new Label(); diff --git a/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java b/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java index 52a94daec7..a2f03212b0 100644 --- a/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java +++ b/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java @@ -12,7 +12,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Window; public class AttachShouldBeCalledForSubWindows extends AbstractTestCase @@ -26,7 +26,7 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase @Override public void init() { - Root.LegacyWindow mainWindow = new Root.LegacyWindow() { + UI.LegacyWindow mainWindow = new UI.LegacyWindow() { @Override public void attach() { log(this); diff --git a/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java b/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java index a9744b2c06..92e0e734ff 100644 --- a/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java +++ b/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java @@ -4,7 +4,7 @@ import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class ExecuteJavaScript extends AbstractTestCase { diff --git a/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java b/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java index fc8d7474af..1cdfdef0b5 100644 --- a/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java +++ b/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java @@ -29,7 +29,7 @@ public class ExtraWindowShown extends TestBase { iconButton .setIcon(new ThemeResource("../runo/icons/16/ok.png")); w.addComponent(iconButton); - event.getButton().getRoot().addWindow(w); + event.getButton().getUI().addWindow(w); } }); diff --git a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java index eb4803630f..80497528ca 100644 --- a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java +++ b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java @@ -10,7 +10,7 @@ import com.vaadin.tests.util.Log; import com.vaadin.tests.util.LoremIpsum; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; import com.vaadin.ui.Window.ResizeEvent; import com.vaadin.ui.Window.ResizeListener; diff --git a/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java index 59cd35c2cb..4d2f118ec7 100644 --- a/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java +++ b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.window; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -9,7 +9,7 @@ import com.vaadin.ui.Layout; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; -public class RepaintWindowContents extends AbstractTestRoot { +public class RepaintWindowContents extends AbstractTestUI { private static final long serialVersionUID = 1L; @SuppressWarnings("serial") diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java index 061ee7900f..273d48514c 100644 --- a/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java +++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java @@ -11,7 +11,7 @@ import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.TextField; import com.vaadin.ui.Window; @@ -64,7 +64,7 @@ public class SubWindowFocusAndBlurListeners extends TestBase { } }); - Root main = getLayout().getRoot(); + UI main = getLayout().getUI(); main.addWindow(window); diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java index 02241476d5..0ca7fd1067 100644 --- a/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java +++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java @@ -10,7 +10,7 @@ import com.vaadin.ui.ComboBox; import com.vaadin.ui.CssLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Window; public class SubWindowOrder extends TestBase { @@ -20,7 +20,7 @@ public class SubWindowOrder extends TestBase { @Override protected void setup() { - Root mainWindow = getMainWindow(); + UI mainWindow = getMainWindow(); HorizontalLayout controlpanels = new HorizontalLayout(); for (int i = 1; i <= 5; i++) { Window dialog = new Window("Dialog " + i); diff --git a/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java b/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java index 56be00b923..a77a1f7703 100644 --- a/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java +++ b/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java @@ -17,11 +17,11 @@ package com.vaadin.tests.components.window; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.TextField; import com.vaadin.ui.Window; -public class TooltipInWindow extends AbstractTestRoot { +public class TooltipInWindow extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java index fdeb21d29c..033de48446 100644 --- a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java +++ b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java @@ -8,7 +8,7 @@ import com.vaadin.ui.Component; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java index 43f8297a5d..5f55ad8cf3 100644 --- a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java +++ b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components.window; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class WindowScrollingUp extends AbstractTestCase { @@ -28,7 +28,7 @@ public class WindowScrollingUp extends AbstractTestCase { @Override public void buttonClick(ClickEvent event) { - up.getRoot().setScrollTop(0); + up.getUI().setScrollTop(0); } }); diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java index 537c9be973..0c1fdc23f6 100644 --- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java +++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java @@ -12,7 +12,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Form; import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class CheckboxUpdateProblem extends Application.LegacyApplication diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java index b7d1b8c37e..aec0f0e28e 100644 --- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java +++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java @@ -3,7 +3,7 @@ package com.vaadin.tests.containers.sqlcontainer; import com.vaadin.Application; import com.vaadin.ui.AbstractSelect.Filtering; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * See http://dev.vaadin.com/ticket/9155 . @@ -13,7 +13,7 @@ public class ComboBoxUpdateProblem extends Application.LegacyApplication { @Override public void init() { - setMainWindow(new Root.LegacyWindow("Test window")); + setMainWindow(new UI.LegacyWindow("Test window")); ComboBox combo = new ComboBox("Names", databaseHelper.getTestContainer()); diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java index dc919fdb12..8bb2ba1092 100644 --- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java +++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java @@ -12,7 +12,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; // author table in testdb (MySQL) is set out as follows diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest2.java b/tests/testbench/com/vaadin/tests/dd/DDTest2.java index 272be53034..4d649c6056 100644 --- a/tests/testbench/com/vaadin/tests/dd/DDTest2.java +++ b/tests/testbench/com/vaadin/tests/dd/DDTest2.java @@ -24,7 +24,7 @@ import com.vaadin.ui.AbstractSelect; import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails; import com.vaadin.ui.AbstractSelect.AcceptItem; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Table; import com.vaadin.ui.Table.TableTransferable; import com.vaadin.ui.Tree; @@ -45,7 +45,7 @@ public class DDTest2 extends TestBase { @Override protected void setup() { - Root w = getLayout().getRoot(); + UI w = getLayout().getUI(); /* darn reindeer has no icons */ /* Make all trees (their nodes actually) draggable */ diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest4.java b/tests/testbench/com/vaadin/tests/dd/DDTest4.java index c7f0c6960b..044fe1f49a 100644 --- a/tests/testbench/com/vaadin/tests/dd/DDTest4.java +++ b/tests/testbench/com/vaadin/tests/dd/DDTest4.java @@ -16,7 +16,7 @@ import com.vaadin.tests.util.PersonContainer; import com.vaadin.tests.util.TestUtils; import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Table; public class DDTest4 extends TestBase { @@ -28,7 +28,7 @@ public class DDTest4 extends TestBase { @Override protected void setup() { - Root w = getLayout().getRoot(); + UI w = getLayout().getUI(); TestUtils .injectCSS( diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest5.java b/tests/testbench/com/vaadin/tests/dd/DDTest5.java index 63d1e9e3c2..43342fdc35 100644 --- a/tests/testbench/com/vaadin/tests/dd/DDTest5.java +++ b/tests/testbench/com/vaadin/tests/dd/DDTest5.java @@ -15,7 +15,7 @@ import com.vaadin.ui.DragAndDropWrapper.DragStartMode; import com.vaadin.ui.DragAndDropWrapper.WrapperTransferable; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class DDTest5 extends TestBase { @@ -47,7 +47,7 @@ public class DDTest5 extends TestBase { @Override protected void setup() { - Root w = getLayout().getRoot(); + UI w = getLayout().getUI(); HorizontalSortableCssLayoutWithWrappers verticalSortableCssLayoutWithWrappers = new HorizontalSortableCssLayoutWithWrappers(); w.addWindow(verticalSortableCssLayoutWithWrappers); diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest6.java b/tests/testbench/com/vaadin/tests/dd/DDTest6.java index c6ac0b1859..f1e31c1452 100644 --- a/tests/testbench/com/vaadin/tests/dd/DDTest6.java +++ b/tests/testbench/com/vaadin/tests/dd/DDTest6.java @@ -164,7 +164,7 @@ public class DDTest6 extends TestBase { getLayout().addComponent(sp); TestUtils .injectCSS( - getLayout().getRoot(), + getLayout().getUI(), "" + ".v-tree .v-icon {height:16px;} " + ".v-tree-node-caption-drag-top {/*border-top: none;*/} " diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest7.java b/tests/testbench/com/vaadin/tests/dd/DDTest7.java index f9be935b23..1abf9e379c 100644 --- a/tests/testbench/com/vaadin/tests/dd/DDTest7.java +++ b/tests/testbench/com/vaadin/tests/dd/DDTest7.java @@ -16,7 +16,7 @@ import com.vaadin.tests.util.PersonContainer; import com.vaadin.tests.util.TestUtils; import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Table; public class DDTest7 extends TestBase { @@ -29,7 +29,7 @@ public class DDTest7 extends TestBase { @Override protected void setup() { - Root w = getLayout().getRoot(); + UI w = getLayout().getUI(); TestUtils .injectCSS( diff --git a/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java index e774ee0286..daa2e78353 100644 --- a/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java @@ -18,14 +18,14 @@ package com.vaadin.tests.extensions; import com.vaadin.annotations.Widgetset; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class BasicExtensionTest extends AbstractTestRoot { +public class BasicExtensionTest extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java index b389b77e97..e4646572db 100644 --- a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java @@ -17,12 +17,12 @@ package com.vaadin.tests.extensions; import com.vaadin.annotations.Widgetset; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class HelloWorldExtensionTest extends AbstractTestRoot { +public class HelloWorldExtensionTest extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java index 9d09436e45..6281f3eff4 100644 --- a/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java @@ -20,12 +20,12 @@ import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; import com.vaadin.ui.JavaScript; import com.vaadin.ui.JavaScriptFunction; -public class JavascriptManagerTest extends AbstractTestRoot { +public class JavascriptManagerTest extends AbstractTestUI { private Log log = new Log(5); diff --git a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java index 7d4f41cfb3..c604516b9c 100644 --- a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java @@ -25,13 +25,13 @@ import com.vaadin.shared.communication.ClientRpc; import com.vaadin.shared.communication.ServerRpc; import com.vaadin.terminal.AbstractJavaScriptExtension; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.JavaScriptFunction; import com.vaadin.ui.Notification; -public class SimpleJavaScriptExtensionTest extends AbstractTestRoot { +public class SimpleJavaScriptExtensionTest extends AbstractTestUI { public static class SimpleJavaScriptExtensionState extends JavaScriptExtensionState { diff --git a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java index f1345bca13..6a9f696e75 100644 --- a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java +++ b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java @@ -7,7 +7,7 @@ import com.vaadin.terminal.Page.BrowserWindowResizeEvent; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class EmbedSizeTest extends TestBase { diff --git a/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java b/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java index c464409153..b3fc9c8ffb 100644 --- a/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java +++ b/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java @@ -7,7 +7,7 @@ import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.terminal.ClassResource; import com.vaadin.terminal.Resource; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class IntegrationTestApplication extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java b/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java index 3374342947..c2a01b16dd 100644 --- a/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java +++ b/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java @@ -28,8 +28,8 @@ import com.vaadin.ui.Embedded; import com.vaadin.ui.Label; import com.vaadin.ui.Link; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.Upload; import com.vaadin.ui.Upload.Receiver; @@ -101,13 +101,13 @@ public class JSR286PortletApplication extends Application.LegacyApplication { @Override public void handleActionRequest(ActionRequest request, - ActionResponse response, Root window) { + ActionResponse response, UI window) { main.addComponent(new Label("Action received")); } @Override public void handleRenderRequest(RenderRequest request, - RenderResponse response, Root window) { + RenderResponse response, UI window) { // Portlet up-and-running, enable stuff portletEdit.setEnabled(true); portletMax.setEnabled(true); @@ -181,13 +181,13 @@ public class JSR286PortletApplication extends Application.LegacyApplication { @Override public void handleEventRequest(EventRequest request, - EventResponse response, Root window) { + EventResponse response, UI window) { // events not used by this test } @Override public void handleResourceRequest(ResourceRequest request, - ResourceResponse response, Root window) { + ResourceResponse response, UI window) { // nothing special to do here } } diff --git a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java index a35b78c219..a233191070 100644 --- a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java +++ b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java @@ -10,6 +10,7 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.event.Action; import com.vaadin.shared.ui.MarginInfo; import com.vaadin.shared.ui.label.ContentMode; +import com.vaadin.shared.ui.slider.SliderOrientation; import com.vaadin.terminal.ExternalResource; import com.vaadin.terminal.Page; import com.vaadin.terminal.Resource; @@ -39,7 +40,6 @@ import com.vaadin.ui.NativeSelect; import com.vaadin.ui.Notification; import com.vaadin.ui.Panel; import com.vaadin.ui.PopupView; -import com.vaadin.ui.Root.LegacyWindow; import com.vaadin.ui.Slider; import com.vaadin.ui.Slider.ValueOutOfBoundsException; import com.vaadin.ui.TabSheet; @@ -50,6 +50,7 @@ import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; import com.vaadin.ui.Tree; import com.vaadin.ui.TwinColSelect; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.VerticalSplitPanel; import com.vaadin.ui.Window; @@ -534,7 +535,7 @@ public class LiferayThemeDemo extends Application.LegacyApplication { l.addComponent(new Label("Vertical Slider", ContentMode.XHTML)); s = new Slider(); - s.setOrientation(Slider.ORIENTATION_VERTICAL); + s.setOrientation(SliderOrientation.VERTICAL); s.setHeight("200px"); try { s.setValue(50); diff --git a/tests/testbench/com/vaadin/tests/integration/PortletSizeInLiferayFreeformLayoutApplication.java b/tests/testbench/com/vaadin/tests/integration/PortletSizeInLiferayFreeformLayoutApplication.java index 20967203bc..fc54547890 100644 --- a/tests/testbench/com/vaadin/tests/integration/PortletSizeInLiferayFreeformLayoutApplication.java +++ b/tests/testbench/com/vaadin/tests/integration/PortletSizeInLiferayFreeformLayoutApplication.java @@ -2,7 +2,7 @@ package com.vaadin.tests.integration; import com.vaadin.Application.LegacyApplication; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; /** diff --git a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java index 51f9e2d88e..7877ca3fe3 100644 --- a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java +++ b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java @@ -4,7 +4,7 @@ import com.vaadin.terminal.Sizeable; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -73,7 +73,7 @@ public class ComplexGLColumnExpansionWithColSpan extends AbstractTestCase { restart.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { - mainLayout.getRoot().getApplication().close(); + mainLayout.getUI().getApplication().close(); } }); diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java index 8713208dc6..2d5bc8d59a 100644 --- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java +++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java @@ -15,7 +15,7 @@ import com.vaadin.ui.Form; import com.vaadin.ui.FormFieldFactory; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java index 84f27e5f03..acc5f07103 100644 --- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java +++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java @@ -6,7 +6,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java index d6ea84e44e..6273b92838 100644 --- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java +++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class GridLayoutInsidePanel2 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java index 5f91786571..0621fd5d92 100644 --- a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java +++ b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java @@ -14,7 +14,7 @@ import com.vaadin.ui.CustomLayout; import com.vaadin.ui.Label; import com.vaadin.ui.LoginForm; import com.vaadin.ui.PopupView; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Window; public class MovingComponentsWhileOldParentInvisible extends TestBase { @@ -45,7 +45,7 @@ public class MovingComponentsWhileOldParentInvisible extends TestBase { if (cls == LoginForm.class || cls == CustomLayout.class || CustomComponent.class.isAssignableFrom(cls) || cls == PopupView.class || cls == Window.class - || cls == Root.class) { + || cls == UI.class) { // Does not support addComponent continue; } diff --git a/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java b/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java index b998abeb02..44f40a7d78 100644 --- a/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java +++ b/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java @@ -13,7 +13,7 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java b/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java index 8d506e0884..8786ae282c 100644 --- a/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java +++ b/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java @@ -2,7 +2,7 @@ package com.vaadin.tests.layouts; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java b/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java index 916a82bb85..ef24150762 100644 --- a/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java +++ b/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java index 90193be7cc..e31ecc2498 100644 --- a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java +++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java @@ -11,7 +11,7 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.themes.Reindeer; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java index 00d336de92..08556e99d0 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java @@ -20,7 +20,7 @@ import com.vaadin.data.fieldgroup.BeanFieldGroup; import com.vaadin.data.fieldgroup.FieldGroup; import com.vaadin.data.util.BeanItem; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Mini tutorial code for @@ -30,7 +30,7 @@ import com.vaadin.ui.Root; * @author Vaadin Ltd * @since 7.0.0 */ -public class AutoGeneratingForm extends Root { +public class AutoGeneratingForm extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java index 43e404b461..f3e6653288 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java @@ -18,7 +18,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; /** @@ -28,7 +28,7 @@ import com.vaadin.ui.VerticalLayout; * @author Vaadin Ltd * @since 7.0.0 */ -public class BasicApplication extends Root { +public class BasicApplication extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java index 0a04aead7f..39b11177b6 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java @@ -17,7 +17,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.TextField; /** @@ -28,7 +28,7 @@ import com.vaadin.ui.TextField; * @author Vaadin Ltd * @since 7.0.0 */ -public class CreatingPreserveState extends Root { +public class CreatingPreserveState extends UI { private static int windowCounter = 0; @Override @@ -36,7 +36,7 @@ public class CreatingPreserveState extends Root { TextField tf = new TextField("Window #" + (++windowCounter)); tf.setImmediate(true); getContent().addComponent(tf); - getApplication().setRootPreserved(true); + getApplication().setUiPreserved(true); } } diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryUI.java index 89b4a0f8db..eb34747450 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryUI.java @@ -1,10 +1,10 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.TextField; -public class CustomConverterFactoryRoot extends AbstractTestRoot { +public class CustomConverterFactoryUI extends AbstractTestUI { @Override public void setup(WrappedRequest request) { getApplication().setConverterFactory(new MyConverterFactory()); diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java index 5296f03c30..12938f9f12 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java @@ -19,7 +19,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.annotations.Theme; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; /** @@ -30,7 +30,7 @@ import com.vaadin.ui.VerticalLayout; * @since 7.0.0 */ @Theme("hello-theme") -public class DefineRootTheme extends Root { +public class DefineUITheme extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java index 616fea7ff2..b0a33c14cf 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java @@ -17,12 +17,12 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.Application; -import com.vaadin.RootRequiresMoreInformationException; +import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedRequest.BrowserDetails; import com.vaadin.terminal.gwt.server.WebBrowser; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Mini tutorial code for @@ -35,13 +35,13 @@ import com.vaadin.ui.Root; public class DifferentFeaturesForDifferentClients extends Application { @Override - protected Root getRoot(WrappedRequest request) - throws RootRequiresMoreInformationException { + protected UI getUI(WrappedRequest request) + throws UIRequiresMoreInformationException { BrowserDetails browserDetails = request.getBrowserDetails(); // This is a limitation of 7.0.0.alpha1 that there is no better way to // check if WebBrowser has been fully initialized if (browserDetails.getUriFragment() == null) { - throw new RootRequiresMoreInformationException(); + throw new UIRequiresMoreInformationException(); } // could also use screen size, browser version etc. @@ -53,7 +53,7 @@ public class DifferentFeaturesForDifferentClients extends Application { } } -class DefaultRoot extends Root { +class DefaultRoot extends UI { @Override protected void init(WrappedRequest request) { getContent().addComponent( @@ -61,7 +61,7 @@ class DefaultRoot extends Root { } } -class TouchRoot extends Root { +class TouchRoot extends UI { @Override protected void init(WrappedRequest request) { WebBrowser webBrowser = request.getBrowserDetails().getWebBrowser(); diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java index 81f225bc63..f3e96aaafc 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java @@ -12,10 +12,10 @@ import com.vaadin.terminal.ExternalResource; import com.vaadin.terminal.RequestHandler; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedResponse; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Embedded; -public class DynamicImageRoot extends AbstractTestRoot { +public class DynamicImageUI extends AbstractTestUI { @Override public void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java index d53ede3518..9830ee6aeb 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java @@ -22,7 +22,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Mini tutorial code for @@ -32,7 +32,7 @@ import com.vaadin.ui.Root; * @author Vaadin Ltd * @since 7.0.0 */ -public class FindCurrentRootAndApplication extends Root { +public class FindCurrentUI extends UI { @Override protected void init(WrappedRequest request) { @@ -50,8 +50,8 @@ public class FindCurrentRootAndApplication extends Root { helloButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { - Notification.show("This Root is " - + Root.getCurrent().getClass().getSimpleName()); + Notification.show("This UI is " + + UI.getCurrent().getClass().getSimpleName()); } }); diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java index 1e460b2f6e..2a8b228bc3 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java @@ -4,12 +4,12 @@ import com.vaadin.data.fieldgroup.FieldGroup; import com.vaadin.data.fieldgroup.PropertyId; import com.vaadin.data.util.BeanItem; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.GridLayout; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; -public class FormUsingExistingLayout extends AbstractTestRoot { +public class FormUsingExistingLayout extends AbstractTestUI { public static class Notice { String firstName; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java index e487c6d3c4..5dd9322364 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java @@ -5,10 +5,10 @@ import java.util.Locale; import com.vaadin.data.util.converter.StringToNumberConverter; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Table; -public class FormatTableValue extends AbstractTestRoot { +public class FormatTableValue extends AbstractTestUI { private static final String PERCENT_PROPERTY = "percent"; private static final String CURRENCY_PROPERTY = "currency"; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java index af60b0e9e3..38a578189a 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java @@ -3,7 +3,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.data.Property; import com.vaadin.data.util.BeanItem; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -11,7 +11,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Notification; import com.vaadin.ui.TextField; -public class IntegerTextFieldDataSource extends AbstractTestRoot { +public class IntegerTextFieldDataSource extends AbstractTestUI { public class MyBean { private int value; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java index f733b5df40..9d968f360a 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java @@ -3,7 +3,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.data.util.converter.Converter.ConversionException; import com.vaadin.data.util.converter.StringToIntegerConverter; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -11,7 +11,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Notification; import com.vaadin.ui.TextField; -public class IntegerTextFieldStandalone extends AbstractTestRoot { +public class IntegerTextFieldStandalone extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java index d2b1ed95e0..d82f4b1382 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java @@ -20,7 +20,7 @@ import com.vaadin.terminal.ExternalResource; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Label; import com.vaadin.ui.Link; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; /** @@ -30,7 +30,7 @@ import com.vaadin.ui.VerticalLayout; * @author Vaadin Ltd * @since 7.0.0 */ -public class MultiTabApplication extends Root { +public class MultiTabApplication extends UI { private class MainView extends VerticalLayout { public MainView() { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java index c2393300f2..67a795a314 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java @@ -5,14 +5,14 @@ import java.util.Locale; import com.vaadin.data.util.converter.Converter; import com.vaadin.data.util.converter.Converter.ConversionException; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Notification; import com.vaadin.ui.TextField; -public class StringMyTypeConverter extends AbstractTestRoot { +public class StringMyTypeConverter extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java index 906ace6f53..c2f983c9bb 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java @@ -23,7 +23,7 @@ import javax.validation.constraints.Size; import com.vaadin.data.util.BeanItem; import com.vaadin.data.validator.BeanValidator; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.TextField; /** @@ -34,7 +34,7 @@ import com.vaadin.ui.TextField; * @author Vaadin Ltd * @since 7.0.0 */ -public class UsingBeanValidation extends Root { +public class UsingBeanValidation extends UI { class Person { @Size(min = 5, max = 50) diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java index db6ee57477..042c02316f 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java @@ -22,7 +22,7 @@ import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Mini tutorial code for @@ -31,7 +31,7 @@ import com.vaadin.ui.Root; * @author Vaadin Ltd * @since 7.0.0 */ -public class UsingUriFragments extends Root { +public class UsingUriFragments extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java index 64b643a185..4a689d8c12 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java @@ -18,7 +18,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Mini tutorial code for @@ -28,7 +28,7 @@ import com.vaadin.ui.Root; * @author Vaadin Ltd * @since 7.0.0 */ -public class UsingXyzWhenInitializing extends Root { +public class UsingXyzWhenInitializing extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateUI.java index 0ed4a7781e..1bde122dbf 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateUI.java @@ -3,7 +3,7 @@ package com.vaadin.tests.minitutorials.v7a2; import com.vaadin.annotations.Widgetset; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Mini tutorial code for @@ -14,7 +14,7 @@ import com.vaadin.ui.Root; * @since 7.0.0 */ @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class ComponentInStateRoot extends Root { +public class ComponentInStateUI extends UI { @Override protected void init(WrappedRequest request) { ComponentInStateComponent component = new ComponentInStateComponent(); diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java index ef692ef8a3..d9091e4287 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java @@ -18,7 +18,7 @@ package com.vaadin.tests.minitutorials.v7a2; import com.vaadin.annotations.Widgetset; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Mini tutorial code for @@ -33,7 +33,7 @@ import com.vaadin.ui.Root; * @since 7.0.0 */ @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class MyComponentRoot extends Root { +public class MyComponentUI extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java index 69c2a0d040..37f4255cdd 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java @@ -19,7 +19,7 @@ package com.vaadin.tests.minitutorials.v7a2; import com.vaadin.annotations.Widgetset; import com.vaadin.terminal.ThemeResource; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Mini tutorial code for @@ -30,7 +30,7 @@ import com.vaadin.ui.Root; * @since 7.0.0 */ @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class ResourceInStateRoot extends Root { +public class ResourceInStateUI extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java index fae4265750..8c728548c0 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java @@ -10,10 +10,10 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; import com.vaadin.ui.Label; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class WidgetcontainerRoot extends Root { +public class WidgetcontainerUI extends UI { @Override public void init(WrappedRequest request) { Label label = new Label("Hello Vaadin user"); diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java index 6c247cae44..6f2be3c7d7 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java @@ -19,7 +19,7 @@ package com.vaadin.tests.minitutorials.v7a3; import com.vaadin.annotations.JavaScript; import com.vaadin.terminal.AbstractJavaScriptExtension; import com.vaadin.terminal.gwt.server.ClientConnector; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; @JavaScript("analytics_connector.js") public class Analytics extends AbstractJavaScriptExtension { @@ -38,12 +38,12 @@ public class Analytics extends AbstractJavaScriptExtension { callFunction("pushCommand", (Object) commandAndArguments); } - protected void extend(Root root) { - super.extend(root); + protected void extend(UI uI) { + super.extend(uI); } @Override protected Class<? extends ClientConnector> getSupportedParentType() { - return Root.class; + return UI.class; } } diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java index df588b6f2d..bae3c4fc9c 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java @@ -19,9 +19,9 @@ package com.vaadin.tests.minitutorials.v7a3; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; -public class AnalyticsRoot extends Root { +public class AnalyticsUI extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java index 9a477bf6dd..5b6a693389 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java @@ -25,7 +25,7 @@ import java.util.Map; import com.vaadin.annotations.JavaScript; import com.vaadin.shared.Connector; import com.vaadin.ui.AbstractJavaScriptComponent; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; @JavaScript("complex_types_connector.js") public class ComplexTypesComponent extends AbstractJavaScriptComponent { @@ -45,7 +45,7 @@ public class ComplexTypesComponent extends AbstractJavaScriptComponent { Map<Connector, String> connectorMap = new HashMap<Connector, String>(); connectorMap.put(this, "this"); - connectorMap.put(Root.getCurrent(), "root"); + connectorMap.put(UI.getCurrent(), "root"); boolean[] bits = { true, true, false, true }; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java index 5e19d8ab1a..093f3269e0 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java @@ -17,9 +17,9 @@ package com.vaadin.tests.minitutorials.v7a3; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; -public class ComplexTypesRoot extends Root { +public class ComplexTypesUI extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java index f0584c2147..02bd8a7cce 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java @@ -19,9 +19,9 @@ package com.vaadin.tests.minitutorials.v7a3; import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; -public class FlotJavaScriptRoot extends Root { +public class FlotJavaScriptUI extends UI { @Override protected void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java index 1bf30b0054..9384394870 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonRoot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java @@ -17,9 +17,9 @@ package com.vaadin.tests.minitutorials.v7a3; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; -public class RedButtonRoot extends Root { +public class RedButtonUI extends UI { @Override protected void init(WrappedRequest request) { addComponent(new RedButton("My red button")); diff --git a/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.html b/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.html new file mode 100644 index 0000000000..12228eb9f0 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.html @@ -0,0 +1,26 @@ +<?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.serialization.DelegateToWidgetTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsserializationDelegateToWidgetTest::/VVerticalLayout[0]/VVerticalLayout[0]/DelegateWidget[0]</td> + <td>My String<br />42<br />true<br />3.141592653589793</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java b/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java new file mode 100644 index 0000000000..b775c18f8f --- /dev/null +++ b/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java @@ -0,0 +1,42 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.serialization; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.terminal.WrappedRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.widgetset.TestingWidgetSet; +import com.vaadin.tests.widgetset.server.DelegateToWidgetComponent; + +@Widgetset(TestingWidgetSet.NAME) +public class DelegateToWidgetTest extends AbstractTestUI { + @Override + protected void setup(WrappedRequest request) { + addComponent(new DelegateToWidgetComponent()); + } + + @Override + protected String getTestDescription() { + return "Verifies that @DelegateToWidget has the desired effect"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(9297); + } + +} diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.html b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.html new file mode 100644 index 0000000000..70d0e905f5 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.html @@ -0,0 +1,31 @@ +<?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.serialization.SerializerNamespaceTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsserializationSerializerNamespaceTest::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td> + <td>The real label</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsserializationSerializerNamespaceTest::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td> + <td>The dummy label</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java index 6a873a6be3..0bb3b6c542 100644 --- a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java +++ b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java @@ -18,12 +18,13 @@ package com.vaadin.tests.serialization; import com.vaadin.annotations.Widgetset; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.widgetset.TestingWidgetSet; import com.vaadin.tests.widgetset.server.DummyLabel; import com.vaadin.ui.Label; -@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class SerializerNamespaceTest extends AbstractTestRoot { +@Widgetset(TestingWidgetSet.NAME) +public class SerializerNamespaceTest extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { @@ -33,7 +34,7 @@ public class SerializerNamespaceTest extends AbstractTestRoot { @Override protected String getTestDescription() { - return "Using connectors with different state classes having the same simple name should not cause any clietn-side exceptions"; + return "Using connectors with different state classes having the same simple name should not cause any client-side exceptions"; } @Override diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java index a301ecf828..6ad6b6d530 100644 --- a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java +++ b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java @@ -30,7 +30,7 @@ import com.vaadin.annotations.Widgetset; import com.vaadin.shared.Connector; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; import com.vaadin.tests.widgetset.client.ComplexTestBean; import com.vaadin.tests.widgetset.client.SerializerTestRpc; @@ -38,7 +38,7 @@ import com.vaadin.tests.widgetset.client.SimpleTestBean; import com.vaadin.tests.widgetset.server.SerializerTestExtension; @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class SerializerTest extends AbstractTestRoot { +public class SerializerTest extends AbstractTestUI { private Log log = new Log(40); @@ -98,12 +98,12 @@ public class SerializerTest extends AbstractTestRoot { }, new HashMap<Connector, Boolean>() { { put(testExtension, true); - put(getRoot(), false); + put(getUI(), false); } }, new HashMap<Integer, Connector>() { { put(5, testExtension); - put(10, getRoot()); + put(10, getUI()); } }, new HashMap<SimpleTestBean, SimpleTestBean>() { { diff --git a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java index a2d482dfbf..62160d233a 100644 --- a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java +++ b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java @@ -10,13 +10,13 @@ import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.NativeButton; -import com.vaadin.ui.Root; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI; +import com.vaadin.ui.UI.LegacyWindow; @SuppressWarnings("serial") public class ButtonsTest extends com.vaadin.Application.LegacyApplication { - final Root.LegacyWindow main = new LegacyWindow("Button states & themes"); + final UI.LegacyWindow main = new LegacyWindow("Button states & themes"); CheckBox styleToggle; CheckBox iconToggle; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java index 299c939043..8c99fe6ebb 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java @@ -5,7 +5,7 @@ import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; import com.vaadin.ui.Alignment; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java index b1841b69ba..e11d6ea024 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java @@ -6,7 +6,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Select; public class Ticket1230 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket124.java b/tests/testbench/com/vaadin/tests/tickets/Ticket124.java index 8761db1cc3..4bcf31a366 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket124.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket124.java @@ -7,7 +7,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket124 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java index a5aa8cd2ac..6aa1c1752a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java @@ -5,7 +5,7 @@ import com.vaadin.data.Property; import com.vaadin.ui.AbstractSelect; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java index 7e9f5dab2c..c617b07248 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java @@ -4,7 +4,7 @@ import com.vaadin.event.Action; import com.vaadin.event.Action.Handler; import com.vaadin.event.ShortcutAction; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket1365 extends com.vaadin.Application.LegacyApplication diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java index 92d3598382..16b47a1f31 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; /** diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java index 3ba7ae2bfa..e162e96bfa 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java @@ -10,7 +10,7 @@ import com.vaadin.ui.InlineDateField; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; import com.vaadin.ui.PopupView; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java index d6d3b132c3..d46a56f73a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java @@ -12,7 +12,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java index a597a5b242..1da3b5c290 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket1444 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java index 4b7d4201e0..3c766ef985 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; public class Ticket1465ModalNotification extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java index 1c4156d7ff..8b1736637b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; public class Ticket1519 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java index 87ea7e86a8..a511bae6d9 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java @@ -7,7 +7,7 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1572 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java index 6831d4c52d..5025605413 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java @@ -7,7 +7,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1581 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java index 95cc918b6e..92a480c3d2 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java @@ -17,7 +17,7 @@ import com.vaadin.terminal.RequestHandler; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedResponse; import com.vaadin.ui.Link; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1589 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java index 5cb03e77af..05fd0c3f1f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java @@ -8,7 +8,7 @@ import com.vaadin.terminal.ThemeResource; import com.vaadin.ui.MenuBar; import com.vaadin.ui.MenuBar.Command; import com.vaadin.ui.MenuBar.MenuItem; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1598 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket161.java b/tests/testbench/com/vaadin/tests/tickets/Ticket161.java index b8bf8deb20..4da1b3a6b4 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket161.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket161.java @@ -5,7 +5,7 @@ import com.vaadin.data.Container; import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; /** diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java index 43feab5ab7..bca902a73f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.data.Item; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; /** diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java index 3c64a49316..55d08069ed 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1659 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java index 64d53e33f6..b07e9df0e5 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.terminal.SystemError; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket1663 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java index 277096598e..99f213541a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1673 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java index 6547572e6d..d3c2437219 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java @@ -24,7 +24,7 @@ import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.AlignmentHandler; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java index ccd649c542..364ad9b6cf 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java @@ -7,7 +7,7 @@ import com.vaadin.terminal.Resource; import com.vaadin.ui.Embedded; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket1737 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java index bf57118a8c..eca0c0f833 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1767 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java index 2cbb648227..a269acc1e0 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket1772 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java index 63af96b1a2..ec28a957bb 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java @@ -4,7 +4,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CustomLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1775 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java index 0a89675fc0..780215aa2a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java @@ -11,7 +11,7 @@ import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Select; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java index e5fcf59db8..7f5c684479 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java @@ -7,7 +7,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout.MarginHandler; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket1805 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java index fa572039aa..8359b024aa 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.data.util.ObjectProperty; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket1806 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java index 695be19300..824c58436f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java @@ -9,7 +9,7 @@ import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java index 42474d748d..e16b2c2774 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java @@ -8,7 +8,7 @@ import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Select; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java index e31748ec2f..f7329037cc 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java @@ -6,7 +6,7 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1834PanelScrolling extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java index 4b546de0f6..039f867fff 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java @@ -7,7 +7,7 @@ import com.vaadin.event.Action; import com.vaadin.event.Action.Handler; import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java index 1af0ed2041..8bd4a77204 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1868 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java index d51c0990ae..741adecae4 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java @@ -4,7 +4,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket1869 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java index 0a8992c17f..1b60d535cf 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java @@ -23,7 +23,7 @@ import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.AlignmentHandler; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java index 9fe8ccd801..136af23474 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Validator; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket1900 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java index 2837d71e67..f35463f6a8 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java @@ -5,7 +5,7 @@ import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket1904 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java index 790d3aa931..3b50804938 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.terminal.UserError; import com.vaadin.ui.Alignment; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket1916 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java index 75a2aafb96..8e9e0cb0ba 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1919 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java index 416bb80875..3d79de5d1d 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java @@ -10,7 +10,7 @@ import com.vaadin.terminal.WrappedResponse; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket1921 extends Application.LegacyApplication implements diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java index 17a7dacf26..2bde4c95ec 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket1923 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java index 91ea8c0c44..b5d938dbed 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1925 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java index 48d8ff458c..f65fbf9852 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java index 10eebe4cba..1a27e1ad28 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java index a832401cd0..9bf4ddee51 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1953 extends Application.LegacyApplication { public static final String cellStyle = "test-cell"; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java index d461ffe4e3..9440855bbe 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java @@ -9,7 +9,7 @@ import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.AlignmentHandler; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket1966 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java index 85b802d46c..c5442e6473 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java @@ -9,7 +9,7 @@ import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.AlignmentHandler; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket1966_2 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java index cfc9825b58..63634259a3 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java @@ -6,7 +6,7 @@ import com.vaadin.terminal.UserError; import com.vaadin.ui.Alignment; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java index 2a29113829..b10ccea992 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java @@ -5,7 +5,7 @@ import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java index f9f098a05a..b07a997f8f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java @@ -7,7 +7,7 @@ import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1970 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java index fd77343259..6b406a2f89 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1972 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java index 24d11e6569..a3365bedcb 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java @@ -4,7 +4,7 @@ import com.vaadin.data.Item; import com.vaadin.data.util.IndexedContainer; import com.vaadin.ui.Button; import com.vaadin.ui.Component; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java index 68307f7f99..4392c0762a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java @@ -5,7 +5,7 @@ import com.vaadin.data.Item; import com.vaadin.data.util.IndexedContainer; import com.vaadin.ui.Button; import com.vaadin.ui.Component; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java index e959098765..fda75a409e 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java @@ -11,7 +11,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CustomLayout; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1975 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java index fe0b636c56..a5953d22af 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java @@ -10,7 +10,7 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket1982 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java index 4db82c3371..0d6a21faac 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java @@ -9,7 +9,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java index 88ebad933f..fd6665b2fe 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java @@ -8,7 +8,7 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.ListSelect; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.TwinColSelect; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java index 72866a3ee8..ed60c89c16 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class Ticket1991 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java index 2aaacef448..04ce9c712d 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java @@ -7,7 +7,7 @@ import com.vaadin.data.Item; import com.vaadin.data.util.filter.SimpleStringFilter; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class Ticket1995 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket20.java b/tests/testbench/com/vaadin/tests/tickets/Ticket20.java index 061fc0cf16..ea610a3db8 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket20.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket20.java @@ -8,7 +8,7 @@ import com.vaadin.data.validator.CompositeValidator.CombinationMode; import com.vaadin.data.validator.IntegerValidator; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket20 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java index 8c7a7ba659..8ff3d952c4 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java @@ -5,7 +5,7 @@ import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2001 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java index 2c4a948cea..aeaf3bfb33 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.data.util.MethodProperty; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket2002 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java index e0b8635f32..0342b87e68 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2007 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java index 68cf5ef6d4..e79ec8905e 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java @@ -8,7 +8,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; import com.vaadin.ui.Tree; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java index e8113b0cea..754036cd5b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Select; public class Ticket2011 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java index 8d9a5e67d4..bf909acb35 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java @@ -9,7 +9,7 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2014 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java index f6d8ce5e01..c23f031a91 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java @@ -11,7 +11,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextArea; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java index bc97f906b1..ea142b7e9e 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2022 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java index 427a55391b..c6b2c0f28a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java @@ -4,7 +4,7 @@ import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2023 extends com.vaadin.Application.LegacyApplication implements Button.ClickListener { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java index e7cabbca95..b1a8b64931 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java index 6d608ad529..0b72073bec 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket2026 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java index 8acf4f1d16..ba8936adfa 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java @@ -11,7 +11,7 @@ import com.vaadin.ui.Component; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java index c979898299..da47f796a5 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java @@ -4,7 +4,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2037 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java index fa4cd76f47..c4714783a0 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java @@ -5,7 +5,7 @@ import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket2038 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java index d98656b9ca..a7ca7b179f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.ui.Accordion; import com.vaadin.ui.Label; import com.vaadin.ui.Layout.MarginHandler; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java index d79f4a1bd6..49e999a601 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java @@ -7,7 +7,7 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2042 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java index 7238462397..2efc66556d 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Link; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2043 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java index 0b5a537b4d..110db06800 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java @@ -10,7 +10,7 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2048 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java index bd098443f2..1660f00d88 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java @@ -7,7 +7,7 @@ import com.vaadin.ui.Component; import com.vaadin.ui.DateField; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java index fd64d6e35a..362a763c2f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java @@ -7,7 +7,7 @@ import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket2053 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java index 88404b6ef1..c9e91930bf 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java @@ -6,7 +6,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2060 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java index 1f633d7337..d86646b865 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java @@ -8,7 +8,7 @@ import com.vaadin.data.util.HierarchicalContainer; import com.vaadin.ui.Accordion; import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java index e3cd09926e..420d2b7086 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java @@ -12,7 +12,7 @@ import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; import com.vaadin.ui.TabSheet.SelectedTabChangeListener; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java index 082b956fe0..b0897600d3 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java @@ -10,7 +10,7 @@ import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; import com.vaadin.ui.TabSheet.SelectedTabChangeListener; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java index 5d91240c6a..9b2fe05514 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java index ea77b6f2e6..87bea00023 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2083 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java index 2042cf7cad..e48aae7d9f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java @@ -6,7 +6,7 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.terminal.UserError; import com.vaadin.ui.Button; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket2090 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java index a27ae7ac4d..258fad05c9 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.Embedded; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2095 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java index 5dc741eff6..a8a3e22d2b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; public class Ticket2098 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java index 0f0c00b05c..2bba0504a5 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java @@ -6,7 +6,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java index 67c3c9f331..c29eaaf453 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Button; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2101 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java index 1fb89eebc4..9017f66158 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java @@ -5,7 +5,7 @@ import com.vaadin.data.Item; import com.vaadin.data.util.HierarchicalContainer; import com.vaadin.ui.Accordion; import com.vaadin.ui.Component; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java index b8a6724a41..4da938351d 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java @@ -11,7 +11,7 @@ import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.Tree; @@ -68,16 +68,16 @@ public class Ticket2104 extends Application.LegacyApplication { main.addComponent(tree); tree.setImmediate(true); tree.setNullSelectionAllowed(false); - tree.addItem("Root 1"); + tree.addItem("UI 1"); tree.addItem("1. Child 1"); - tree.setParent("1. Child 1", "Root 1"); + tree.setParent("1. Child 1", "UI 1"); tree.addItem("1. Child 2"); - tree.setParent("1. Child 2", "Root 1"); - tree.addItem("Root 2"); + tree.setParent("1. Child 2", "UI 1"); + tree.addItem("UI 2"); tree.addItem("2. Child 1"); - tree.setParent("2. Child 1", "Root 2"); + tree.setParent("2. Child 1", "UI 2"); tree.addItem("2. Child 2"); - tree.setParent("2. Child 2", "Root 2"); + tree.setParent("2. Child 2", "UI 2"); tree.addContainerProperty("icon", ExternalResource.class, new ExternalResource( "http://www.itmill.com/res/images/itmill_logo.gif")); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java index 6edc625b39..9d6e198f03 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java @@ -6,7 +6,7 @@ import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2106 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java index 09ba9fac0b..37d570546b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java @@ -6,7 +6,7 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Validator; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket2107 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java index 8bbfe0cd07..d5b5041060 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java @@ -7,7 +7,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2117 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java index b563ec90ef..621b744aa8 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java @@ -8,7 +8,7 @@ import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Select; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java index b12a865e80..bc1f886418 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java @@ -5,7 +5,7 @@ import com.vaadin.data.util.MethodProperty; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.Table.CellStyleGenerator; import com.vaadin.ui.Table.ColumnGenerator; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java index c9e070bef4..d49c73ea5f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java @@ -5,7 +5,7 @@ import com.vaadin.data.util.IndexedContainer; import com.vaadin.ui.Button; import com.vaadin.ui.Component; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; /** diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java index c2fbe1b4f7..721bdf3c9f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java @@ -8,7 +8,7 @@ import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2151 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java index 23c5b0bcd5..b8f75fc279 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2157 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java index 6de42003b4..e64db69ced 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2178 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java index 31e1a9a0d6..622488dc0f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Validator; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket2179 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java index 7b993cdf24..fb9332d100 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; public class Ticket2180 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java index 44893eb531..ceba214dc5 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java @@ -12,7 +12,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java index b7817d2ed7..50b8a1f113 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java index 4caba62df2..24c4d6e8b9 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java @@ -26,7 +26,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Panel; import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.VerticalSplitPanel; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java index 3f0f35bb84..f622f093ee 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.data.Item; import com.vaadin.ui.Component; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.Table.CellStyleGenerator; import com.vaadin.ui.Table.ColumnGenerator; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java index a387781ae3..ecad9a950a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java @@ -7,7 +7,7 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.ComboBox; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2209 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java index 226df8b5e7..6eec0a7704 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java @@ -6,7 +6,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2209OL extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java index 921f3b190b..7f4082d0f8 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java @@ -6,7 +6,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2209OL2 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java index 5b98fe3af3..f7099d88f4 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.themes.Reindeer; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java index 886aa376c3..e3f1516fb8 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java @@ -9,7 +9,7 @@ import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Layout; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java index 51ac463a6e..14024fda8b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java @@ -5,7 +5,7 @@ import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2222 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java index e436bab283..f9c670708e 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java @@ -5,7 +5,7 @@ import com.vaadin.data.Item; import com.vaadin.ui.Component; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java index ab0cc82628..21994bff60 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2231 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java index ae8a4b0f51..d71134696f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java @@ -6,7 +6,7 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.SpacingHandler; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2232 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java index 24a6d2ea77..ccda59bb6a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.data.Item; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2234 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java index 10978cad30..fba82956e0 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextArea; public class Ticket2235 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java index c777d0772f..bb16a40cd7 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket2240 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java index 4b44ed1a87..77fbfefe1a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java @@ -10,7 +10,7 @@ import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class Ticket2242 extends Application.LegacyApplication implements diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java index a360760039..495e3de26a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java @@ -8,7 +8,7 @@ import com.vaadin.ui.Form; import com.vaadin.ui.FormLayout; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2244 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java index 1586a1966b..ab474fe6f7 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2245 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java index b5d6772e7f..41843a9742 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java @@ -6,7 +6,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2267 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java index fb281f22b2..91fb51034b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2271 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java index c72b4e15ff..976b06fe32 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.FormLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2282 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java index 8375ca648f..5576e48fba 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.Alignment; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2283 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java index 716c8af0db..59fc174215 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java @@ -4,7 +4,7 @@ import java.net.URL; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2287 extends Ticket2292 { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java index 0ad023450c..c715fafd74 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java @@ -7,7 +7,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java index 35e9b8f2c5..e732ea09e0 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java @@ -19,7 +19,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; import com.vaadin.ui.Link; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2292 extends com.vaadin.Application.LegacyApplication implements RequestHandler { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java index 30392a245d..053534191b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Alignment; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2294 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java index 31ff4a8353..d059b96953 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2296 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java index 1d1f0f1d74..073126ae07 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java @@ -6,7 +6,7 @@ import java.net.URL; import com.vaadin.ui.CustomLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2297 extends Ticket2292 { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java index bc11a7ea49..fb1c5440ad 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java @@ -6,7 +6,7 @@ import java.io.IOException; import com.vaadin.Application; import com.vaadin.ui.CustomLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2303 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java index b767b3661f..ccef7a9a92 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.themes.Reindeer; public class Ticket2304 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java index 1cad5bde4f..24fbd7a968 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.themes.Reindeer; public class Ticket2310 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java index ec6d3be801..438d2ff286 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java @@ -6,7 +6,7 @@ import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.VerticalSplitPanel; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java index 123c154e61..d7b8db86bd 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; public class Ticket2323 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java index c253eb70e6..ecc897d4ba 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextArea; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java index f583a4af4b..2ce42376f9 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Component; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.Table.ColumnGenerator; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java index f0cae1a59f..3ac381b2d1 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2337 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java index 81dc3af40f..ce884bada7 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java @@ -6,7 +6,7 @@ import java.io.IOException; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2339 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java index a35c27962f..aa2eefcb7e 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.data.Item; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class Ticket2341 extends com.vaadin.Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java index d7b1eacd2c..befad78a73 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java @@ -4,7 +4,7 @@ import java.util.Random; import com.vaadin.Application; import com.vaadin.ui.Button; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.themes.BaseTheme; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java index 5528dfebd6..582b9a95ee 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2347 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java index 8039609339..f7d6f61110 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Form; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Select; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java index 252406cc2d..b191901356 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; public class Ticket2365 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java index 054cc5f0cc..f5b68800e6 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.data.util.IndexedContainer; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class Ticket2398 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java index 0da70301d1..30f9d04d3b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2404 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java index c5ef9ec0b0..a76f3a711f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java @@ -9,7 +9,7 @@ import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Label; import com.vaadin.ui.Layout.MarginHandler; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java index 0036bdc7b2..dd42727591 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java index 51ab08188e..df2ae47acd 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.ui.Form; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java index 6801bfa88d..2c59493e0c 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2411 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java index 509f4cf437..f52c1b1ccc 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket2415 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java index adca729c9e..5d15107053 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2420 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java index 8c9be295a0..140fa6f2b6 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TabSheet; public class Ticket2425 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java index 40862e3ccd..fee74b73f7 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2426 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java index f6e6c1e7b5..cb9eb449bf 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java @@ -7,7 +7,7 @@ import com.vaadin.event.ShortcutAction; import com.vaadin.event.ShortcutAction.KeyCode; import com.vaadin.event.ShortcutAction.ModifierKey; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2431 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java index 2716038873..f21e6a6752 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java @@ -8,7 +8,7 @@ import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.AlignmentHandler; import com.vaadin.ui.Layout.SpacingHandler; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2432 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java index 79e383393f..6401a98763 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; public class Ticket2434 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java index f48cf7a79a..5367c24b01 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Component; import com.vaadin.ui.PopupView; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket2436 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java index 97d096405e..998fe75f8c 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; public class Ticket2526 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java index 1003ea1c66..733f6ac6f6 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java @@ -6,7 +6,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; /** * @author Risto Yrjänä / Vaadin Ltd. diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java index ab808501f7..c4352abefe 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.VerticalSplitPanel; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java index 2d2970d36e..0cd43533fd 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java @@ -23,7 +23,7 @@ import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.ListSelect; import com.vaadin.ui.Notification; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java b/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java index b6e01d912f..7973ffa496 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java @@ -6,7 +6,7 @@ import java.util.HashSet; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket34.java b/tests/testbench/com/vaadin/tests/tickets/Ticket34.java index e3b90c94b0..67db77a5af 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket34.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket34.java @@ -11,7 +11,7 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -95,7 +95,7 @@ public class Ticket34 extends Application.LegacyApplication { public void buttonClick(ClickEvent event) { String viewName = tf.getValue().toString(); // fragmentChangedListener will change the view if possible - event.getButton().getRoot().getPage().setFragment(viewName); + event.getButton().getUI().getPage().setFragment(viewName); } }); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java b/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java index 35f244e07f..6f8ade15c4 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java @@ -2,7 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; /** * #5053: Last ComboBox item may not be shown if null selection enabled diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java b/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java index 5902382d01..3102a0a56c 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java @@ -5,7 +5,7 @@ import com.vaadin.event.ShortcutAction.KeyCode; import com.vaadin.event.ShortcutListener; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; /** diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java b/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java index b7caa08b82..92cd0290d6 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket5952 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java b/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java index fef7061516..887652aee7 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java @@ -5,7 +5,7 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.util.ObjectProperty; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket677.java b/tests/testbench/com/vaadin/tests/tickets/Ticket677.java index ca55b8648c..1c66f67ca1 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket677.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket677.java @@ -17,7 +17,7 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket695.java b/tests/testbench/com/vaadin/tests/tickets/Ticket695.java index c62cee038c..e539f999b3 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket695.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket695.java @@ -7,7 +7,7 @@ import java.io.ObjectOutputStream; import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; @SuppressWarnings("serial") public class Ticket695 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket736.java b/tests/testbench/com/vaadin/tests/tickets/Ticket736.java index d871c8adc4..1176e87bb4 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket736.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket736.java @@ -15,7 +15,7 @@ import com.vaadin.ui.CheckBox; import com.vaadin.ui.Form; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; public class Ticket736 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java b/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java index 2f094f0bf8..24a98d42e3 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java @@ -11,14 +11,14 @@ import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; import com.vaadin.ui.Table; /** * Test for #8291 and #7666: NegativeArraySizeException when Table scrolled to * the end and its size reduced. */ -public class Ticket8291 extends Root { +public class Ticket8291 extends UI { @Override public void init(WrappedRequest request) { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket846.java b/tests/testbench/com/vaadin/tests/tickets/Ticket846.java index 413d823d2d..407663c6c6 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket846.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket846.java @@ -5,7 +5,7 @@ import com.vaadin.data.util.MethodProperty; import com.vaadin.data.validator.IntegerValidator; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; public class Ticket846 extends Application.LegacyApplication { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket932.java b/tests/testbench/com/vaadin/tests/tickets/Ticket932.java index f72ff8beec..c12e2fcad3 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket932.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket932.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/util/SampleDirectory.java b/tests/testbench/com/vaadin/tests/util/SampleDirectory.java index 8f3f85a075..788415d0fd 100644 --- a/tests/testbench/com/vaadin/tests/util/SampleDirectory.java +++ b/tests/testbench/com/vaadin/tests/util/SampleDirectory.java @@ -23,7 +23,7 @@ import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.terminal.SystemError; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; /** * Provides sample directory based on application directory. If this fails then @@ -41,7 +41,7 @@ public class SampleDirectory { * @param application * @return file pointing to sample directory */ - public static File getDirectory(Application application, Root root) { + public static File getDirectory(Application application, UI uI) { String errorMessage = "Access to application " + "context base directory failed, " + "possible security constraint with Application " @@ -79,9 +79,9 @@ public class SampleDirectory { "Cannot provide sample directory")); errorPanel.addComponent(new Label(errorMessage, ContentMode.XHTML)); // Remove all components from applications main window - root.getContent().removeAllComponents(); + uI.getContent().removeAllComponents(); // Add error panel - root.getContent().addComponent(errorPanel); + uI.getContent().addComponent(errorPanel); return null; } } diff --git a/tests/testbench/com/vaadin/tests/util/TestUtils.java b/tests/testbench/com/vaadin/tests/util/TestUtils.java index a9e1518c54..62f2cc0be3 100644 --- a/tests/testbench/com/vaadin/tests/util/TestUtils.java +++ b/tests/testbench/com/vaadin/tests/util/TestUtils.java @@ -2,7 +2,7 @@ package com.vaadin.tests.util; import com.vaadin.data.Item; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class TestUtils { @@ -102,7 +102,7 @@ public class TestUtils { * * @param cssString */ - public static void injectCSS(Root w, String cssString) { + public static void injectCSS(UI w, String cssString) { String script = "if ('\\v'=='v') /* ie only */ {\n" + " document.createStyleSheet().cssText = '" + cssString diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModify.html b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.html index 8888f95d15..e6fafb14fa 100644 --- a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModify.html +++ b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.html @@ -13,13 +13,13 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.vaadincontext.BootstrapModifyRoot?restartApplication</td> + <td>/run/com.vaadin.tests.vaadincontext.BootstrapModifyUI?restartApplication</td> <td></td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestsvaadincontextBootstrapModifyRoot::/VVerticalLayout[0]/VLabel[0]</td> - <td>There should be two additional divs in the HTML of the bootstrap page for this Root</td> + <td>vaadin=runcomvaadintestsvaadincontextBootstrapModifyUI::/VVerticalLayout[0]/VLabel[0]</td> + <td>There should be two additional divs in the HTML of the bootstrap page for this UI</td> </tr> <tr> <td>assertText</td> diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyRoot.java b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java index 6c17c3005e..c197bbde5d 100644 --- a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyRoot.java +++ b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java @@ -17,9 +17,9 @@ package com.vaadin.tests.vaadincontext; import com.vaadin.terminal.WrappedRequest; -import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.tests.components.AbstractTestUI; -public class BootstrapModifyRoot extends AbstractTestRoot { +public class BootstrapModifyUI extends AbstractTestUI { @Override protected void setup(WrappedRequest request) { @@ -29,7 +29,7 @@ public class BootstrapModifyRoot extends AbstractTestRoot { @Override protected String getTestDescription() { - return "There should be two additional divs in the HTML of the bootstrap page for this Root"; + return "There should be two additional divs in the HTML of the bootstrap page for this UI"; } @Override diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java b/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java index da058892b4..9cd67e24b6 100644 --- a/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java +++ b/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java @@ -25,7 +25,7 @@ import com.vaadin.terminal.gwt.server.BootstrapPageResponse; import com.vaadin.terminal.gwt.server.BootstrapResponse; import com.vaadin.terminal.gwt.server.AddonContextEvent; import com.vaadin.terminal.gwt.server.AddonContextListener; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class TestAddonContextListener implements AddonContextListener { @Override @@ -42,9 +42,9 @@ public class TestAddonContextListener implements AddonContextListener { } private boolean shouldModify(BootstrapResponse response) { - Root root = response.getRoot(); - boolean shouldModify = root != null - && root.getClass() == BootstrapModifyRoot.class; + UI uI = response.getUI(); + boolean shouldModify = uI != null + && uI.getClass() == BootstrapModifyUI.class; return shouldModify; } diff --git a/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java b/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java index 7b03bc7ec2..b63527ad60 100644 --- a/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java +++ b/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java @@ -2,7 +2,7 @@ package com.vaadin.tests.validation; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Form; -import com.vaadin.ui.Root.LegacyWindow; +import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/widgetset/TestingWidgetSet.java b/tests/testbench/com/vaadin/tests/widgetset/TestingWidgetSet.java new file mode 100644 index 0000000000..0464a53a95 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/TestingWidgetSet.java @@ -0,0 +1,21 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.widgetset; + +public class TestingWidgetSet { + public static final String NAME = "com.vaadin.tests.widgetset.TestingWidgetSet"; +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/DelegateConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/DelegateConnector.java new file mode 100644 index 0000000000..c711be232f --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/DelegateConnector.java @@ -0,0 +1,34 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.widgetset.client; + +import com.vaadin.shared.ui.Connect; +import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector; +import com.vaadin.tests.widgetset.server.DelegateToWidgetComponent; + +@Connect(DelegateToWidgetComponent.class) +public class DelegateConnector extends AbstractComponentConnector { + @Override + public DelegateWidget getWidget() { + return (DelegateWidget) super.getWidget(); + } + + @Override + public DelegateState getState() { + return (DelegateState) super.getState(); + } +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/DelegateState.java b/tests/testbench/com/vaadin/tests/widgetset/client/DelegateState.java new file mode 100644 index 0000000000..e9ac8a1e61 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/DelegateState.java @@ -0,0 +1,50 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.widgetset.client; + +import com.vaadin.shared.ComponentState; +import com.vaadin.shared.annotations.DelegateToWidget; + +public class DelegateState extends ComponentState { + @DelegateToWidget + public String value1; + + @DelegateToWidget("setValue2") + public int renamedValue2; + + private Boolean value3; + + private double renamedValue4; + + @DelegateToWidget + public void setValue3(Boolean value3) { + this.value3 = value3; + } + + public Boolean getValue3() { + return value3; + } + + @DelegateToWidget("setValue4") + public void setRenamedValue4(double renamedValue4) { + this.renamedValue4 = renamedValue4; + } + + public double getRenamedValue4() { + return renamedValue4; + } +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/DelegateWidget.java b/tests/testbench/com/vaadin/tests/widgetset/client/DelegateWidget.java new file mode 100644 index 0000000000..4776eced9a --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/DelegateWidget.java @@ -0,0 +1,50 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.widgetset.client; + +import com.google.gwt.user.client.ui.HTML; + +public class DelegateWidget extends HTML { + private String value1; + private int value2; + private Boolean value3; + private double value4; + + public void setValue1(String value1) { + this.value1 = value1; + updateText(); + } + + public void setValue2(int value2) { + this.value2 = value2; + updateText(); + } + + public void setValue3(Boolean value3) { + this.value3 = value3; + updateText(); + } + + public void setValue4(double value4) { + this.value4 = value4; + } + + private void updateText() { + setHTML(value1 + "<br />" + value2 + "<br />" + value3 + "<br />" + + value4 + "<br />"); + } +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java b/tests/testbench/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java new file mode 100644 index 0000000000..34c9699f7f --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java @@ -0,0 +1,35 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.widgetset.server; + +import com.vaadin.tests.widgetset.client.DelegateState; +import com.vaadin.ui.AbstractComponent; + +public class DelegateToWidgetComponent extends AbstractComponent { + public DelegateToWidgetComponent() { + DelegateState state = getState(); + state.value1 = "My String"; + state.renamedValue2 = 42; + state.setValue3(Boolean.TRUE); + state.setRenamedValue4(Math.PI); + } + + @Override + protected DelegateState getState() { + return (DelegateState) super.getState(); + } +} |