From fb8c447ca2f78923600426a76dba99e7875c4dc5 Mon Sep 17 00:00:00 2001
From: John Alhroos
* Note that this theme can be overridden for a specific root with
- * {@link Application#getThemeForRoot(Root)}. Setting theme to be
+ * {@link Application#getThemeForRoot(UI)}. Setting theme to be
*
* Note that removing window from the application does not close the
* browser window - the window is only removed from the server-side.
*
* TODO Investigate whether this might be derived from the different states
* in getRootForRrequest.
@@ -1844,7 +1844,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
*
- * If {@link BrowserDetails} are required to create a Root, the
+ * If {@link BrowserDetails} are required to create a UI, 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
@@ -1854,10 +1854,10 @@ public class Application implements Terminal.ErrorListener, Serializable {
*
*
* The default implementation in {@link Application} creates a new instance
- * of the Root class returned by {@link #getRootClassName(WrappedRequest)},
+ * of the UI 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.
+ * returns a {@link ClassLoader}, it is used for loading the UI class.
* Otherwise the {@link ClassLoader} used to load this class is used.
*
* Please note that this method can also return a newly created
- *
+
+
+
+
--
cgit v1.2.3
From 38ffd4a097094a01c35fbd5b79563e6c8ea02e92 Mon Sep 17 00:00:00 2001
From: Leif Åstrand
+
+New Test
+
+open
+ /run/com.vaadin.tests.components.table.CtrlShiftMultiselect?restartApplication
+
+
+
+mouseClick
+ 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]
+ 112,12
+
+
+mouseClick
+ 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]
+ 82,16:shift
+
+
+drag
+ 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]
+ 87,1
+
+
+mouseMoveAt
+ vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]
+ 700,210
+
+
+screenCapture
+
+ multiple-rows-dragged
+
+
+
+drop
+ vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]
+ 700,210
+
+
+
+
+
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..54170c880f
--- /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.AbstractTestRoot;
+import com.vaadin.tests.widgetset.TestingWidgetSet;
+import com.vaadin.tests.widgetset.server.DelegateToWidgetComponent;
+
+@Widgetset(TestingWidgetSet.NAME)
+public class DelegateToWidgetTest extends AbstractTestRoot {
+ @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/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 + "
+
+New Test
+
+open
+ /run/com.vaadin.tests.serialization.DelegateToWidgetTest?restartApplication
+
+
+
+assertText
+ vaadin=runcomvaadintestsserializationDelegateToWidgetTest::/VVerticalLayout[0]/VVerticalLayout[0]/DelegateWidget[0]
+ My String
+
42
true
3.141592653589793
" + value2 + "
" + value3 + "
"
+ + value4 + "
");
+ }
+}
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();
+ }
+}
--
cgit v1.2.3
From 58cec95f137f1f7d464c5dde8198245c10a4e32e Mon Sep 17 00:00:00 2001
From: Leif Åstrand
+
+
+
+
diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java
index 6a873a6be3..110475e5a9 100644
--- a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java
+++ b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java
@@ -19,10 +19,11 @@ 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.widgetset.TestingWidgetSet;
import com.vaadin.tests.widgetset.server.DummyLabel;
import com.vaadin.ui.Label;
-@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+@Widgetset(TestingWidgetSet.NAME)
public class SerializerNamespaceTest extends AbstractTestRoot {
@Override
@@ -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
--
cgit v1.2.3
From da176c32c4d92676424021712a7f6d7ee8cedf76 Mon Sep 17 00:00:00 2001
From: Artur Signell
+
+New Test
+
+open
+ /run/com.vaadin.tests.serialization.SerializerNamespaceTest?restartApplication
+
+
+
+assertText
+ vaadin=runcomvaadintestsserializationSerializerNamespaceTest::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]
+ The real label
+
+
+assertText
+ vaadin=runcomvaadintestsserializationSerializerNamespaceTest::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]
+ The dummy label
+null
selects the default theme. For the available theme
* names, see the contents of the VAADIN/themes directory.
* null
is returned.
*
@@ -272,7 +272,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
*/
@Override
- public String getThemeForRoot(Root root) {
+ public String getThemeForRoot(UI uI) {
return theme;
}
@@ -288,7 +288,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
* @return a root corresponding to the name, or null
to use
* the default window
*/
- public Root.LegacyWindow getWindow(String name) {
+ public UI.LegacyWindow getWindow(String name) {
return legacyRootNames.get(name);
}
@@ -299,42 +299,42 @@ public class Application implements Terminal.ErrorListener, Serializable {
/**
* 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
+ * @param uI
* the root 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) {
+ public void addWindow(UI.LegacyWindow uI) {
+ if (uI.getName() == null) {
String name = Integer.toString(namelessRootIndex++);
- root.setName(name);
+ uI.setName(name);
}
- legacyRootNames.put(root.getName(), root);
- root.setApplication(this);
+ legacyRootNames.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)}.
+ * {@link #addWindow(UI, String) and #getWindowName(UI)}.
*
* null
if the default theme
* should be used
*
* @since 7.0
*/
- public String getThemeForRoot(Root root) {
- Theme rootTheme = getAnnotationFor(root.getClass(), Theme.class);
+ public String getThemeForRoot(UI uI) {
+ Theme rootTheme = getAnnotationFor(uI.getClass(), Theme.class);
if (rootTheme != null) {
return rootTheme.value();
} else {
@@ -1922,15 +1922,15 @@ public class Application implements Terminal.ErrorListener, Serializable {
*
* TODO Tell what the default implementation does once it does something.
*
- * @param root
+ * @param uI
* the root to get a widgetset for
* @return the name of the widgetset, or null
if the default
* widgetset should be used
*
* @since 7.0
*/
- public String getWidgetsetForRoot(Root root) {
- Widgetset rootWidgetset = getAnnotationFor(root.getClass(),
+ public String getWidgetsetForRoot(UI uI) {
+ Widgetset rootWidgetset = getAnnotationFor(uI.getClass(),
Widgetset.class);
if (rootWidgetset != null) {
return rootWidgetset.value();
@@ -2148,16 +2148,16 @@ public class Application implements Terminal.ErrorListener, Serializable {
}
/**
- * Finds the {@link Root} to which a particular request belongs. If the
- * request originates from an existing Root, that root is returned. In other
+ * Finds the {@link UI} to which a particular request belongs. If the
+ * request originates from an existing UI, 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
* information is not available.
* Root
which has not yet been initialized. You can use
+ * UI
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
+ * {@link UI#getRootId()} to check whether the initialization is still
* pending.
*
true
if the same Root instance should be reused
+ * true
if the same UI instance should be reused
* e.g. when the browser window is refreshed.
*/
public void setRootPreserved(boolean rootPreserved) {
@@ -2297,12 +2297,12 @@ public class Application implements Terminal.ErrorListener, Serializable {
}
/**
- * 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 true
if the same Root instance should be reused e.g.
+ * @return true
if the same UI instance should be reused e.g.
* when the browser window is refreshed.
*/
public boolean isRootPreserved() {
@@ -2326,21 +2326,21 @@ public class Application implements Terminal.ErrorListener, Serializable {
}
/**
- * 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
+ * is no way to manually remove a root. 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 roots is planned for an upcoming alpha release of
+ * 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* This is meant for framework internal use. *
@@ -2371,8 +2371,8 @@ public class Application implements Terminal.ErrorListener, Serializable { * The root id * @return The root with the given id or null if not found */ - public Root getRootById(int rootId) { - return roots.get(rootId); + public UI getRootById(int rootId) { + return uIs.get(rootId); } /** 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/terminal/AbstractClientConnector.java b/server/src/com/vaadin/terminal/AbstractClientConnector.java index d2490225fb..87e1dbaa38 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 = getRoot(); + 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 = getRoot(); + if (uI != null && !uI.getConnectorTracker().isDirty(this)) { requestRepaint(); } @@ -363,28 +363,28 @@ public abstract class AbstractClientConnector implements ClientConnector { * @return The connector's application, ornull
if not attached
*/
protected Application getApplication() {
- Root root = getRoot();
- if (root == null) {
+ UI uI = getRoot();
+ if (uI == null) {
return null;
} else {
- return root.getApplication();
+ return uI.getApplication();
}
}
/**
- * Finds a Root ancestor of this connector. null
is returned if
- * no Root ancestor is found (typically because the connector is not
+ * Finds a UI ancestor of this connector. null
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 null
if none
+ * @return the UI ancestor of this connector, or null
if none
* is found.
*/
@Override
- public Root getRoot() {
+ public UI getRoot() {
ClientConnector connector = this;
while (connector != null) {
- if (connector instanceof Root) {
- return (Root) connector;
+ if (connector instanceof UI) {
+ return (UI) connector;
}
connector = connector.getParent();
}
diff --git a/server/src/com/vaadin/terminal/AbstractRootProvider.java b/server/src/com/vaadin/terminal/AbstractRootProvider.java
index 0b63003440..b340c62448 100644
--- a/server/src/com/vaadin/terminal/AbstractRootProvider.java
+++ b/server/src/com/vaadin/terminal/AbstractRootProvider.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 {
@Override
- public Root instantiateRoot(Application application,
- Class extends Root> type, WrappedRequest request) {
+ public UI instantiateRoot(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/DefaultRootProvider.java
index cbf8c98828..07533949a0 100644
--- a/server/src/com/vaadin/terminal/DefaultRootProvider.java
+++ b/server/src/com/vaadin/terminal/DefaultRootProvider.java
@@ -18,12 +18,12 @@ package com.vaadin.terminal;
import com.vaadin.Application;
import com.vaadin.RootRequiresMoreInformationException;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
public class DefaultRootProvider extends AbstractRootProvider {
@Override
- public Class extends Root> getRootClass(Application application,
+ public Class extends UI> getRootClass(Application application,
WrappedRequest request) throws RootRequiresMoreInformationException {
Object rootClassNameObj = application
.getProperty(Application.ROOT_PARAMETER);
@@ -37,8 +37,8 @@ public class DefaultRootProvider extends AbstractRootProvider {
classLoader = getClass().getClassLoader();
}
try {
- Class extends Root> rootClass = Class.forName(rootClassName,
- true, classLoader).asSubclass(Root.class);
+ Class extends UI> rootClass = Class.forName(rootClassName,
+ true, classLoader).asSubclass(UI.class);
return rootClass;
} catch (ClassNotFoundException e) {
diff --git a/server/src/com/vaadin/terminal/DeploymentConfiguration.java b/server/src/com/vaadin/terminal/DeploymentConfiguration.java
index 14a5a3724f..8da088969d 100644
--- a/server/src/com/vaadin/terminal/DeploymentConfiguration.java
+++ b/server/src/com/vaadin/terminal/DeploymentConfiguration.java
@@ -97,7 +97,7 @@ public interface DeploymentConfiguration extends Serializable {
/**
* Get the class loader to use for loading classes loaded by name, e.g.
- * custom Root classes. null
indicates that the default class
+ * custom UI classes. null
indicates that the default class
* loader should be used.
*
* @return the class loader to use, or null
diff --git a/server/src/com/vaadin/terminal/Page.java b/server/src/com/vaadin/terminal/Page.java
index 41ab8cc8b6..95f9a7b3ec 100644
--- a/server/src/com/vaadin/terminal/Page.java
+++ b/server/src/com/vaadin/terminal/Page.java
@@ -33,19 +33,19 @@ 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;
@@ -515,15 +515,15 @@ public class Page implements Serializable {
}
/**
- * 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 LinkedListnull
*/
public static Page getCurrent() {
- Root currentRoot = Root.getCurrent();
+ UI currentRoot = UI.getCurrent();
if (currentRoot == null) {
return null;
}
@@ -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/RootProvider.java
index 476cf1bd78..53173b6b94 100644
--- a/server/src/com/vaadin/terminal/RootProvider.java
+++ b/server/src/com/vaadin/terminal/RootProvider.java
@@ -18,12 +18,12 @@ package com.vaadin.terminal;
import com.vaadin.Application;
import com.vaadin.RootRequiresMoreInformationException;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
public interface RootProvider {
- public Class extends Root> getRootClass(Application application,
+ public Class extends UI> getRootClass(Application application,
WrappedRequest request) throws RootRequiresMoreInformationException;
- public Root instantiateRoot(Application application,
- Class extends Root> type, WrappedRequest request);
+ public UI instantiateRoot(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..1186d678b0 100644
--- a/server/src/com/vaadin/terminal/WrappedRequest.java
+++ b/server/src/com/vaadin/terminal/WrappedRequest.java
@@ -30,7 +30,7 @@ import com.vaadin.Application;
import com.vaadin.RootRequiresMoreInformationException;
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.
@@ -221,7 +221,7 @@ public interface WrappedRequest extends Serializable {
* 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
+ * {@link UI#init(WrappedRequest)} for a UI class not annotated with
* {@link EagerInit}
*
* @return the browser details, or null
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..2315a9c1d6 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
@@ -62,7 +62,7 @@ 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
@@ -488,17 +488,17 @@ 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
+ uI = application
.getRootForRequest(wrappedRequest);
} catch (RootRequiresMoreInformationException e) {
// Ignore problem and continue without root
@@ -516,7 +516,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
// root = application.getRoot();
break;
default:
- root = application
+ uI = application
.getRootForRequest(wrappedRequest);
}
// if window not found, not a problem - use null
@@ -527,25 +527,25 @@ 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,
+ 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 +557,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 {
/*
@@ -599,7 +599,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
}
} finally {
- Root.setCurrent(null);
+ UI.setCurrent(null);
Application.setCurrent(null);
PortletSession session = request
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
index 062ba6cdf7..b17ef20cde 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
@@ -314,18 +314,18 @@ 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) {
+ UI uI = application.getRootForRequest(request);
+ if (uI == null) {
throw new ServletException(ERROR_NO_ROOT_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
@@ -369,7 +369,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);
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index b2436b2ce4..39475f3131 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -97,7 +97,7 @@ 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;
/**
@@ -506,7 +506,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 +520,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 +528,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 +550,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,7 +567,7 @@ 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");
@@ -580,7 +580,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
}
// 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 +611,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 +645,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) {
Iteratornull
if
- * no Root instance is yet available.
+ * no UI instance is yet available.
*
* @see Application#isRootPreserved()
* @see Application#getRoot(WrappedRequest)
* @see RootRequiresMoreInformationException
*
- * @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
* null
if all required information is not yet
* available.
*/
- public Root getRoot() {
- return Root.getCurrent();
+ public UI getRoot() {
+ 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..3a18dbd6f4 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
@@ -177,10 +177,10 @@ public interface ClientConnector extends Connector, RpcTarget {
/**
* Returns the root 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 getRoot();
/**
* 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/DragAndDropService.java b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java
index 221598171c..42312b72fd 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 getRoot() {
return null;
}
diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java b/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
index eba7d6e3a3..a5a3e94954 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
- * 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, null
is returned.
*
null
if it is not
- * attached to a Root
+ * @return the UI of the component or null
if it is not
+ * attached to a UI
*/
@Override
- public Root getRoot();
+ public UI getRoot();
/**
* Gets the application object to which the component is attached.
@@ -574,8 +574,8 @@ public interface Component extends ClientConnector, Sizeable, Serializable {
* {@link #setParent(Component)}.
*
* - * 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. *
* * diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java index 72879e0a25..3a6e1e4ea8 100644 --- a/server/src/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/com/vaadin/ui/ConnectorTracker.java @@ -30,7 +30,7 @@ import com.vaadin.terminal.gwt.server.ClientConnector; /** * A class which takes care of book keeping of {@link ClientConnector}s for a - * Root. + * UI. *
* 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 +54,7 @@ public class ConnectorTracker implements Serializable {
private Set
- * The root 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. - *
- *- * 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. - *
- *- * After a root 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 - * passing a {@link ComponentContainer} with the main layout of the view to - * {@link #setContent(ComponentContainer)}. - *
- *
- * If a {@link EagerInit} annotation is present on a class extending
- * Root
, 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.
- *
- * The name also determines the URL that can be used for direct access - * to a window. All windows can be accessed through - * {@code http://host:port/app/win} where {@code http://host:port/app} - * is the application URL (as returned by {@link Application#getURL()} - * and {@code win} is the window name. - *
- *- * Note! Portlets do not support direct window access through URLs. - *
- * - * @return the Name of the Window. - */ - public String getName() { - return name; - } - - /** - * Sets the unique name of the window. The name of the window is used to - * uniquely identify it inside the application. - *- * The name also determines the URL that can be used for direct access - * to a window. All windows can be accessed through - * {@code http://host:port/app/win} where {@code http://host:port/app} - * is the application URL (as returned by {@link Application#getURL()} - * and {@code win} is the window name. - *
- *- * This method can only be called before the window is added to an - * application. - *
- * Note! Portlets do not support direct window access through URLs. - *
- * - * @param name - * the new name for the window or null if the application - * should automatically assign a name to it - * @throws IllegalStateException - * if the window is attached to an application - */ - public void setName(String name) { - this.name = name; - // The name can not be changed in application - if (getApplication() != null) { - throw new IllegalStateException( - "Window name can not be changed while " - + "the window is in application"); - } - - } - - /** - * Gets the full URL of the window. The returned URL is window specific - * and can be used to directly refer to the window. - *- * Note! This method can not be used for portlets. - *
- * - * @return the URL of the window or null if the window is not attached - * to an application - */ - public URL getURL() { - Application application = getApplication(); - if (application == null) { - return null; - } - - try { - return new URL(application.getURL(), getName() + "/"); - } catch (MalformedURLException e) { - throw new RuntimeException( - "Internal problem getting window URL, please report"); - } - } - - /** - * Opens the given resource in this root. The contents of this Root is - * replaced by the {@code Resource}. - * - * @param resource - * the resource to show in this root - * - * @deprecated As of 7.0, use getPage().open instead - */ - @Deprecated - public void open(Resource resource) { - getPage().open(resource); - } - - /* ********************************************************************* */ - - /** - * Opens the given resource in a window with the given name. - *
- * The supplied {@code windowName} is used as the target name in a
- * window.open call in the client. This means that special values such
- * as "_blank", "_self", "_top", "_parent" have special meaning. An
- * empty or null
window name is also a special case.
- *
- * "", null and "_self" as {@code windowName} all causes the resource to - * be opened in the current window, replacing any old contents. For - * downloadable content you should avoid "_self" as "_self" causes the - * client to skip rendering of any other changes as it considers them - * irrelevant (the page will be replaced by the resource). This can - * speed up the opening of a resource, but it might also put the client - * side into an inconsistent state if the window content is not - * completely replaced e.g., if the resource is downloaded instead of - * displayed in the browser. - *
- *- * "_blank" as {@code windowName} causes the resource to always be - * opened in a new window or tab (depends on the browser and browser - * settings). - *
- *- * "_top" and "_parent" as {@code windowName} works as specified by the - * HTML standard. - *
- *- * Any other {@code windowName} will open the resource in a window with - * that name, either by opening a new window/tab in the browser or by - * replacing the contents of an existing window with that name. - *
- * - * @param resource - * the resource. - * @param windowName - * the name of the window. - * @deprecated As of 7.0, use getPage().open instead - */ - @Deprecated - public void open(Resource resource, String windowName) { - getPage().open(resource, windowName); - } - - /** - * Opens the given resource in a window with the given size, border and - * name. For more information on the meaning of {@code windowName}, see - * {@link #open(Resource, String)}. - * - * @param resource - * the resource. - * @param windowName - * the name of the window. - * @param width - * the width of the window in pixels - * @param height - * the height of the window in pixels - * @param border - * the border style of the window. - * @deprecated As of 7.0, use getPage().open instead - */ - @Deprecated - public void open(Resource resource, String windowName, int width, - int height, BorderStyle border) { - getPage().open(resource, windowName, width, height, border); - } - - /** - * Adds a new {@link BrowserWindowResizeListener} to this root. The - * listener will be notified whenever the browser window within which - * this root resides is resized. - * - * @param resizeListener - * the listener to add - * - * @see BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent) - * @see #setResizeLazy(boolean) - * - * @deprecated As of 7.0, use the similarly named api in Page instead - */ - @Deprecated - public void addListener(BrowserWindowResizeListener resizeListener) { - getPage().addListener(resizeListener); - } - - /** - * Removes a {@link BrowserWindowResizeListener} from this root. The - * listener will no longer be notified when the browser window is - * resized. - * - * @param resizeListener - * the listener to remove - * @deprecated As of 7.0, use the similarly named api in Page instead - */ - @Deprecated - public void removeListener(BrowserWindowResizeListener resizeListener) { - getPage().removeListener(resizeListener); - } - - /** - * Gets the last known height of the browser window in which this root - * resides. - * - * @return the browser window height in pixels - * @deprecated As of 7.0, use the similarly named api in Page instead - */ - @Deprecated - public int getBrowserWindowHeight() { - return getPage().getBrowserWindowHeight(); - } - - /** - * Gets the last known width of the browser window in which this root - * resides. - * - * @return the browser window width in pixels - * - * @deprecated As of 7.0, use the similarly named api in Page instead - */ - @Deprecated - public int getBrowserWindowWidth() { - return getPage().getBrowserWindowWidth(); - } - - /** - * Executes JavaScript in this window. - * - *- * This method allows one to inject javascript from the server to - * client. A client implementation is not required to implement this - * functionality, but currently all web-based clients do implement this. - *
- * - *- * Executing javascript this way often leads to cross-browser - * compatibility issues and regressions that are hard to resolve. Use of - * this method should be avoided and instead it is recommended to create - * new widgets with GWT. For more info on creating own, reusable - * client-side widgets in Java, read the corresponding chapter in Book - * of Vaadin. - *
- * - * @param script - * JavaScript snippet that will be executed. - * - * @deprecated as of 7.0, use JavaScript.getCurrent().execute(String) - * instead - */ - @Deprecated - public void executeJavaScript(String script) { - getPage().getJavaScript().execute(script); - } - - @Override - public void setCaption(String caption) { - // Override to provide backwards compatibility - getState().setCaption(caption); - getPage().setTitle(caption); - } - - } - - /** - * The application to which this root belongs - */ - private Application application; - - /** - * List of windows in this root. - */ - private final LinkedHashSetnull
application.
- * - * This method is mainly intended for internal use by the framework. - *
- * - * @param application - * the application to set - * - * @throws IllegalStateException - * if the application has already been set - * - * @see #getApplication() - */ - public void setApplication(Application application) { - if ((application == null) == (this.application == null)) { - throw new IllegalStateException("Application has already been set"); - } else { - this.application = application; - } - - if (application != null) { - attach(); - } else { - detach(); - } - } - - /** - * Sets the id of this root within its application. The root id is used to - * route requests to the right root. - *- * This method is mainly intended for internal use by the framework. - *
- * - * @param rootId - * the id of this root - * - * @throws IllegalStateException - * if the root id has already been set - * - * @see #getRootId() - */ - public void setRootId(int rootId) { - if (this.rootId != -1) { - throw new IllegalStateException("Root id has already been defined"); - } - this.rootId = rootId; - } - - /** - * 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. - * - * @return - */ - public int getRootId() { - return rootId; - } - - /** - * 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 - * pointing to this application and ensure - * {@link Application#getRoot(WrappedRequest)} returns an appropriate root - * for the request. - * - * @param window - * @throws IllegalArgumentException - * if the window is already added to an application - * @throws NullPointerException - * if the givenWindow
is null
.
- */
- public void addWindow(Window window) throws IllegalArgumentException,
- NullPointerException {
-
- if (window == null) {
- throw new NullPointerException("Argument must not be null");
- }
-
- if (window.getApplication() != null) {
- throw new IllegalArgumentException(
- "Window is already attached to an application.");
- }
-
- attachWindow(window);
- }
-
- /**
- * Helper method to attach a window.
- *
- * @param w
- * the window to add
- */
- private void attachWindow(Window w) {
- windows.add(w);
- w.setParent(this);
- markAsDirty();
- }
-
- /**
- * Remove the given subwindow from this root.
- *
- * Since Vaadin 6.5, {@link CloseListener}s are called also when explicitly
- * removing a window by calling this method.
- *
- * Since Vaadin 6.5, returns a boolean indicating if the window was removed
- * or not.
- *
- * @param window
- * Window to be removed.
- * @return true if the subwindow was removed, false otherwise
- */
- public boolean removeWindow(Window window) {
- if (!windows.remove(window)) {
- // Window window is not a subwindow of this root.
- return false;
- }
- window.setParent(null);
- window.fireClose();
- markAsDirty();
-
- return true;
- }
-
- /**
- * Gets all the windows added to this root.
- *
- * @return an unmodifiable collection of windows
- */
- public Collection- * The {@link WrappedRequest} can be used to get information about the - * request that caused this root 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. - *
- * - * @param request - * the wrapped request that caused this root to be created - */ - protected abstract void init(WrappedRequest request); - - /** - * Sets the thread local for the current root. 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. - *- * The application developer can also use this method to define the current - * root outside the normal request handling, e.g. when initiating custom - * background threads. - *
- * - * @param root - * the root to register as the current root - * - * @see #getCurrent() - * @see ThreadLocal - */ - public static void setCurrent(Root root) { - currentRoot.set(root); - } - - /** - * 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. - * - * @return the current root instance if available, otherwise - *null
- *
- * @see #setCurrent(Root)
- */
- public static Root getCurrent() {
- return currentRoot.get();
- }
-
- public void setScrollTop(int scrollTop) {
- throw new RuntimeException("Not yet implemented");
- }
-
- @Override
- protected ActionManager getActionManager() {
- if (actionManager == null) {
- actionManager = new ActionManager(this);
- }
- return actionManager;
- }
-
- @Override
- public
- * Default value: false
- *
- * @param resizeLazy
- * true to use a delay before recalculating sizes, false to
- * calculate immediately.
- */
- public void setResizeLazy(boolean resizeLazy) {
- this.resizeLazy = resizeLazy;
- markAsDirty();
- }
-
- /**
- * Checks whether lazy resize is enabled.
- *
- * @return true
if lazy resize is enabled, false
- * if lazy resize is not enabled
- */
- public boolean isResizeLazy() {
- return resizeLazy;
- }
-
- /**
- * 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.
- *
- * 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 Root. 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);
- }
-
- @Override
- public boolean isConnectorEnabled() {
- // TODO How can a Root be invisible? What does it mean?
- return isVisible() && isEnabled();
- }
-
- public ConnectorTracker getConnectorTracker() {
- return connectorTracker;
- }
-
- public Page getPage() {
- return page;
- }
-
- /**
- * Setting the caption of a Root 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)}
- */
- @Override
- @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");
- }
-
- /**
- * Shows a notification message on the middle of the root. The message
- * automatically disappears ("humanized message").
- *
- * Care should be taken to to avoid XSS vulnerabilities as the caption is
- * rendered as html.
- *
- * @see #showNotification(Notification)
- * @see Notification
- *
- * @param caption
- * The message
- *
- * @deprecated As of 7.0, use Notification.show instead but be aware that
- * Notification.show does not allow HTML.
- */
- @Deprecated
- public void showNotification(String caption) {
- Notification notification = new Notification(caption);
- notification.setHtmlContentAllowed(true);// Backwards compatibility
- getPage().showNotification(notification);
- }
-
- /**
- * Shows a notification message the root. 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.
- *
- * Care should be taken to to avoid XSS vulnerabilities as the caption is
- * rendered as html.
- *
- * @see #showNotification(Notification)
- * @see Notification
- *
- * @param caption
- * The message
- * @param type
- * The message type
- *
- * @deprecated As of 7.0, use Notification.show instead but be aware that
- * Notification.show does not allow HTML.
- */
- @Deprecated
- public void showNotification(String caption, Notification.Type type) {
- Notification notification = new Notification(caption, type);
- notification.setHtmlContentAllowed(true);// Backwards compatibility
- getPage().showNotification(notification);
- }
-
- /**
- * Shows a notification consisting of a bigger caption and a smaller
- * description on the middle of the root. The message automatically
- * disappears ("humanized message").
- *
- * Care should be taken to to avoid XSS vulnerabilities as the caption and
- * description are rendered as html.
- *
- * @see #showNotification(Notification)
- * @see Notification
- *
- * @param caption
- * The caption of the message
- * @param description
- * The message description
- *
- * @deprecated As of 7.0, use new Notification(...).show(Page) instead but
- * be aware that HTML by default not allowed.
- */
- @Deprecated
- public void showNotification(String caption, String description) {
- Notification notification = new Notification(caption, description);
- notification.setHtmlContentAllowed(true);// Backwards compatibility
- getPage().showNotification(notification);
- }
-
- /**
- * Shows a notification consisting of a bigger caption and a smaller
- * description. 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.
- *
- * Care should be taken to to avoid XSS vulnerabilities as the caption and
- * description are rendered as html.
- *
- * @see #showNotification(Notification)
- * @see Notification
- *
- * @param caption
- * The caption of the message
- * @param description
- * The message description
- * @param type
- * The message type
- *
- * @deprecated As of 7.0, use new Notification(...).show(Page) instead but
- * be aware that HTML by default not allowed.
- */
- @Deprecated
- public void showNotification(String caption, String description,
- Notification.Type type) {
- Notification notification = new Notification(caption, description, type);
- notification.setHtmlContentAllowed(true);// Backwards compatibility
- getPage().showNotification(notification);
- }
-
- /**
- * Shows a notification consisting of a bigger caption and a smaller
- * description. 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.
- *
- * Care should be taken to avoid XSS vulnerabilities if html content is
- * allowed.
- *
- * @see #showNotification(Notification)
- * @see Notification
- *
- * @param caption
- * The message caption
- * @param description
- * The message description
- * @param type
- * The type of message
- * @param htmlContentAllowed
- * Whether html in the caption and description should be
- * displayed as html or as plain text
- *
- * @deprecated As of 7.0, use new Notification(...).show(Page).
- */
- @Deprecated
- public void showNotification(String caption, String description,
- Notification.Type type, boolean htmlContentAllowed) {
- getPage()
- .showNotification(
- new Notification(caption, description, type,
- htmlContentAllowed));
- }
-
- /**
- * Shows a notification message.
- *
- * @see Notification
- * @see #showNotification(String)
- * @see #showNotification(String, int)
- * @see #showNotification(String, String)
- * @see #showNotification(String, String, int)
- *
- * @param notification
- * The notification message to show
- *
- * @deprecated As of 7.0, use Notification.show instead
- */
- @Deprecated
- public void showNotification(Notification notification) {
- getPage().showNotification(notification);
- }
-
-}
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
new file mode 100644
index 0000000000..33eefff485
--- /dev/null
+++ b/server/src/com/vaadin/ui/UI.java
@@ -0,0 +1,1241 @@
+/*
+ * 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.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+
+import com.vaadin.Application;
+import com.vaadin.annotations.EagerInit;
+import com.vaadin.event.Action;
+import com.vaadin.event.Action.Handler;
+import com.vaadin.event.ActionManager;
+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.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.terminal.Page;
+import com.vaadin.terminal.Page.BrowserWindowResizeEvent;
+import com.vaadin.terminal.Page.BrowserWindowResizeListener;
+import com.vaadin.terminal.PaintException;
+import com.vaadin.terminal.PaintTarget;
+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;
+
+/**
+ * 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
+ * browser window (or tab) or some part of a html page where a Vaadin
+ * application is embedded.
+ *
+ * The root 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. + *
+ *+ * 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. + *
+ *+ * After a root 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 + * passing a {@link ComponentContainer} with the main layout of the view to + * {@link #setContent(ComponentContainer)}. + *
+ *
+ * If a {@link EagerInit} annotation is present on a class extending
+ * UI
, 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.
+ *
+ * The name also determines the URL that can be used for direct access + * to a window. All windows can be accessed through + * {@code http://host:port/app/win} where {@code http://host:port/app} + * is the application URL (as returned by {@link Application#getURL()} + * and {@code win} is the window name. + *
+ *+ * Note! Portlets do not support direct window access through URLs. + *
+ * + * @return the Name of the Window. + */ + public String getName() { + return name; + } + + /** + * Sets the unique name of the window. The name of the window is used to + * uniquely identify it inside the application. + *+ * The name also determines the URL that can be used for direct access + * to a window. All windows can be accessed through + * {@code http://host:port/app/win} where {@code http://host:port/app} + * is the application URL (as returned by {@link Application#getURL()} + * and {@code win} is the window name. + *
+ *+ * This method can only be called before the window is added to an + * application. + *
+ * Note! Portlets do not support direct window access through URLs. + *
+ * + * @param name + * the new name for the window or null if the application + * should automatically assign a name to it + * @throws IllegalStateException + * if the window is attached to an application + */ + public void setName(String name) { + this.name = name; + // The name can not be changed in application + if (getApplication() != null) { + throw new IllegalStateException( + "Window name can not be changed while " + + "the window is in application"); + } + + } + + /** + * Gets the full URL of the window. The returned URL is window specific + * and can be used to directly refer to the window. + *+ * Note! This method can not be used for portlets. + *
+ * + * @return the URL of the window or null if the window is not attached + * to an application + */ + public URL getURL() { + Application application = getApplication(); + if (application == null) { + return null; + } + + try { + return new URL(application.getURL(), getName() + "/"); + } catch (MalformedURLException e) { + throw new RuntimeException( + "Internal problem getting window URL, please report"); + } + } + + /** + * Opens the given resource in this root. The contents of this UI is + * replaced by the {@code Resource}. + * + * @param resource + * the resource to show in this root + * + * @deprecated As of 7.0, use getPage().open instead + */ + @Deprecated + public void open(Resource resource) { + getPage().open(resource); + } + + /* ********************************************************************* */ + + /** + * Opens the given resource in a window with the given name. + *
+ * The supplied {@code windowName} is used as the target name in a
+ * window.open call in the client. This means that special values such
+ * as "_blank", "_self", "_top", "_parent" have special meaning. An
+ * empty or null
window name is also a special case.
+ *
+ * "", null and "_self" as {@code windowName} all causes the resource to + * be opened in the current window, replacing any old contents. For + * downloadable content you should avoid "_self" as "_self" causes the + * client to skip rendering of any other changes as it considers them + * irrelevant (the page will be replaced by the resource). This can + * speed up the opening of a resource, but it might also put the client + * side into an inconsistent state if the window content is not + * completely replaced e.g., if the resource is downloaded instead of + * displayed in the browser. + *
+ *+ * "_blank" as {@code windowName} causes the resource to always be + * opened in a new window or tab (depends on the browser and browser + * settings). + *
+ *+ * "_top" and "_parent" as {@code windowName} works as specified by the + * HTML standard. + *
+ *+ * Any other {@code windowName} will open the resource in a window with + * that name, either by opening a new window/tab in the browser or by + * replacing the contents of an existing window with that name. + *
+ * + * @param resource + * the resource. + * @param windowName + * the name of the window. + * @deprecated As of 7.0, use getPage().open instead + */ + @Deprecated + public void open(Resource resource, String windowName) { + getPage().open(resource, windowName); + } + + /** + * Opens the given resource in a window with the given size, border and + * name. For more information on the meaning of {@code windowName}, see + * {@link #open(Resource, String)}. + * + * @param resource + * the resource. + * @param windowName + * the name of the window. + * @param width + * the width of the window in pixels + * @param height + * the height of the window in pixels + * @param border + * the border style of the window. + * @deprecated As of 7.0, use getPage().open instead + */ + @Deprecated + public void open(Resource resource, String windowName, int width, + int height, BorderStyle border) { + getPage().open(resource, windowName, width, height, border); + } + + /** + * Adds a new {@link BrowserWindowResizeListener} to this root. The + * listener will be notified whenever the browser window within which + * this root resides is resized. + * + * @param resizeListener + * the listener to add + * + * @see BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent) + * @see #setResizeLazy(boolean) + * + * @deprecated As of 7.0, use the similarly named api in Page instead + */ + @Deprecated + public void addListener(BrowserWindowResizeListener resizeListener) { + getPage().addListener(resizeListener); + } + + /** + * Removes a {@link BrowserWindowResizeListener} from this root. The + * listener will no longer be notified when the browser window is + * resized. + * + * @param resizeListener + * the listener to remove + * @deprecated As of 7.0, use the similarly named api in Page instead + */ + @Deprecated + public void removeListener(BrowserWindowResizeListener resizeListener) { + getPage().removeListener(resizeListener); + } + + /** + * Gets the last known height of the browser window in which this root + * resides. + * + * @return the browser window height in pixels + * @deprecated As of 7.0, use the similarly named api in Page instead + */ + @Deprecated + public int getBrowserWindowHeight() { + return getPage().getBrowserWindowHeight(); + } + + /** + * Gets the last known width of the browser window in which this root + * resides. + * + * @return the browser window width in pixels + * + * @deprecated As of 7.0, use the similarly named api in Page instead + */ + @Deprecated + public int getBrowserWindowWidth() { + return getPage().getBrowserWindowWidth(); + } + + /** + * Executes JavaScript in this window. + * + *+ * This method allows one to inject javascript from the server to + * client. A client implementation is not required to implement this + * functionality, but currently all web-based clients do implement this. + *
+ * + *+ * Executing javascript this way often leads to cross-browser + * compatibility issues and regressions that are hard to resolve. Use of + * this method should be avoided and instead it is recommended to create + * new widgets with GWT. For more info on creating own, reusable + * client-side widgets in Java, read the corresponding chapter in Book + * of Vaadin. + *
+ * + * @param script + * JavaScript snippet that will be executed. + * + * @deprecated as of 7.0, use JavaScript.getCurrent().execute(String) + * instead + */ + @Deprecated + public void executeJavaScript(String script) { + getPage().getJavaScript().execute(script); + } + + @Override + public void setCaption(String caption) { + // Override to provide backwards compatibility + getState().setCaption(caption); + getPage().setTitle(caption); + } + + } + + /** + * The application to which this root belongs + */ + private Application application; + + /** + * List of windows in this root. + */ + private final LinkedHashSetnull
application.
+ * + * This method is mainly intended for internal use by the framework. + *
+ * + * @param application + * the application to set + * + * @throws IllegalStateException + * if the application has already been set + * + * @see #getApplication() + */ + public void setApplication(Application application) { + if ((application == null) == (this.application == null)) { + throw new IllegalStateException("Application has already been set"); + } else { + this.application = application; + } + + if (application != null) { + attach(); + } else { + detach(); + } + } + + /** + * Sets the id of this root within its application. The root id is used to + * route requests to the right root. + *+ * This method is mainly intended for internal use by the framework. + *
+ * + * @param rootId + * the id of this root + * + * @throws IllegalStateException + * if the root id has already been set + * + * @see #getRootId() + */ + public void setRootId(int rootId) { + if (this.rootId != -1) { + throw new IllegalStateException("UI id has already been defined"); + } + this.rootId = rootId; + } + + /** + * 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. + * + * @return + */ + public int getRootId() { + return rootId; + } + + /** + * 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 + * pointing to this application and ensure + * {@link Application#getRoot(WrappedRequest)} returns an appropriate root + * for the request. + * + * @param window + * @throws IllegalArgumentException + * if the window is already added to an application + * @throws NullPointerException + * if the givenWindow
is null
.
+ */
+ public void addWindow(Window window) throws IllegalArgumentException,
+ NullPointerException {
+
+ if (window == null) {
+ throw new NullPointerException("Argument must not be null");
+ }
+
+ if (window.getApplication() != null) {
+ throw new IllegalArgumentException(
+ "Window is already attached to an application.");
+ }
+
+ attachWindow(window);
+ }
+
+ /**
+ * Helper method to attach a window.
+ *
+ * @param w
+ * the window to add
+ */
+ private void attachWindow(Window w) {
+ windows.add(w);
+ w.setParent(this);
+ markAsDirty();
+ }
+
+ /**
+ * Remove the given subwindow from this root.
+ *
+ * Since Vaadin 6.5, {@link CloseListener}s are called also when explicitly
+ * removing a window by calling this method.
+ *
+ * Since Vaadin 6.5, returns a boolean indicating if the window was removed
+ * or not.
+ *
+ * @param window
+ * Window to be removed.
+ * @return true if the subwindow was removed, false otherwise
+ */
+ public boolean removeWindow(Window window) {
+ if (!windows.remove(window)) {
+ // Window window is not a subwindow of this root.
+ return false;
+ }
+ window.setParent(null);
+ window.fireClose();
+ markAsDirty();
+
+ return true;
+ }
+
+ /**
+ * Gets all the windows added to this root.
+ *
+ * @return an unmodifiable collection of windows
+ */
+ public Collection+ * The {@link WrappedRequest} can be used to get information about the + * request that caused this root 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 UI class. + *
+ * + * @param request + * the wrapped request that caused this root to be created + */ + protected abstract void init(WrappedRequest request); + + /** + * Sets the thread local for the current root. 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. + *+ * The application developer can also use this method to define the current + * root outside the normal request handling, e.g. when initiating custom + * background threads. + *
+ * + * @param uI + * the root to register as the current root + * + * @see #getCurrent() + * @see ThreadLocal + */ + public static void setCurrent(UI uI) { + currentRoot.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. + * + * @return the current root instance if available, otherwise + *null
+ *
+ * @see #setCurrent(UI)
+ */
+ public static UI getCurrent() {
+ return currentRoot.get();
+ }
+
+ public void setScrollTop(int scrollTop) {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+ @Override
+ protected ActionManager getActionManager() {
+ if (actionManager == null) {
+ actionManager = new ActionManager(this);
+ }
+ return actionManager;
+ }
+
+ @Override
+ public
+ * Default value: false
+ *
+ * @param resizeLazy
+ * true to use a delay before recalculating sizes, false to
+ * calculate immediately.
+ */
+ public void setResizeLazy(boolean resizeLazy) {
+ this.resizeLazy = resizeLazy;
+ markAsDirty();
+ }
+
+ /**
+ * Checks whether lazy resize is enabled.
+ *
+ * @return true
if lazy resize is enabled, false
+ * if lazy resize is not enabled
+ */
+ public boolean isResizeLazy() {
+ return resizeLazy;
+ }
+
+ /**
+ * 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.
+ *
+ * @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 UI. 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);
+ }
+
+ @Override
+ public boolean isConnectorEnabled() {
+ // TODO How can a UI be invisible? What does it mean?
+ return isVisible() && isEnabled();
+ }
+
+ public ConnectorTracker getConnectorTracker() {
+ return connectorTracker;
+ }
+
+ public Page getPage() {
+ return page;
+ }
+
+ /**
+ * 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)}
+ */
+ @Override
+ @Deprecated
+ public void setCaption(String caption) {
+ throw new IllegalStateException(
+ "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
+ * automatically disappears ("humanized message").
+ *
+ * Care should be taken to to avoid XSS vulnerabilities as the caption is
+ * rendered as html.
+ *
+ * @see #showNotification(Notification)
+ * @see Notification
+ *
+ * @param caption
+ * The message
+ *
+ * @deprecated As of 7.0, use Notification.show instead but be aware that
+ * Notification.show does not allow HTML.
+ */
+ @Deprecated
+ public void showNotification(String caption) {
+ Notification notification = new Notification(caption);
+ notification.setHtmlContentAllowed(true);// Backwards compatibility
+ getPage().showNotification(notification);
+ }
+
+ /**
+ * Shows a notification message the root. 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.
+ *
+ * Care should be taken to to avoid XSS vulnerabilities as the caption is
+ * rendered as html.
+ *
+ * @see #showNotification(Notification)
+ * @see Notification
+ *
+ * @param caption
+ * The message
+ * @param type
+ * The message type
+ *
+ * @deprecated As of 7.0, use Notification.show instead but be aware that
+ * Notification.show does not allow HTML.
+ */
+ @Deprecated
+ public void showNotification(String caption, Notification.Type type) {
+ Notification notification = new Notification(caption, type);
+ notification.setHtmlContentAllowed(true);// Backwards compatibility
+ getPage().showNotification(notification);
+ }
+
+ /**
+ * Shows a notification consisting of a bigger caption and a smaller
+ * description on the middle of the root. The message automatically
+ * disappears ("humanized message").
+ *
+ * Care should be taken to to avoid XSS vulnerabilities as the caption and
+ * description are rendered as html.
+ *
+ * @see #showNotification(Notification)
+ * @see Notification
+ *
+ * @param caption
+ * The caption of the message
+ * @param description
+ * The message description
+ *
+ * @deprecated As of 7.0, use new Notification(...).show(Page) instead but
+ * be aware that HTML by default not allowed.
+ */
+ @Deprecated
+ public void showNotification(String caption, String description) {
+ Notification notification = new Notification(caption, description);
+ notification.setHtmlContentAllowed(true);// Backwards compatibility
+ getPage().showNotification(notification);
+ }
+
+ /**
+ * Shows a notification consisting of a bigger caption and a smaller
+ * description. 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.
+ *
+ * Care should be taken to to avoid XSS vulnerabilities as the caption and
+ * description are rendered as html.
+ *
+ * @see #showNotification(Notification)
+ * @see Notification
+ *
+ * @param caption
+ * The caption of the message
+ * @param description
+ * The message description
+ * @param type
+ * The message type
+ *
+ * @deprecated As of 7.0, use new Notification(...).show(Page) instead but
+ * be aware that HTML by default not allowed.
+ */
+ @Deprecated
+ public void showNotification(String caption, String description,
+ Notification.Type type) {
+ Notification notification = new Notification(caption, description, type);
+ notification.setHtmlContentAllowed(true);// Backwards compatibility
+ getPage().showNotification(notification);
+ }
+
+ /**
+ * Shows a notification consisting of a bigger caption and a smaller
+ * description. 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.
+ *
+ * Care should be taken to avoid XSS vulnerabilities if html content is
+ * allowed.
+ *
+ * @see #showNotification(Notification)
+ * @see Notification
+ *
+ * @param caption
+ * The message caption
+ * @param description
+ * The message description
+ * @param type
+ * The type of message
+ * @param htmlContentAllowed
+ * Whether html in the caption and description should be
+ * displayed as html or as plain text
+ *
+ * @deprecated As of 7.0, use new Notification(...).show(Page).
+ */
+ @Deprecated
+ public void showNotification(String caption, String description,
+ Notification.Type type, boolean htmlContentAllowed) {
+ getPage()
+ .showNotification(
+ new Notification(caption, description, type,
+ htmlContentAllowed));
+ }
+
+ /**
+ * Shows a notification message.
+ *
+ * @see Notification
+ * @see #showNotification(String)
+ * @see #showNotification(String, int)
+ * @see #showNotification(String, String)
+ * @see #showNotification(String, String, int)
+ *
+ * @param notification
+ * The notification message to show
+ *
+ * @deprecated As of 7.0, use Notification.show instead
+ */
+ @Deprecated
+ public void showNotification(Notification notification) {
+ getPage().showNotification(notification);
+ }
+
+}
diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java
index d79588cc63..335f7fd67d 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)}.
* 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; *
** 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. *
* * @author Vaadin Ltd. @@ -222,14 +222,14 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * */ public void close() { - Root root = getRoot(); + UI uI = getRoot(); // Don't do anything if not attached to a root - if (root != null) { + if (uI != null) { // focus is restored to the parent window - root.focus(); + uI.focus(); // subwindow is removed from the root - root.removeWindow(this); + uI.removeWindow(this); } } @@ -476,13 +476,13 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, *
*/
public void bringToFront() {
- Root root = getRoot();
- if (root == null) {
+ UI uI = getRoot();
+ 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.");
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/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..4e26ffaf45 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 getRoot() {
+ 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..dd1675c75d 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 getRoot() {
+ 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/CustomRootClassLoader.java
index 74770f8652..9fe486f85e 100644
--- a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
+++ b/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
@@ -14,14 +14,14 @@ import com.vaadin.RootRequiresMoreInformationException;
import com.vaadin.terminal.DefaultRootProvider;
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 {
/**
* Stub root
*/
- public static class MyRoot extends Root {
+ public static class MyRoot 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.getRootForRequest(createRequestMock(null));
+ assertTrue(uI instanceof MyRoot);
}
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,9 +101,9 @@ public class CustomRootClassLoader extends TestCase {
application.start(new ApplicationStartEvent(null,
createConfigurationMock(), null));
- Root root = application
+ UI uI = application
.getRootForRequest(createRequestMock(loggingClassLoader));
- assertTrue(root instanceof MyRoot);
+ assertTrue(uI instanceof MyRoot);
assertEquals(1, loggingClassLoader.requestedClasses.size());
assertEquals(MyRoot.class.getName(),
loggingClassLoader.requestedClasses.get(0));
@@ -126,7 +126,7 @@ public class CustomRootClassLoader extends TestCase {
}
@Override
- public Root getRootForRequest(WrappedRequest request)
+ public UI getRootForRequest(WrappedRequest request)
throws RootRequiresMoreInformationException {
// Always create a new root for testing (can't directly use
// getRoot as it's protected)
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..e2db224f08 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,7 +100,7 @@ public class AttachDetachWindow {
}
}
- private class TestRoot extends Root implements TestContainer {
+ private class TestRoot extends UI implements TestContainer {
boolean rootAttachCalled = false;
boolean rootDetachCalled = false;
private TestContent testContent = new TestContent();;
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..2ac447cee3 100644
--- a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
+++ b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
@@ -36,7 +36,7 @@ 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() {
@Override
- public Class extends Root> getRootClass(
+ public Class extends UI> getRootClass(
Application application, WrappedRequest request)
throws RootRequiresMoreInformationException {
- return (Class extends Root>) classToRun;
+ 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..7a06dedd63 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 {
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..023a93438d 100644
--- a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
+++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -6,16 +6,16 @@ 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;
+import com.vaadin.ui.UI;
public class RefreshStatePreserve extends AbstractTestApplication {
- public static class RefreshStateRoot extends Root {
+ public static class RefreshStateRoot 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: " + getRootId()));
}
}
@@ -25,7 +25,7 @@ public class RefreshStatePreserve extends AbstractTestApplication {
setRootPreserved(true);
addRootProvider(new AbstractRootProvider() {
@Override
- public Class extends Root> getRootClass(Application application,
+ public Class extends UI> getRootClass(Application application,
WrappedRequest request)
throws RootRequiresMoreInformationException {
return RefreshStateRoot.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..3323e3bb28 100644
--- a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
+++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
@@ -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)
+ protected UI getRoot(WrappedRequest request)
throws RootRequiresMoreInformationException {
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/AbstractTestRoot.java
index d20f7a4a21..cf4bfac426 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.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 AbstractTestRoot 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/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/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/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/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/loginform/LoginFormRootInLoginHandler.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java
index 2c0a8744fc..db64df936f 100755
--- a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java
+++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java
@@ -5,7 +5,7 @@ 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 {
@@ -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()).getRoot();
if (r2 != null) {
addComponent(new Label("event.getSource().data: "
+ r2.getData()));
diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
index 83f89f0214..515734338b 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 getRoot(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/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/root/LazyInitRoots.java b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
index 254410a549..aca7211aec 100644
--- a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
+++ b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
@@ -9,12 +9,12 @@ 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 {
@EagerInit
- private static class EagerInitRoot extends Root {
+ private static class EagerInitRoot extends UI {
@Override
public void init(WrappedRequest request) {
addComponent(getRequestInfo("EagerInitRoot", request));
@@ -22,29 +22,29 @@ public class LazyInitRoots extends AbstractTestApplication {
}
@Override
- public Root getRoot(WrappedRequest request)
+ public UI getRoot(WrappedRequest request)
throws RootRequiresMoreInformationException {
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();
} else {
- Root root = new Root() {
+ UI uI = new UI() {
@Override
protected void init(WrappedRequest request) {
addComponent(getRequestInfo("LazyCreateRoot", request));
}
};
- return root;
+ return uI;
}
} else if (request.getParameter("eagerInit") != null) {
- // Root inited on first request
+ // UI inited on first request
return new EagerInitRoot();
} else {
// The standard root
- Root root = new Root() {
+ UI uI = new UI() {
@Override
protected void init(WrappedRequest request) {
addComponent(getRequestInfo("NormalRoot", request));
@@ -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.getRoot if RootRequiresMoreInformation has been thrown and in UI.init if the root has the @RootInitRequiresBrowserDetals annotation";
}
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
index ae3182401d..4309b6e942 100644
--- a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
+++ b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
@@ -6,12 +6,12 @@ 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;
+import com.vaadin.ui.UI;
public class RootsInMultipleTabs extends AbstractTestApplication {
private int numberOfRootsOpened;
- public static class TabRoot extends Root {
+ public static class TabRoot extends UI {
@Override
protected void init(WrappedRequest request) {
RootsInMultipleTabs application = (RootsInMultipleTabs) getApplication();
@@ -25,7 +25,7 @@ public class RootsInMultipleTabs extends AbstractTestApplication {
public RootsInMultipleTabs() {
addRootProvider(new AbstractRootProvider() {
@Override
- public Class extends Root> getRootClass(Application application,
+ public Class extends UI> getRootClass(Application application,
WrappedRequest request)
throws RootRequiresMoreInformationException {
return TabRoot.class;
@@ -35,7 +35,7 @@ public class RootsInMultipleTabs extends AbstractTestApplication {
@Override
protected String getTestDescription() {
- return "Opening the same application again (e.g. in a new tab) should create a new Root.";
+ return "Opening the same application again (e.g. in a new tab) should create a new UI.";
}
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java
index 77c0bdb150..7a734e8497 100644
--- a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java
+++ b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java
@@ -17,7 +17,7 @@ public class TestRootTheme extends AbstractTestRoot {
@Override
public String getTestDescription() {
- return "Root with @RootTheme(\"tests-tickets\")";
+ return "UI with @RootTheme(\"tests-tickets\")";
}
@Override
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/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/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/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/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/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/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/SubWindowFocusAndBlurListeners.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
index 061ee7900f..e4a7e288ad 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().getRoot();
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/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..0f0db3a028 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 {
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..99020d0b5b 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().getRoot();
/* 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..bb85dff0b6 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().getRoot();
TestUtils
.injectCSS(
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest5.java b/tests/testbench/com/vaadin/tests/dd/DDTest5.java
index 63d1e9e3c2..cb99b17da4 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().getRoot();
HorizontalSortableCssLayoutWithWrappers verticalSortableCssLayoutWithWrappers = new HorizontalSortableCssLayoutWithWrappers();
w.addWindow(verticalSortableCssLayoutWithWrappers);
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest7.java b/tests/testbench/com/vaadin/tests/dd/DDTest7.java
index f9be935b23..2af93c6c72 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().getRoot();
TestUtils
.injectCSS(
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..41a3d18f9f 100644
--- a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java
+++ b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java
@@ -39,7 +39,7 @@ 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.UI.LegacyWindow;
import com.vaadin.ui.Slider;
import com.vaadin.ui.Slider.ValueOutOfBoundsException;
import com.vaadin.ui.TabSheet;
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..25821cb92c 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;
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..4181c071f0 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
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java
index 5296f03c30..6c9282eb01 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.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 DefineRootTheme 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..a601ff2eb4 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
@@ -22,7 +22,7 @@ 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,7 +35,7 @@ import com.vaadin.ui.Root;
public class DifferentFeaturesForDifferentClients extends Application {
@Override
- protected Root getRoot(WrappedRequest request)
+ protected UI getRoot(WrappedRequest request)
throws RootRequiresMoreInformationException {
BrowserDetails browserDetails = request.getBrowserDetails();
// This is a limitation of 7.0.0.alpha1 that there is no better way to
@@ -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/FindCurrentRootAndApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java
index d53ede3518..a786ecb533 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.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 FindCurrentRootAndApplication 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/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/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/ComponentInStateRoot.java
index 0ed4a7781e..b5bf8538ed 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.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 ComponentInStateRoot 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/MyComponentRoot.java
index ef692ef8a3..87aede8da9 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.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 MyComponentRoot 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/ResourceInStateRoot.java
index 69c2a0d040..04e2cf089e 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.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 ResourceInStateRoot 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/WidgetcontainerRoot.java
index fae4265750..38f008d8a0 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.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 WidgetcontainerRoot 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/AnalyticsRoot.java
index df588b6f2d..05255d71cb 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.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 AnalyticsRoot 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
* If {@link BrowserDetails} are required to create a UI, the
- * implementation can throw a {@link RootRequiresMoreInformationException}
+ * 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
@@ -1864,19 +1864,19 @@ public class Application implements Terminal.ErrorListener, Serializable {
* @param request
* the wrapped request for which a root is needed
* @return a root instance to use for the request
- * @throws RootRequiresMoreInformationException
+ * @throws UIRequiresMoreInformationException
* may be thrown by an implementation to indicate that
* {@link BrowserDetails} are required to create a root
*
* @see #getRootClassName(WrappedRequest)
* @see UI
- * @see RootRequiresMoreInformationException
+ * @see UIRequiresMoreInformationException
* @see WrappedRequest#getBrowserDetails()
*
* @since 7.0
*/
protected UI getRoot(WrappedRequest request)
- throws RootRequiresMoreInformationException {
+ throws UIRequiresMoreInformationException {
// Iterate in reverse order - test check newest provider first
for (int i = rootProviders.size() - 1; i >= 0; i--) {
@@ -2151,7 +2151,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
* Finds the {@link UI} to which a particular request belongs. If the
* request originates from an existing UI, 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
+ * throw a {@link UIRequiresMoreInformationException} if all required
* information is not available.
*
* Please note that this method can also return a newly created
@@ -2164,17 +2164,17 @@ public class Application implements Terminal.ErrorListener, Serializable {
* @param request
* the request for which a root is desired
* @return a root belonging to the request
- * @throws RootRequiresMoreInformationException
+ * @throws UIRequiresMoreInformationException
* if no existing root could be found and creating a new root
* requires additional information from the browser
*
* @see #getRoot(WrappedRequest)
- * @see RootRequiresMoreInformationException
+ * @see UIRequiresMoreInformationException
*
* @since 7.0
*/
public UI getRootForRequest(WrappedRequest request)
- throws RootRequiresMoreInformationException {
+ throws UIRequiresMoreInformationException {
UI uI = UI.getCurrent();
if (uI != null) {
return uI;
@@ -2194,7 +2194,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
Integer retainedRootId;
if (!hasBrowserDetails) {
- throw new RootRequiresMoreInformationException();
+ throw new UIRequiresMoreInformationException();
} else {
String windowName = browserDetails.getWindowName();
retainedRootId = retainOnRefreshRoots.get(windowName);
diff --git a/server/src/com/vaadin/RootRequiresMoreInformationException.java b/server/src/com/vaadin/RootRequiresMoreInformationException.java
deleted file mode 100644
index 74026dd161..0000000000
--- a/server/src/com/vaadin/RootRequiresMoreInformationException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedRequest.BrowserDetails;
-
-/**
- * Exception that is thrown to indicate that creating or initializing the root
- * 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 WrappedRequest#getBrowserDetails()
- *
- * @since 7.0
- */
-public class RootRequiresMoreInformationException extends Exception {
- // Nothing of interest here
-}
diff --git a/server/src/com/vaadin/UIRequiresMoreInformationException.java b/server/src/com/vaadin/UIRequiresMoreInformationException.java
new file mode 100644
index 0000000000..682d46f207
--- /dev/null
+++ b/server/src/com/vaadin/UIRequiresMoreInformationException.java
@@ -0,0 +1,37 @@
+/*
+ * 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;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedRequest.BrowserDetails;
+
+/**
+ * Exception that is thrown to indicate that creating or initializing the root
+ * 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 WrappedRequest#getBrowserDetails()
+ *
+ * @since 7.0
+ */
+public class UIRequiresMoreInformationException extends Exception {
+ // Nothing of interest here
+}
diff --git a/server/src/com/vaadin/terminal/DefaultRootProvider.java b/server/src/com/vaadin/terminal/DefaultRootProvider.java
index 07533949a0..7e6631be56 100644
--- a/server/src/com/vaadin/terminal/DefaultRootProvider.java
+++ b/server/src/com/vaadin/terminal/DefaultRootProvider.java
@@ -17,14 +17,14 @@
package com.vaadin.terminal;
import com.vaadin.Application;
-import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.UIRequiresMoreInformationException;
import com.vaadin.ui.UI;
public class DefaultRootProvider extends AbstractRootProvider {
@Override
public Class extends UI> getRootClass(Application application,
- WrappedRequest request) throws RootRequiresMoreInformationException {
+ WrappedRequest request) throws UIRequiresMoreInformationException {
Object rootClassNameObj = application
.getProperty(Application.ROOT_PARAMETER);
diff --git a/server/src/com/vaadin/terminal/RootProvider.java b/server/src/com/vaadin/terminal/RootProvider.java
index 53173b6b94..229f2ca989 100644
--- a/server/src/com/vaadin/terminal/RootProvider.java
+++ b/server/src/com/vaadin/terminal/RootProvider.java
@@ -17,12 +17,12 @@
package com.vaadin.terminal;
import com.vaadin.Application;
-import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.UIRequiresMoreInformationException;
import com.vaadin.ui.UI;
public interface RootProvider {
public Class extends UI> getRootClass(Application application,
- WrappedRequest request) throws RootRequiresMoreInformationException;
+ WrappedRequest request) throws UIRequiresMoreInformationException;
public UI instantiateRoot(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 1186d678b0..9ef98fcc41 100644
--- a/server/src/com/vaadin/terminal/WrappedRequest.java
+++ b/server/src/com/vaadin/terminal/WrappedRequest.java
@@ -27,7 +27,7 @@ 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.UI;
@@ -220,7 +220,7 @@ public interface WrappedRequest extends Serializable {
*
* 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
+ * after throwing {@link UIRequiresMoreInformationException} or in
* {@link UI#init(WrappedRequest)} for a UI class not annotated with
* {@link EagerInit}
*
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
index 2315a9c1d6..86668bd91f 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
@@ -56,7 +56,7 @@ 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;
@@ -500,7 +500,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
try {
uI = application
.getRootForRequest(wrappedRequest);
- } catch (RootRequiresMoreInformationException e) {
+ } catch (UIRequiresMoreInformationException e) {
// Ignore problem and continue without root
}
break;
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 39475f3131..48810d2b08 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;
@@ -2457,7 +2457,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);
diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java
index b6953da35e..e52c11e2c2 100644
--- a/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java
+++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java
@@ -37,7 +37,7 @@ 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;
@@ -134,7 +134,7 @@ public abstract class BootstrapHandler implements RequestHandler {
}
rootId = Integer.valueOf(uI.getRootId());
- } catch (RootRequiresMoreInformationException e) {
+ } catch (UIRequiresMoreInformationException e) {
// Just keep going without rootId
}
diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java
index 4f69dda48b..b1a52cf79e 100644
--- a/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java
+++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java
@@ -19,7 +19,7 @@ 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.UI;
@@ -110,7 +110,7 @@ public abstract class BootstrapResponse extends EventObject {
*
* @see Application#isRootPreserved()
* @see Application#getRoot(WrappedRequest)
- * @see RootRequiresMoreInformationException
+ * @see UIRequiresMoreInformationException
*
* @return The UI that will be displayed in the page being generated, or
*
- * Note that this theme can be overridden for a specific root with
- * {@link Application#getThemeForRoot(UI)}. Setting theme to be
+ * Note that this theme can be overridden for a specific UI with
+ * {@link Application#getThemeForUI(UI)}. Setting theme to be
*
- * Gets a root by name. Returns
* Note that removing window from the application does not close the
@@ -329,13 +329,13 @@ public class Application implements Terminal.ErrorListener, Serializable {
*
* TODO Investigate whether this might be derived from the different states
- * in getRootForRrequest.
+ * in getUIForRrequest.
*
* 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.
*
- * 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.
+ * 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.
*
* The default implementation in {@link Application} creates a new instance
- * of the UI 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 UI 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.
*
* Please note that this method can also return a newly created
* null
if all required information is not yet
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index 33eefff485..e2facefb33 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -36,8 +36,8 @@ 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.root.UIServerRpc;
+import com.vaadin.shared.ui.root.UIState;
import com.vaadin.terminal.Page;
import com.vaadin.terminal.Page.BrowserWindowResizeEvent;
import com.vaadin.terminal.Page.BrowserWindowResizeListener;
@@ -429,7 +429,7 @@ public abstract class UI extends AbstractComponentContainer implements
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(UI.this, mouseDetails));
@@ -498,15 +498,15 @@ public abstract class UI extends AbstractComponentContainer implements
}
@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;
}
/**
diff --git a/shared/src/com/vaadin/shared/ui/root/RootServerRpc.java b/shared/src/com/vaadin/shared/ui/root/RootServerRpc.java
deleted file mode 100644
index df2031f7d5..0000000000
--- a/shared/src/com/vaadin/shared/ui/root/RootServerRpc.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.shared.ui.root;
-
-import com.vaadin.shared.annotations.Delayed;
-import com.vaadin.shared.communication.ServerRpc;
-import com.vaadin.shared.ui.ClickRpc;
-
-public interface RootServerRpc extends ClickRpc, ServerRpc {
- @Delayed(lastonly = true)
- public void resize(int viewWidth, int viewHeight, int windowWidth,
- int windowHeight);
-}
\ No newline at end of file
diff --git a/shared/src/com/vaadin/shared/ui/root/RootState.java b/shared/src/com/vaadin/shared/ui/root/RootState.java
deleted file mode 100644
index b7c2c88ce5..0000000000
--- a/shared/src/com/vaadin/shared/ui/root/RootState.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.shared.ui.root;
-
-import com.vaadin.shared.ComponentState;
-import com.vaadin.shared.Connector;
-
-public class RootState extends ComponentState {
- private Connector content;
-
- public Connector getContent() {
- return content;
- }
-
- public void setContent(Connector content) {
- this.content = content;
- }
-
-}
\ No newline at end of file
diff --git a/shared/src/com/vaadin/shared/ui/root/UIServerRpc.java b/shared/src/com/vaadin/shared/ui/root/UIServerRpc.java
new file mode 100644
index 0000000000..20cdd48f54
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/root/UIServerRpc.java
@@ -0,0 +1,26 @@
+/*
+ * 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.shared.ui.root;
+
+import com.vaadin.shared.annotations.Delayed;
+import com.vaadin.shared.communication.ServerRpc;
+import com.vaadin.shared.ui.ClickRpc;
+
+public interface UIServerRpc extends ClickRpc, ServerRpc {
+ @Delayed(lastonly = true)
+ public void resize(int viewWidth, int viewHeight, int windowWidth,
+ int windowHeight);
+}
\ No newline at end of file
diff --git a/shared/src/com/vaadin/shared/ui/root/UIState.java b/shared/src/com/vaadin/shared/ui/root/UIState.java
new file mode 100644
index 0000000000..f019d1ce67
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/root/UIState.java
@@ -0,0 +1,32 @@
+/*
+ * 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.shared.ui.root;
+
+import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.Connector;
+
+public class UIState extends ComponentState {
+ private Connector content;
+
+ public Connector getContent() {
+ return content;
+ }
+
+ public void setContent(Connector content) {
+ this.content = content;
+ }
+
+}
\ No newline at end of file
diff --git a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java b/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
index 9fe486f85e..27d66ca0d0 100644
--- a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
+++ b/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
@@ -10,7 +10,7 @@ import org.easymock.EasyMock;
import com.vaadin.Application;
import com.vaadin.Application.ApplicationStartEvent;
-import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.UIRequiresMoreInformationException;
import com.vaadin.terminal.DefaultRootProvider;
import com.vaadin.terminal.DeploymentConfiguration;
import com.vaadin.terminal.WrappedRequest;
@@ -127,7 +127,7 @@ public class CustomRootClassLoader extends TestCase {
@Override
public UI getRootForRequest(WrappedRequest request)
- throws RootRequiresMoreInformationException {
+ throws UIRequiresMoreInformationException {
// Always create a new root for testing (can't directly use
// getRoot as it's protected)
return getRoot(request);
diff --git a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
index 2ac447cee3..43d4ad699e 100644
--- a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
+++ b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
@@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.vaadin.Application;
-import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.UIRequiresMoreInformationException;
import com.vaadin.terminal.AbstractRootProvider;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
@@ -117,7 +117,7 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet {
@Override
public Class extends UI> getRootClass(
Application application, WrappedRequest request)
- throws RootRequiresMoreInformationException {
+ throws UIRequiresMoreInformationException {
return (Class extends UI>) classToRun;
}
});
diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
index 023a93438d..deff2bc486 100644
--- a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
+++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.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.AbstractRootProvider;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.tests.components.AbstractTestApplication;
@@ -27,7 +27,7 @@ public class RefreshStatePreserve extends AbstractTestApplication {
@Override
public Class extends UI> getRootClass(Application application,
WrappedRequest request)
- throws RootRequiresMoreInformationException {
+ throws UIRequiresMoreInformationException {
return RefreshStateRoot.class;
}
});
diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
index 3323e3bb28..96380b2185 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;
@@ -78,7 +78,7 @@ public class ThreadLocalInstances extends AbstractTestApplication {
@Override
protected UI getRoot(WrappedRequest request)
- throws RootRequiresMoreInformationException {
+ throws UIRequiresMoreInformationException {
return mainWindow;
}
diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
index aca7211aec..3c7862d298 100644
--- a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
+++ b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.root;
-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;
@@ -23,13 +23,13 @@ public class LazyInitRoots extends AbstractTestApplication {
@Override
public UI getRoot(WrappedRequest request)
- throws RootRequiresMoreInformationException {
+ throws UIRequiresMoreInformationException {
if (request.getParameter("lazyCreate") != null) {
// UI created on second request
BrowserDetails browserDetails = request.getBrowserDetails();
if (browserDetails == null
|| browserDetails.getUriFragment() == null) {
- throw new RootRequiresMoreInformationException();
+ throw new UIRequiresMoreInformationException();
} else {
UI uI = new UI() {
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
index 4309b6e942..13bef59fe9 100644
--- a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
+++ b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
@@ -1,7 +1,7 @@
package com.vaadin.tests.components.root;
import com.vaadin.Application;
-import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.UIRequiresMoreInformationException;
import com.vaadin.terminal.AbstractRootProvider;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.tests.components.AbstractTestApplication;
@@ -27,7 +27,7 @@ public class RootsInMultipleTabs extends AbstractTestApplication {
@Override
public Class extends UI> getRootClass(Application application,
WrappedRequest request)
- throws RootRequiresMoreInformationException {
+ throws UIRequiresMoreInformationException {
return TabRoot.class;
}
});
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
index a601ff2eb4..6b25f4674d 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
@@ -17,7 +17,7 @@
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;
@@ -36,12 +36,12 @@ public class DifferentFeaturesForDifferentClients extends Application {
@Override
protected UI getRoot(WrappedRequest request)
- throws RootRequiresMoreInformationException {
+ 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.
--
cgit v1.2.3
From ff0761f787f94a157d12af2a37e10e808d43fc59 Mon Sep 17 00:00:00 2001
From: Artur Signell null
selects the default theme. For the available theme
* names, see the contents of the VAADIN/themes directory.
* null
if the application is
+ * Gets a UI by name. Returns null
if the application is
* not running or it does not contain a window corresponding to the
* name.
* null
to use
+ * @return a UI corresponding to the name, or null
to use
* the default window
*/
public UI.LegacyWindow getWindow(String name) {
- return legacyRootNames.get(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
@@ -303,25 +303,25 @@ public class Application implements Terminal.ErrorListener, Serializable {
* window you should instead use {@link #addWindow(UI, String)}
*
* @param uI
- * the root window to add to the application
+ * the UI window to add to the application
* @return returns the name that has been assigned to the window
*
* @see #addWindow(UI, String)
*/
public void addWindow(UI.LegacyWindow uI) {
if (uI.getName() == null) {
- String name = Integer.toString(namelessRootIndex++);
+ String name = Integer.toString(namelessUIIndex++);
uI.setName(name);
}
- legacyRootNames.put(uI.getName(), uI);
+ 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(UI, String) and #getWindowName(UI)}.
+ * all name mappings for the window (see {@link #addWindow(UI, String)
+ * and #getWindowName(UI)}.
*
* null
is returned.
*
* TODO Tell what the default implementation does once it does something.
*
* @param uI
- * the root to get a theme for
+ * the UI to get a theme for
* @return the name of the theme, or null
if the default theme
* should be used
*
* @since 7.0
*/
- public String getThemeForRoot(UI uI) {
- Theme rootTheme = getAnnotationFor(uI.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, null
is returned.
+ * Finds the widgetset to use for a specific UI. If no specific widgetset is
+ * required, null
is returned.
*
* TODO Tell what the default implementation does once it does something.
*
* @param uI
- * the root to get a widgetset for
+ * the UI to get a widgetset for
* @return the name of the widgetset, or null
if the default
* widgetset should be used
*
* @since 7.0
*/
- public String getWidgetsetForRoot(UI uI) {
- Widgetset rootWidgetset = getAnnotationFor(uI.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 +2085,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
*/
private static final ThreadLocalUI
which has not yet been initialized. You can use
- * {@link #isRootInitPending(int)} with the root's id (
- * {@link UI#getRootId()} to check whether the initialization is still
- * pending.
+ * {@link #isUIInitPending(int)} with the UI's id ( {@link UI#getUIId()} to
+ * check whether the initialization is still pending.
* null
if no root id is defined
+ * the request to get the UI id for
+ * @return a UI id, or null
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
+ String uiIdString = request
.getParameter(ApplicationConstants.ROOT_ID_PARAMETER);
- Integer rootId = rootIdString == null ? null
- : new Integer(rootIdString);
- return rootId;
+ Integer uiId = uiIdString == null ? null : new Integer(uiIdString);
+ return uiId;
}
/**
@@ -2285,14 +2280,14 @@ public class Application implements Terminal.ErrorListener, Serializable {
* the UI is already shown, as it might not be retained as intended.
*
true
if the same UI instance should be reused
- * e.g. when the browser window is refreshed.
+ * @param uiPreserved
+ * true
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();
}
}
@@ -2305,41 +2300,41 @@ public class Application implements Terminal.ErrorListener, Serializable {
* @return true
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 true
of the initialization is pending,
- * false
if the root id is not registered or if the
- * root has already been initialized
+ * false
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 uIs of this application. This includes uIs that have
- * been requested but not yet initialized. Please note, that uIs 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 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.
+ * 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 uIs belonging to this application
*
* @since 7.0
*/
- public Collectionnull
if
* no UI instance is yet available.
*
- * @see Application#isRootPreserved()
- * @see Application#getRoot(WrappedRequest)
+ * @see Application#isUiPreserved()
+ * @see Application#getUI(WrappedRequest)
* @see UIRequiresMoreInformationException
*
* @return The UI that will be displayed in the page being generated, or
diff --git a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
index 13d558e66e..7e669d939c 100644
--- a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
+++ b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
@@ -44,7 +44,7 @@ class ServletPortletHelper implements Serializable {
String applicationParameter = deploymentConfiguration
.getInitParameters().getProperty("application");
String rootParameter = deploymentConfiguration.getInitParameters()
- .getProperty(Application.ROOT_PARAMETER);
+ .getProperty(Application.UI_PARAMETER);
ClassLoader classLoader = deploymentConfiguration.getClassLoader();
if (applicationParameter == null) {
@@ -69,7 +69,7 @@ class ServletPortletHelper implements Serializable {
private static void verifyRootClass(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");
}
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index e2facefb33..957e00385d 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -47,27 +47,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.terminal.gwt.server.AbstractApplicationServlet;
import com.vaadin.ui.Window.CloseListener;
/**
- * 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.
* - * 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. *
*- * 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 root according to the + * {@value Application#UI_PARAMETER} parameter from web.xml. *
*- * 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,13 +77,13 @@ import com.vaadin.ui.Window.CloseListener; *
*
* If a {@link EagerInit} annotation is present on a class extending
- * UI
, the framework will use a faster initialization method
- * which will not ensure that {@link BrowserDetails} are present in the
+ * UI
, 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.
*
null
application.
* @@ -652,46 +653,46 @@ public abstract class UI 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. *
* This method is mainly intended for internal use by the framework. *
* - * @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) { + 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 +728,7 @@ public abstract class UI 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 +742,7 @@ public abstract class UI 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 +753,7 @@ public abstract class UI 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 +793,28 @@ public abstract class UI 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) { 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,8 +838,8 @@ public abstract class UI 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. @@ -863,11 +864,11 @@ public abstract class UI 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 +879,7 @@ public abstract class UI 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 +888,7 @@ public abstract class UI 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,13 +911,13 @@ public abstract class UI 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. ** 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 @@ -924,42 +925,41 @@ public abstract class UI extends AbstractComponentContainer implements *
* * @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. ** 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. *
* * @param uI - * the root to register as the current root + * the UI to register as the current UI * * @see #getCurrent() * @see ThreadLocal */ - public static void setCurrent(UI uI) { - currentRoot.set(uI); + 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 - *null
+ * @return the current UI instance if available, otherwise null
*
* @see #setCurrent(UI)
*/
public static UI getCurrent() {
- return currentRoot.get();
+ return currentUI.get();
}
public void setScrollTop(int scrollTop) {
@@ -1027,10 +1027,10 @@ public abstract class UI extends AbstractComponentContainer implements
}
/**
- * 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.
+ * 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.
*
@@ -1082,7 +1082,7 @@ public abstract class UI extends AbstractComponentContainer implements
}
/**
- * 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 +1105,7 @@ public abstract class UI 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 +1132,8 @@ public abstract class UI 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.
diff --git a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java b/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
index 27d66ca0d0..59b1299db2 100644
--- a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
+++ b/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
@@ -56,7 +56,7 @@ public class CustomRootClassLoader extends TestCase {
application.start(new ApplicationStartEvent(null,
createConfigurationMock(), null));
- UI uI = application.getRootForRequest(createRequestMock(null));
+ UI uI = application.getUIForRequest(createRequestMock(null));
assertTrue(uI instanceof MyRoot);
}
@@ -102,7 +102,7 @@ public class CustomRootClassLoader extends TestCase {
createConfigurationMock(), null));
UI uI = application
- .getRootForRequest(createRequestMock(loggingClassLoader));
+ .getUIForRequest(createRequestMock(loggingClassLoader));
assertTrue(uI instanceof MyRoot);
assertEquals(1, loggingClassLoader.requestedClasses.size());
assertEquals(MyRoot.class.getName(),
@@ -113,12 +113,12 @@ public class CustomRootClassLoader extends TestCase {
private Application createStubApplication() {
return new Application() {
{
- addRootProvider(new DefaultRootProvider());
+ addUIProvider(new DefaultRootProvider());
}
@Override
public String getProperty(String name) {
- if (name.equals(ROOT_PARAMETER)) {
+ if (name.equals(UI_PARAMETER)) {
return MyRoot.class.getName();
} else {
return super.getProperty(name);
@@ -126,11 +126,11 @@ public class CustomRootClassLoader extends TestCase {
}
@Override
- public UI getRootForRequest(WrappedRequest request)
+ 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/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
index 43d4ad699e..2611546203 100644
--- a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
+++ b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
@@ -112,10 +112,10 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet {
final Class> classToRun = getClassToRun();
if (UI.class.isAssignableFrom(classToRun)) {
Application application = new Application();
- application.addRootProvider(new AbstractRootProvider() {
+ application.addUIProvider(new AbstractRootProvider() {
@Override
- public Class extends UI> getRootClass(
+ public Class extends UI> getUIClass(
Application application, WrappedRequest request)
throws UIRequiresMoreInformationException {
return (Class extends UI>) classToRun;
diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
index deff2bc486..b9b9c509c1 100644
--- a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
+++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -15,17 +15,17 @@ public class RefreshStatePreserve extends AbstractTestApplication {
getContent().addComponent(
new Label("window.name: "
+ request.getBrowserDetails().getWindowName()));
- getContent().addComponent(new Label("UI id: " + getRootId()));
+ getContent().addComponent(new Label("UI id: " + getUIId()));
}
}
@Override
public void init() {
super.init();
- setRootPreserved(true);
- addRootProvider(new AbstractRootProvider() {
+ setUiPreserved(true);
+ addUIProvider(new AbstractRootProvider() {
@Override
- public Class extends UI> getRootClass(Application application,
+ public Class extends UI> getUIClass(Application application,
WrappedRequest request)
throws UIRequiresMoreInformationException {
return RefreshStateRoot.class;
diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
index 96380b2185..fa5ab7d100 100644
--- a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
+++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
@@ -77,7 +77,7 @@ public class ThreadLocalInstances extends AbstractTestApplication {
}
@Override
- protected UI getRoot(WrappedRequest request)
+ protected UI getUI(WrappedRequest request)
throws UIRequiresMoreInformationException {
return mainWindow;
}
diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
index 515734338b..480c186df7 100644
--- a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
+++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
@@ -12,7 +12,7 @@ import com.vaadin.ui.UI.LegacyWindow;
public class LoginFormWithMultipleWindows extends Application {
@Override
- protected UI getRoot(WrappedRequest request) {
+ protected UI getUI(WrappedRequest request) {
return new LoginFormWindow();
}
diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
index 3c7862d298..89b43d4bdf 100644
--- a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
+++ b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
@@ -22,7 +22,7 @@ public class LazyInitRoots extends AbstractTestApplication {
}
@Override
- public UI getRoot(WrappedRequest request)
+ public UI getUI(WrappedRequest request)
throws UIRequiresMoreInformationException {
if (request.getParameter("lazyCreate") != null) {
// UI created on second request
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
index 13bef59fe9..238983d906 100644
--- a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
+++ b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
@@ -23,9 +23,9 @@ public class RootsInMultipleTabs extends AbstractTestApplication {
}
public RootsInMultipleTabs() {
- addRootProvider(new AbstractRootProvider() {
+ addUIProvider(new AbstractRootProvider() {
@Override
- public Class extends UI> getRootClass(Application application,
+ public Class extends UI> getUIClass(Application application,
WrappedRequest request)
throws UIRequiresMoreInformationException {
return TabRoot.class;
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java
index 4181c071f0..39b11177b6 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java
@@ -36,7 +36,7 @@ public class CreatingPreserveState extends UI {
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/DifferentFeaturesForDifferentClients.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
index 6b25f4674d..b0a33c14cf 100644
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
@@ -35,7 +35,7 @@ import com.vaadin.ui.UI;
public class DifferentFeaturesForDifferentClients extends Application {
@Override
- protected UI getRoot(WrappedRequest request)
+ 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
--
cgit v1.2.3
From 0b0ddb86876a965f68c6160fe7a499412b6c199d Mon Sep 17 00:00:00 2001
From: Artur Signell null
if not attached
*/
protected Application getApplication() {
- UI uI = getRoot();
+ UI uI = getUI();
if (uI == null) {
return null;
} else {
@@ -380,7 +380,7 @@ public abstract class AbstractClientConnector implements ClientConnector {
* is found.
*/
@Override
- public UI getRoot() {
+ public UI getUI() {
ClientConnector connector = this;
while (connector != null) {
if (connector instanceof UI) {
@@ -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}
*
*
- * The {@link #getApplication()} and {@link #getRoot()} methods might return
+ * The {@link #getApplication()} and {@link #getUI()} methods might return
* null
after this method is called.
*
* 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: diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java index 3a6e1e4ea8..c7c7bc9784 100644 --- a/server/src/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/com/vaadin/ui/ConnectorTracker.java @@ -244,7 +244,7 @@ public class ConnectorTracker implements Serializable { return null; } if (connector instanceof Component) { - return ((Component) connector).getRoot(); + return ((Component) connector).getUI(); } return getRootForConnector(connector.getParent()); diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java index f127a2705b..1c154699d8 100644 --- a/server/src/com/vaadin/ui/LoginForm.java +++ b/server/src/com/vaadin/ui/LoginForm.java @@ -100,7 +100,7 @@ public class LoginForm extends CustomComponent { String requestPathInfo = request.getRequestPathInfo(); if ("/loginHandler".equals(requestPathInfo)) { // Ensure UI.getCurrent() works in listeners - UI.setCurrent(getRoot()); + UI.setCurrent(getUI()); response.setCacheTime(-1); response.setContentType("text/html; charset=utf-8"); diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index 957e00385d..c0b3ed9929 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -515,10 +515,10 @@ public abstract class UI extends AbstractComponentContainer implements * * @return this UI * - * @see com.vaadin.ui.AbstractComponent#getRoot() + * @see com.vaadin.ui.AbstractComponent#getUI() */ @Override - public UI getRoot() { + public UI getUI() { return this; } @@ -543,9 +543,9 @@ public abstract class UI 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; @@ -804,7 +804,7 @@ public abstract class UI extends AbstractComponentContainer implements */ 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 UI."); } diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index 335f7fd67d..ad2bbd0576 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -222,7 +222,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, *
*/ public void close() { - UI uI = getRoot(); + UI uI = getUI(); // Don't do anything if not attached to a root if (uI != null) { @@ -476,7 +476,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, *
*/
public void bringToFront() {
- UI uI = getRoot();
+ UI uI = getUI();
if (uI == null) {
throw new IllegalStateException(
"Window must be attached to parent before calling bringToFront method.");
diff --git a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java
index 4e26ffaf45..5ea4bc52c4 100644
--- a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java
+++ b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java
@@ -36,7 +36,7 @@ public class TestStreamVariableMapping extends TestCase {
};
owner = new Upload() {
@Override
- public UI getRoot() {
+ public UI getUI() {
return uI;
}
};
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 dd1675c75d..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
@@ -49,7 +49,7 @@ public class RemoveListenersOnDetach {
}
@Override
- public com.vaadin.ui.UI getRoot() {
+ public com.vaadin.ui.UI getUI() {
return uI;
};
diff --git a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
index 7a06dedd63..9fa716a23e 100644
--- a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
+++ b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
@@ -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/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/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/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/loginform/LoginFormRootInLoginHandler.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java
index db64df936f..b9076a152d 100755
--- a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java
+++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormRootInLoginHandler.java
@@ -23,7 +23,7 @@ public class LoginFormRootInLoginHandler extends TestBase {
} else {
addComponent(new Label("UI.getCurrent() is null"));
}
- UI 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 root");
}
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
index 46fd6ee852..08793e9a9c 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
@@ -117,7 +117,7 @@ public class OrderedLayoutCases extends AbstractTestRoot {
protected void setup(WrappedRequest request) {
TestUtils
.injectCSS(
- getRoot(),
+ getUI(),
".sampleChild, .theLayout {border: 1px solid black;}"
+ ".theLayout > div:first-child {background: aqua;}"
+ ".theLayout > div:first-child + div {background: yellow;}"
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/table/TableInTabsheet.java b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java
index 136dcfe9a5..9a94a203f1 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java
@@ -18,7 +18,7 @@ public class TableInTabsheet extends AbstractTestRoot {
@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/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/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/SubWindowFocusAndBlurListeners.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
index e4a7e288ad..273d48514c 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
+++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
@@ -64,7 +64,7 @@ public class SubWindowFocusAndBlurListeners extends TestBase {
}
});
- UI main = getLayout().getRoot();
+ UI main = getLayout().getUI();
main.addWindow(window);
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java
index 0f0db3a028..5f55ad8cf3 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java
@@ -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/dd/DDTest2.java b/tests/testbench/com/vaadin/tests/dd/DDTest2.java
index 99020d0b5b..4d649c6056 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest2.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest2.java
@@ -45,7 +45,7 @@ public class DDTest2 extends TestBase {
@Override
protected void setup() {
- UI 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 bb85dff0b6..044fe1f49a 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest4.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest4.java
@@ -28,7 +28,7 @@ public class DDTest4 extends TestBase {
@Override
protected void setup() {
- UI 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 cb99b17da4..43342fdc35 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest5.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest5.java
@@ -47,7 +47,7 @@ public class DDTest5 extends TestBase {
@Override
protected void setup() {
- UI 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 2af93c6c72..1abf9e379c 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest7.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest7.java
@@ -29,7 +29,7 @@ public class DDTest7 extends TestBase {
@Override
protected void setup() {
- UI w = getLayout().getRoot();
+ UI w = getLayout().getUI();
TestUtils
.injectCSS(
diff --git a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java
index 25821cb92c..7877ca3fe3 100644
--- a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java
+++ b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java
@@ -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/serialization/SerializerTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java
index a301ecf828..3e194010d1 100644
--- a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java
+++ b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java
@@ -98,12 +98,12 @@ public class SerializerTest extends AbstractTestRoot {
}, new HashMap";
}
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", "
");
@@ -404,9 +404,9 @@ public class VNotification extends VOverlay {
html += "" + caption + "
";
}
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", "
");
@@ -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/server/src/com/vaadin/Application.java b/server/src/com/vaadin/Application.java
index 1827a55b72..96d38e31cf 100644
--- a/server/src/com/vaadin/Application.java
+++ b/server/src/com/vaadin/Application.java
@@ -51,7 +51,7 @@ 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;
@@ -2264,8 +2264,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
CombinedRequest combinedRequest = (CombinedRequest) request;
request = combinedRequest.getSecondRequest();
}
- String uiIdString = request
- .getParameter(ApplicationConstants.ROOT_ID_PARAMETER);
+ String uiIdString = request.getParameter(UIConstants.UI_ID_PARAMETER);
Integer uiId = uiIdString == null ? null : new Integer(uiIdString);
return uiId;
}
diff --git a/server/src/com/vaadin/UIRequiresMoreInformationException.java b/server/src/com/vaadin/UIRequiresMoreInformationException.java
index 0d491895e5..493c31acb6 100644
--- a/server/src/com/vaadin/UIRequiresMoreInformationException.java
+++ b/server/src/com/vaadin/UIRequiresMoreInformationException.java
@@ -20,7 +20,7 @@ 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.
*
diff --git a/server/src/com/vaadin/terminal/AbstractRootProvider.java b/server/src/com/vaadin/terminal/AbstractRootProvider.java
deleted file mode 100644
index f316a58f15..0000000000
--- a/server/src/com/vaadin/terminal/AbstractRootProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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;
-
-import com.vaadin.Application;
-import com.vaadin.ui.UI;
-
-public abstract class AbstractRootProvider implements UIProvider {
-
- @Override
- public UI instantiateUI(Application application,
- Class extends UI> type, WrappedRequest request) {
- try {
- return type.newInstance();
- } catch (InstantiationException e) {
- throw new RuntimeException("Could not instantiate root class", e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException("Could not access root class", e);
- }
- }
-}
diff --git a/server/src/com/vaadin/terminal/AbstractUIProvider.java b/server/src/com/vaadin/terminal/AbstractUIProvider.java
new file mode 100644
index 0000000000..5bb4d35b30
--- /dev/null
+++ b/server/src/com/vaadin/terminal/AbstractUIProvider.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.terminal;
+
+import com.vaadin.Application;
+import com.vaadin.ui.UI;
+
+public abstract class AbstractUIProvider implements UIProvider {
+
+ @Override
+ public UI instantiateUI(Application application,
+ Class extends UI> type, WrappedRequest request) {
+ try {
+ return type.newInstance();
+ } catch (InstantiationException e) {
+ throw new RuntimeException("Could not instantiate root class", e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException("Could not access root class", e);
+ }
+ }
+}
diff --git a/server/src/com/vaadin/terminal/DefaultRootProvider.java b/server/src/com/vaadin/terminal/DefaultRootProvider.java
deleted file mode 100644
index b201be513d..0000000000
--- a/server/src/com/vaadin/terminal/DefaultRootProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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;
-
-import com.vaadin.Application;
-import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.ui.UI;
-
-public class DefaultRootProvider extends AbstractRootProvider {
-
- @Override
- public Class extends UI> getUIClass(Application application,
- WrappedRequest request) throws UIRequiresMoreInformationException {
- Object rootClassNameObj = application
- .getProperty(Application.UI_PARAMETER);
-
- if (rootClassNameObj instanceof String) {
- String rootClassName = rootClassNameObj.toString();
-
- ClassLoader classLoader = request.getDeploymentConfiguration()
- .getClassLoader();
- if (classLoader == null) {
- classLoader = getClass().getClassLoader();
- }
- try {
- Class extends UI> rootClass = Class.forName(rootClassName,
- true, classLoader).asSubclass(UI.class);
-
- return rootClass;
- } catch (ClassNotFoundException e) {
- throw new RuntimeException("Could not find root class", e);
- }
- }
-
- return null;
- }
-}
diff --git a/server/src/com/vaadin/terminal/DefaultUIProvider.java b/server/src/com/vaadin/terminal/DefaultUIProvider.java
new file mode 100644
index 0000000000..8713c45b31
--- /dev/null
+++ b/server/src/com/vaadin/terminal/DefaultUIProvider.java
@@ -0,0 +1,51 @@
+/*
+ * 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;
+
+import com.vaadin.Application;
+import com.vaadin.UIRequiresMoreInformationException;
+import com.vaadin.ui.UI;
+
+public class DefaultUIProvider extends AbstractUIProvider {
+
+ @Override
+ public Class extends UI> getUIClass(Application application,
+ WrappedRequest request) throws UIRequiresMoreInformationException {
+ Object uiClassNameObj = application
+ .getProperty(Application.UI_PARAMETER);
+
+ if (uiClassNameObj instanceof String) {
+ String uiClassName = uiClassNameObj.toString();
+
+ ClassLoader classLoader = request.getDeploymentConfiguration()
+ .getClassLoader();
+ if (classLoader == null) {
+ classLoader = getClass().getClassLoader();
+ }
+ try {
+ Class extends UI> uiClass = Class.forName(uiClassName, true,
+ classLoader).asSubclass(UI.class);
+
+ return uiClass;
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException("Could not find UI class", e);
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/server/src/com/vaadin/terminal/Page.java b/server/src/com/vaadin/terminal/Page.java
index 95f9a7b3ec..66ef7da296 100644
--- a/server/src/com/vaadin/terminal/Page.java
+++ b/server/src/com/vaadin/terminal/Page.java
@@ -25,8 +25,8 @@ 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;
@@ -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,7 +509,7 @@ public class Page implements Serializable {
}
if (fragment != null) {
- target.addAttribute(RootConstants.FRAGMENT_VARIABLE, fragment);
+ target.addAttribute(UIConstants.FRAGMENT_VARIABLE, fragment);
}
}
@@ -632,11 +632,11 @@ public class Page implements Serializable {
* null
*/
public static Page getCurrent() {
- UI currentRoot = UI.getCurrent();
- if (currentRoot == null) {
+ UI currentUI = UI.getCurrent();
+ if (currentUI == null) {
return null;
}
- return currentRoot.getPage();
+ return currentUI.getPage();
}
/**
diff --git a/server/src/com/vaadin/terminal/WrappedRequest.java b/server/src/com/vaadin/terminal/WrappedRequest.java
index 9ef98fcc41..343a60848e 100644
--- a/server/src/com/vaadin/terminal/WrappedRequest.java
+++ b/server/src/com/vaadin/terminal/WrappedRequest.java
@@ -219,8 +219,9 @@ 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 UIRequiresMoreInformationException} or in
+ * 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}
*
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
index 7a69a4c2b0..a9e6028090 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
@@ -501,23 +501,22 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
uI = application
.getUIForRequest(wrappedRequest);
} catch (UIRequiresMoreInformationException e) {
- // Ignore problem and continue without root
+ // 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:
- uI = application
- .getUIForRequest(wrappedRequest);
+ uI = application.getUIForRequest(wrappedRequest);
}
// if window not found, not a problem - use null
}
@@ -534,9 +533,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
uI, (ActionRequest) request,
(ActionResponse) response);
} else if (request instanceof EventRequest) {
- applicationContext.firePortletEventRequest(application,
- uI, (EventRequest) request,
- (EventResponse) response);
+ applicationContext.firePortletEventRequest(application, uI,
+ (EventRequest) request, (EventResponse) response);
} else if (request instanceof ResourceRequest) {
applicationContext.firePortletResourceRequest(application,
uI, (ResourceRequest) request,
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
index b71c6ec20c..6cf9b76b0d 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
@@ -321,14 +321,14 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
} else if (requestType == RequestType.UIDL) {
UI uI = application.getUIForRequest(request);
if (uI == null) {
- throw new ServletException(ERROR_NO_ROOT_FOUND);
+ throw new ServletException(ERROR_NO_UI_FOUND);
}
// Handles AJAX UIDL requests
applicationManager.handleUidlRequest(request, response,
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;
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index e19cfc4de6..87eadd5df7 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -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;
@@ -146,7 +147,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
public static final char VAR_ESCAPE_CHARACTER = '\u001b';
- private final HashMapnull
if
* no UI instance is yet available.
*
@@ -116,7 +115,7 @@ public abstract class BootstrapResponse extends EventObject {
* null
if all required information is not yet
* available.
*/
- public UI getRoot() {
+ 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 1a5019a7c1..c2fbbe37d4 100644
--- a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java
+++ b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java
@@ -175,7 +175,7 @@ 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 UI this connector is attached to or null if it is not
* attached to any UI
diff --git a/server/src/com/vaadin/terminal/gwt/server/Constants.java b/server/src/com/vaadin/terminal/gwt/server/Constants.java
index 78c043da69..40386d6eb7 100644
--- a/server/src/com/vaadin/terminal/gwt/server/Constants.java
+++ b/server/src/com/vaadin/terminal/gwt/server/Constants.java
@@ -78,7 +78,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";
diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java b/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
index a5a3e94954..8538d42604 100644
--- a/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
+++ b/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
@@ -395,7 +395,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext {
PortletURL url = ((MimeResponse) response).createRenderURL();
url.setPortletMode(portletMode);
throw new RuntimeException("UI.open has not yet been implemented");
- // root.open(new ExternalResource(url.toString()));
+ // UI.open(new ExternalResource(url.toString()));
} else if (response instanceof StateAwareResponse) {
((StateAwareResponse) response).setPortletMode(portletMode);
} else {
diff --git a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
index 7e669d939c..403cffb47c 100644
--- a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
+++ b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
@@ -9,7 +9,7 @@ import com.vaadin.terminal.WrappedRequest;
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()
+ 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.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 (!UI.class.isAssignableFrom(rootClass)) {
+ Class> uiClass = classLoader.loadClass(className);
+ if (!UI.class.isAssignableFrom(uiClass)) {
throw new ApplicationClassException(className
+ " 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);
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java
index 0b97e1667d..a52a07f266 100644
--- a/server/src/com/vaadin/ui/AbstractComponent.java
+++ b/server/src/com/vaadin/ui/AbstractComponent.java
@@ -556,16 +556,6 @@ public abstract class AbstractComponent extends AbstractClientConnector
getState().setReadOnly(readOnly);
}
- /*
- * Gets the parent window of the component. Don't add a JavaDoc comment
- * here, we use the default documentation from implemented interface.
- */
- @Override
- public UI getUI() {
- // Just make method from implemented Component interface public
- return super.getUI();
- }
-
/*
* Notify the component that it's attached to a window. Don't add a JavaDoc
* comment here, we use the default documentation from implemented
@@ -1304,7 +1294,7 @@ 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.
diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java
index c7c7bc9784..ad5990137c 100644
--- a/server/src/com/vaadin/ui/ConnectorTracker.java
+++ b/server/src/com/vaadin/ui/ConnectorTracker.java
@@ -210,7 +210,7 @@ public class ConnectorTracker implements Serializable {
while (iterator.hasNext()) {
String connectorId = iterator.next();
ClientConnector connector = connectorIdToConnector.get(connectorId);
- if (getRootForConnector(connector) != uI) {
+ 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
@@ -239,7 +239,7 @@ public class ConnectorTracker implements Serializable {
* @return The uI the connector is attached to or null if it is not
* attached to any uI.
*/
- private UI getRootForConnector(ClientConnector connector) {
+ private UI getUIForConnector(ClientConnector connector) {
if (connector == null) {
return null;
}
@@ -247,7 +247,7 @@ public class ConnectorTracker implements Serializable {
return ((Component) connector).getUI();
}
- return getRootForConnector(connector.getParent());
+ return getUIForConnector(connector.getParent());
}
/**
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index c0b3ed9929..aede1af54b 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -35,9 +35,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.UIServerRpc;
-import com.vaadin.shared.ui.root.UIState;
+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;
@@ -64,7 +64,7 @@ import com.vaadin.ui.Window.CloseListener;
* 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 root according to the
+ * That method does by default create a UI according to the
* {@value Application#UI_PARAMETER} parameter from web.xml.
*
@@ -544,8 +544,8 @@ public abstract class UI extends AbstractComponentContainer implements if (pendingFocus != null) { // ensure focused component is still attached to this main window if (pendingFocus.getUI() == this - || (pendingFocus.getUI() != null && pendingFocus - .getUI().getParent() == this)) { + || (pendingFocus.getUI() != null && pendingFocus.getUI() + .getParent() == this)) { target.addAttribute("focused", pendingFocus); } pendingFocus = null; @@ -556,7 +556,7 @@ public abstract class UI extends AbstractComponentContainer implements } if (isResizeLazy()) { - target.addAttribute(RootConstants.RESIZE_LAZY, true); + target.addAttribute(UIConstants.RESIZE_LAZY, true); } } @@ -585,9 +585,9 @@ public abstract class UI 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); } } diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index ad2bbd0576..6102350566 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -224,11 +224,11 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, public void close() { UI uI = getUI(); - // Don't do anything if not attached to a root + // Don't do anything if not attached to a UI if (uI != null) { // focus is restored to the parent window uI.focus(); - // subwindow is removed from the root + // subwindow is removed from the UI uI.removeWindow(this); } } @@ -470,7 +470,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * If there are currently several windows visible, calling this method makes * this window topmost. *
- * 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. *
@@ -485,7 +485,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier,
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/shared/src/com/vaadin/shared/ApplicationConstants.java b/shared/src/com/vaadin/shared/ApplicationConstants.java
index 31e633a210..ba35ddea50 100644
--- a/shared/src/com/vaadin/shared/ApplicationConstants.java
+++ b/shared/src/com/vaadin/shared/ApplicationConstants.java
@@ -29,10 +29,6 @@ public class ApplicationConstants {
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/ui/root/PageClientRpc.java b/shared/src/com/vaadin/shared/ui/root/PageClientRpc.java
deleted file mode 100644
index b7d9419057..0000000000
--- a/shared/src/com/vaadin/shared/ui/root/PageClientRpc.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.shared.ui.root;
-
-import com.vaadin.shared.communication.ClientRpc;
-
-public interface PageClientRpc extends ClientRpc {
-
- public void setTitle(String title);
-
-}
diff --git a/shared/src/com/vaadin/shared/ui/root/RootConstants.java b/shared/src/com/vaadin/shared/ui/root/RootConstants.java
deleted file mode 100644
index 34c17ac71f..0000000000
--- a/shared/src/com/vaadin/shared/ui/root/RootConstants.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.shared.ui.root;
-
-public class RootConstants {
- /**
- * Attribute name for the lazy resize setting .
- */
- @Deprecated
- public static final String RESIZE_LAZY = "rL";
-
- @Deprecated
- public static final String NOTIFICATION_HTML_CONTENT_NOT_ALLOWED = "useplain";
-
- @Deprecated
- public static final String FRAGMENT_VARIABLE = "fragment";
-
- @Deprecated
- public static final String ATTRIBUTE_NOTIFICATION_STYLE = "style";
- @Deprecated
- public static final String ATTRIBUTE_NOTIFICATION_CAPTION = "caption";
- @Deprecated
- public static final String ATTRIBUTE_NOTIFICATION_MESSAGE = "message";
- @Deprecated
- public static final String ATTRIBUTE_NOTIFICATION_ICON = "icon";
- @Deprecated
- public static final String ATTRIBUTE_NOTIFICATION_POSITION = "position";
- @Deprecated
- public static final String ATTRIBUTE_NOTIFICATION_DELAY = "delay";
-
-}
diff --git a/shared/src/com/vaadin/shared/ui/root/UIServerRpc.java b/shared/src/com/vaadin/shared/ui/root/UIServerRpc.java
deleted file mode 100644
index 20cdd48f54..0000000000
--- a/shared/src/com/vaadin/shared/ui/root/UIServerRpc.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.shared.ui.root;
-
-import com.vaadin.shared.annotations.Delayed;
-import com.vaadin.shared.communication.ServerRpc;
-import com.vaadin.shared.ui.ClickRpc;
-
-public interface UIServerRpc extends ClickRpc, ServerRpc {
- @Delayed(lastonly = true)
- public void resize(int viewWidth, int viewHeight, int windowWidth,
- int windowHeight);
-}
\ No newline at end of file
diff --git a/shared/src/com/vaadin/shared/ui/root/UIState.java b/shared/src/com/vaadin/shared/ui/root/UIState.java
deleted file mode 100644
index f019d1ce67..0000000000
--- a/shared/src/com/vaadin/shared/ui/root/UIState.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.shared.ui.root;
-
-import com.vaadin.shared.ComponentState;
-import com.vaadin.shared.Connector;
-
-public class UIState extends ComponentState {
- private Connector content;
-
- public Connector getContent() {
- return content;
- }
-
- public void setContent(Connector content) {
- this.content = content;
- }
-
-}
\ No newline at end of file
diff --git a/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java
new file mode 100644
index 0000000000..a3cbc10cf6
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java
@@ -0,0 +1,25 @@
+/*
+ * 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.shared.ui.ui;
+
+import com.vaadin.shared.communication.ClientRpc;
+
+public interface PageClientRpc extends ClientRpc {
+
+ public void setTitle(String title);
+
+}
diff --git a/shared/src/com/vaadin/shared/ui/ui/UIConstants.java b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java
new file mode 100644
index 0000000000..76413628a4
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java
@@ -0,0 +1,49 @@
+/*
+ * 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.shared.ui.ui;
+
+public class UIConstants {
+ /**
+ * Attribute name for the lazy resize setting .
+ */
+ @Deprecated
+ public static final String RESIZE_LAZY = "rL";
+
+ @Deprecated
+ public static final String NOTIFICATION_HTML_CONTENT_NOT_ALLOWED = "useplain";
+
+ @Deprecated
+ public static final String FRAGMENT_VARIABLE = "fragment";
+
+ @Deprecated
+ public static final String ATTRIBUTE_NOTIFICATION_STYLE = "style";
+ @Deprecated
+ public static final String ATTRIBUTE_NOTIFICATION_CAPTION = "caption";
+ @Deprecated
+ public static final String ATTRIBUTE_NOTIFICATION_MESSAGE = "message";
+ @Deprecated
+ public static final String ATTRIBUTE_NOTIFICATION_ICON = "icon";
+ @Deprecated
+ public static final String ATTRIBUTE_NOTIFICATION_POSITION = "position";
+ @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/ui/UIServerRpc.java b/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java
new file mode 100644
index 0000000000..ef28a12415
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java
@@ -0,0 +1,26 @@
+/*
+ * 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.shared.ui.ui;
+
+import com.vaadin.shared.annotations.Delayed;
+import com.vaadin.shared.communication.ServerRpc;
+import com.vaadin.shared.ui.ClickRpc;
+
+public interface UIServerRpc extends ClickRpc, ServerRpc {
+ @Delayed(lastonly = true)
+ public void resize(int viewWidth, int viewHeight, int windowWidth,
+ int windowHeight);
+}
\ No newline at end of file
diff --git a/shared/src/com/vaadin/shared/ui/ui/UIState.java b/shared/src/com/vaadin/shared/ui/ui/UIState.java
new file mode 100644
index 0000000000..01426bd8f3
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/ui/UIState.java
@@ -0,0 +1,32 @@
+/*
+ * 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.shared.ui.ui;
+
+import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.Connector;
+
+public class UIState extends ComponentState {
+ private Connector content;
+
+ public Connector getContent() {
+ return content;
+ }
+
+ public void setContent(Connector content) {
+ this.content = content;
+ }
+
+}
\ No newline at end of file
diff --git a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java b/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
index 59b1299db2..aa4fa22d06 100644
--- a/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
+++ b/tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
@@ -11,7 +11,7 @@ import org.easymock.EasyMock;
import com.vaadin.Application;
import com.vaadin.Application.ApplicationStartEvent;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.DefaultRootProvider;
+import com.vaadin.terminal.DefaultUIProvider;
import com.vaadin.terminal.DeploymentConfiguration;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.ui.UI;
@@ -113,7 +113,7 @@ public class CustomRootClassLoader extends TestCase {
private Application createStubApplication() {
return new Application() {
{
- addUIProvider(new DefaultRootProvider());
+ addUIProvider(new DefaultUIProvider());
}
@Override
diff --git a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
index 2611546203..8183ed2d0b 100644
--- a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
+++ b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
@@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletResponse;
import com.vaadin.Application;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.AbstractRootProvider;
+import com.vaadin.terminal.AbstractUIProvider;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
import com.vaadin.terminal.gwt.server.WrappedHttpServletRequest;
@@ -112,7 +112,7 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet {
final Class> classToRun = getClassToRun();
if (UI.class.isAssignableFrom(classToRun)) {
Application application = new Application();
- application.addUIProvider(new AbstractRootProvider() {
+ application.addUIProvider(new AbstractUIProvider() {
@Override
public Class extends UI> getUIClass(
diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
index b9b9c509c1..f48ca28dbf 100644
--- a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
+++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -2,7 +2,7 @@ package com.vaadin.tests.application;
import com.vaadin.Application;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.AbstractRootProvider;
+import com.vaadin.terminal.AbstractUIProvider;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.tests.components.AbstractTestApplication;
import com.vaadin.ui.Label;
@@ -23,7 +23,7 @@ public class RefreshStatePreserve extends AbstractTestApplication {
public void init() {
super.init();
setUiPreserved(true);
- addUIProvider(new AbstractRootProvider() {
+ addUIProvider(new AbstractUIProvider() {
@Override
public Class extends UI> getUIClass(Application application,
WrappedRequest request)
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
index 238983d906..97506f7ad6 100644
--- a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
+++ b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
@@ -2,7 +2,7 @@ package com.vaadin.tests.components.root;
import com.vaadin.Application;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.AbstractRootProvider;
+import com.vaadin.terminal.AbstractUIProvider;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.tests.components.AbstractTestApplication;
import com.vaadin.ui.Label;
@@ -23,7 +23,7 @@ public class RootsInMultipleTabs extends AbstractTestApplication {
}
public RootsInMultipleTabs() {
- addUIProvider(new AbstractRootProvider() {
+ addUIProvider(new AbstractUIProvider() {
@Override
public Class extends UI> getUIClass(Application application,
WrappedRequest request)
diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java b/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java
index a525d3139b..4fa007b11d 100644
--- a/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java
+++ b/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java
@@ -42,7 +42,7 @@ public class TestAddonContextListener implements AddonContextListener {
}
private boolean shouldModify(BootstrapResponse response) {
- UI uI = response.getRoot();
+ UI uI = response.getUI();
boolean shouldModify = uI != null
&& uI.getClass() == BootstrapModifyRoot.class;
return shouldModify;
--
cgit v1.2.3
From c90d01c4118239e541ec109e471c9c8af8ed18d0 Mon Sep 17 00:00:00 2001
From: Artur Signell
-
-
-
-
diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
deleted file mode 100644
index 89b43d4bdf..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.vaadin.tests.components.root;
-
-import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.annotations.EagerInit;
-import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.WrappedRequest;
-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.UI;
-
-public class LazyInitRoots extends AbstractTestApplication {
-
- @EagerInit
- private static class EagerInitRoot extends UI {
- @Override
- public void init(WrappedRequest request) {
- addComponent(getRequestInfo("EagerInitRoot", request));
- }
- }
-
- @Override
- public UI getUI(WrappedRequest request)
- throws UIRequiresMoreInformationException {
- if (request.getParameter("lazyCreate") != null) {
- // UI created on second request
- BrowserDetails browserDetails = request.getBrowserDetails();
- if (browserDetails == null
- || browserDetails.getUriFragment() == null) {
- throw new UIRequiresMoreInformationException();
- } else {
- UI uI = new UI() {
- @Override
- protected void init(WrappedRequest request) {
- addComponent(getRequestInfo("LazyCreateRoot", request));
- }
- };
- return uI;
- }
- } else if (request.getParameter("eagerInit") != null) {
- // UI inited on first request
- return new EagerInitRoot();
- } else {
- // The standard root
- UI uI = new UI() {
- @Override
- protected void init(WrappedRequest request) {
- addComponent(getRequestInfo("NormalRoot", request));
-
- Link lazyCreateLink = new Link("Open lazyCreate root",
- new ExternalResource(getURL()
- + "?lazyCreate#lazyCreate"));
- lazyCreateLink.setTargetName("_blank");
- addComponent(lazyCreateLink);
-
- Link lazyInitLink = new Link("Open eagerInit root",
- new ExternalResource(getURL()
- + "?eagerInit#eagerInit"));
- lazyInitLink.setTargetName("_blank");
- addComponent(lazyInitLink);
- }
- };
-
- return uI;
- }
- }
-
- public static Label getRequestInfo(String name, WrappedRequest request) {
- String info = name;
- info += "
-
-New Test
-
-open
- /run/com.vaadin.tests.components.root.LazyInitRoots/normalPath?restartApplication#normalFragment
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- NormalRoot
-
pathInfo: /normalPath
parameters: [restartApplication]
uri fragment: normalFragment
-
-open
- /run/com.vaadin.tests.components.root.LazyInitRoots/lazyCreatePath?lazyCreate#lazyCreateFragment
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- LazyCreateRoot
-
pathInfo: /lazyCreatePath
parameters: [lazyCreate]
uri fragment: lazyCreateFragment
-
-open
- /run/com.vaadin.tests.components.root.LazyInitRoots/eagerPath/?eagerInit#eagerFragment
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- EagerInitRoot
-
pathInfo: /eagerPath/
parameters: [eagerInit]
uri fragment: null
pathInfo: " + request.getRequestPathInfo();
- info += "
parameters: " + request.getParameterMap().keySet();
- info += "
uri fragment: "
- + request.getBrowserDetails().getUriFragment();
- return new Label(info, ContentMode.XHTML);
- }
-
- @Override
- protected String getTestDescription() {
- return "BrowserDetails should be available in Application.getRoot if RootRequiresMoreInformation has been thrown and in UI.init if the root has the @RootInitRequiresBrowserDetals annotation";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return Integer.valueOf(7883); // + #7882 + #7884
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootInitException.java b/tests/testbench/com/vaadin/tests/components/root/RootInitException.java
deleted file mode 100644
index b4cfa2a28d..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/RootInitException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.vaadin.tests.components.root;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
-
-public class RootInitException extends AbstractTestRoot {
-
- @Override
- protected void setup(WrappedRequest request) {
- throw new RuntimeException("Catch me if you can");
- }
-
- @Override
- protected String getTestDescription() {
- return "Throwing an exception in application code during a browser details request should show a sensible message in the client";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return Integer.valueOf(8243);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java b/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java
deleted file mode 100644
index 16fecc62d2..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.tests.components.root;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
-import com.vaadin.ui.Label;
-
-public class RootInitTest extends AbstractTestRoot {
-
- @Override
- protected void setup(WrappedRequest request) {
- addComponent(new Label("Hello root"));
- }
-
- @Override
- public String getTestDescription() {
- return "Testing basic root creation";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return Integer.valueOf(3067);
- }
-}
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html
deleted file mode 100644
index c9b83fdc4e..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
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 97506f7ad6..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.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 RootsInMultipleTabs extends AbstractTestApplication {
- private int numberOfRootsOpened;
-
- public static class TabRoot extends UI {
- @Override
- protected void init(WrappedRequest request) {
- RootsInMultipleTabs application = (RootsInMultipleTabs) getApplication();
- String message = "This is root number "
- + ++application.numberOfRootsOpened;
-
- addComponent(new Label(message));
- }
- }
-
- public RootsInMultipleTabs() {
- addUIProvider(new AbstractUIProvider() {
- @Override
- public Class extends UI> getUIClass(Application application,
- WrappedRequest request)
- throws UIRequiresMoreInformationException {
- return TabRoot.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/TestRootTheme.html b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html
deleted file mode 100644
index 7d0f638325..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-New Test
-
-open
- /run/com.vaadin.tests.components.root.RootsInMultipleTabs?restartApplication
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- This is root number 1
-
-
-open
- /run/com.vaadin.tests.components.root.RootsInMultipleTabs
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- This is root number 2
-
-
-open
- /run/com.vaadin.tests.components.root.RootsInMultipleTabs?restartApplication
-
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- This is root number 1
-
-
-
-
-
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java
deleted file mode 100644
index 7a734e8497..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.vaadin.tests.components.root;
-
-import com.vaadin.annotations.Theme;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
-import com.vaadin.ui.Label;
-
-@Theme("tests-tickets")
-public class TestRootTheme extends AbstractTestRoot {
-
- @Override
- protected void setup(WrappedRequest request) {
- Label label = new Label("A red label");
- label.setStyleName("red");
- addComponent(label);
- }
-
- @Override
- public String getTestDescription() {
- return "UI with @RootTheme(\"tests-tickets\")";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return Integer.valueOf(7885);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html
deleted file mode 100644
index c91d742581..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-New Test
-
-open
- /run/com.vaadin.tests.components.root.TestRootTheme?restartApplication
-
-
-
-
-screenCapture
-
- themeLoaded
-
-
-
-
-
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java
deleted file mode 100644
index b92815eeed..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.vaadin.tests.components.root;
-
-import com.vaadin.annotations.Widgetset;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
-import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
-
-@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
-public class TestRootWidgetset extends AbstractTestRoot {
-
- @Override
- protected void setup(WrappedRequest request) {
- addComponent(new MissingFromDefaultWidgetsetComponent());
- }
-
- @Override
- public String getTestDescription() {
- return "This contents if this root should work as the component is present in TestingWidgetSet";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return Integer.valueOf(7885);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java
deleted file mode 100644
index d3be29215e..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.vaadin.tests.components.root;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
-import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
-
-public class TestRootWidgetset2 extends AbstractTestRoot {
-
- @Override
- protected void setup(WrappedRequest request) {
- addComponent(new MissingFromDefaultWidgetsetComponent());
- }
-
- @Override
- public String getTestDescription() {
- return "This contents if this root should not work as the component is not present in DefaultWidgetSet";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return Integer.valueOf(7885);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html
deleted file mode 100644
index d4704fea65..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-
-Ticket4607
-
-open
- /run/com.vaadin.tests.components.root.TestRootWidgetset
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootTestRootWidgetset::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]
- This component is available in TestingWidgetset, but not in DefaultWidgetset
-
-
-open
- /run/com.vaadin.tests.components.root.TestRootWidgetset2
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootTestRootWidgetset2::/VVerticalLayout[0]/VVerticalLayout[0]/VUnknownComponent[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]
- 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.
-
-
-
-
-
diff --git a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java
deleted file mode 100644
index d34c7718ce..0000000000
--- a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.vaadin.tests.components.root;
-
-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.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Label;
-
-public class UriFragmentTest extends AbstractTestRoot {
-
- private final Label fragmentLabel = new Label();
-
- @Override
- protected void setup(WrappedRequest request) {
- addComponent(fragmentLabel);
- updateLabel();
- getPage().addListener(new Page.FragmentChangedListener() {
- @Override
- public void fragmentChanged(FragmentChangedEvent event) {
- updateLabel();
- }
- });
- addComponent(new Button("Navigate to #test",
- new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- getPage().setFragment("test");
- }
- }));
- }
-
- private void updateLabel() {
- String fragment = getPage().getFragment();
- if (fragment == null) {
- fragmentLabel.setValue("No URI fragment set");
- } else {
- fragmentLabel.setValue("Current URI fragment: " + fragment);
- }
- }
-
- @Override
- public String getTestDescription() {
- return "URI fragment status should be known when the page is loaded and retained while navigating to different fragments or using the back and forward buttons.";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return Integer.valueOf(8048);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java
index 9a94a203f1..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,7 +14,7 @@ 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) {
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 @@
+
+
+
+
+
+
+
-
-New Test
-
-open
- /run/com.vaadin.tests.components.root.UriFragmentTest?restartApplication#urifragment
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- Current URI fragment: urifragment
-
-
-click
- vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- Current URI fragment: test
-
-
-runScript
- history.back()
-
-
-
-pause
-
- 1000
-
-
-waitForVaadin
-
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- Current URI fragment: urifragment
-
-
-runScript
- history.forward()
-
-
-
-pause
-
- 1000
-
-
-waitForVaadin
-
-
-
-
-
-assertText
- vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
- Current URI fragment: test
-
+
+
+
+
diff --git a/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.java b/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.java
new file mode 100644
index 0000000000..75a98ba14e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.java
@@ -0,0 +1,89 @@
+package com.vaadin.tests.components.ui;
+
+import com.vaadin.UIRequiresMoreInformationException;
+import com.vaadin.annotations.EagerInit;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.WrappedRequest;
+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.UI;
+
+public class LazyInitUIs extends AbstractTestApplication {
+
+ @EagerInit
+ private static class EagerInitUI extends UI {
+ @Override
+ public void init(WrappedRequest request) {
+ addComponent(getRequestInfo("EagerInitUI", request));
+ }
+ }
+
+ @Override
+ public UI getUI(WrappedRequest request)
+ throws UIRequiresMoreInformationException {
+ if (request.getParameter("lazyCreate") != null) {
+ // UI created on second request
+ BrowserDetails browserDetails = request.getBrowserDetails();
+ if (browserDetails == null
+ || browserDetails.getUriFragment() == null) {
+ throw new UIRequiresMoreInformationException();
+ } else {
+ UI uI = new UI() {
+ @Override
+ protected void init(WrappedRequest request) {
+ addComponent(getRequestInfo("LazyCreateUI", request));
+ }
+ };
+ return uI;
+ }
+ } else if (request.getParameter("eagerInit") != null) {
+ // UI inited on first request
+ return new EagerInitUI();
+ } else {
+ // The standard UI
+ UI uI = new UI() {
+ @Override
+ protected void init(WrappedRequest request) {
+ addComponent(getRequestInfo("NormalUI", request));
+
+ Link lazyCreateLink = new Link("Open lazyCreate UI",
+ new ExternalResource(getURL()
+ + "?lazyCreate#lazyCreate"));
+ lazyCreateLink.setTargetName("_blank");
+ addComponent(lazyCreateLink);
+
+ Link lazyInitLink = new Link("Open eagerInit UI",
+ new ExternalResource(getURL()
+ + "?eagerInit#eagerInit"));
+ lazyInitLink.setTargetName("_blank");
+ addComponent(lazyInitLink);
+ }
+ };
+
+ return uI;
+ }
+ }
+
+ public static Label getRequestInfo(String name, WrappedRequest request) {
+ String info = name;
+ info += "
+
+New Test
+
+open
+ /run/com.vaadin.tests.components.ui.LazyInitUIs/normalPath?restartApplication#normalFragment
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuilazyInitUIs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ NormalUI
+
pathInfo: /normalPath
parameters: [restartApplication]
uri fragment: normalFragment
+
+open
+ /run/com.vaadin.tests.components.ui.LazyInitUIs/lazyCreatePath?lazyCreate#lazyCreateFragment
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuilazyInitUIs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ LazyCreateUI
+
pathInfo: /lazyCreatePath
parameters: [lazyCreate]
uri fragment: lazyCreateFragment
+
+open
+ /run/com.vaadin.tests.components.ui.LazyInitUIs/eagerPath/?eagerInit#eagerFragment
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiLazyInitUIs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ EagerInitUI
+
pathInfo: /eagerPath/
parameters: [eagerInit]
uri fragment: null
pathInfo: " + request.getRequestPathInfo();
+ info += "
parameters: " + request.getParameterMap().keySet();
+ info += "
uri fragment: "
+ + request.getBrowserDetails().getUriFragment();
+ return new Label(info, ContentMode.XHTML);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ 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
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7883); // + #7882 + #7884
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.html b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.html
new file mode 100644
index 0000000000..ed2c0ec971
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.java b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.java
new file mode 100644
index 0000000000..39cc598094
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.components.ui;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Label;
+
+@Theme("tests-tickets")
+public class TestUITheme extends AbstractTestUI {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Label label = new Label("A red label");
+ label.setStyleName("red");
+ addComponent(label);
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "UI with @Theme(\"tests-tickets\")";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7885);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.html b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.html
new file mode 100644
index 0000000000..2f0858b4c7
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+New Test
+
+open
+ /run/com.vaadin.tests.components.ui.TestUITheme?restartApplication
+
+
+
+
+screenCapture
+
+ themeLoaded
+
+
+
+
+
diff --git a/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.java b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.java
new file mode 100644
index 0000000000..f26e94f243
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.java
@@ -0,0 +1,26 @@
+package com.vaadin.tests.components.ui;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
+
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class TestUIWidgetset extends AbstractTestUI {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(new MissingFromDefaultWidgetsetComponent());
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "This contents if this UI should work as the component is present in TestingWidgetSet";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7885);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset2.java b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset2.java
new file mode 100644
index 0000000000..84c0780240
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset2.java
@@ -0,0 +1,24 @@
+package com.vaadin.tests.components.ui;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
+
+public class TestUIWidgetset2 extends AbstractTestUI {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(new MissingFromDefaultWidgetsetComponent());
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "This contents if this UI should not work as the component is not present in DefaultWidgetSet";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7885);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/ui/UIInitException.java b/tests/testbench/com/vaadin/tests/components/ui/UIInitException.java
new file mode 100644
index 0000000000..29de6f6ac3
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/UIInitException.java
@@ -0,0 +1,23 @@
+package com.vaadin.tests.components.ui;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+
+public class UIInitException extends AbstractTestUI {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ throw new RuntimeException("Catch me if you can");
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Throwing an exception in application code during a browser details request should show a sensible message in the client";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8243);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/ui/UIInitTest.java b/tests/testbench/com/vaadin/tests/components/ui/UIInitTest.java
new file mode 100644
index 0000000000..6efe1d1b28
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/UIInitTest.java
@@ -0,0 +1,27 @@
+/*
+@ITMillApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.components.ui;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Label;
+
+public class UIInitTest extends AbstractTestUI {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(new Label("Hello UI"));
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "Testing basic UI creation";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(3067);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.html b/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.html
new file mode 100644
index 0000000000..08561588c4
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+Ticket4607
+
+open
+ /run/com.vaadin.tests.components.ui.TestUIWidgetset
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiTestUIWidgetset::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]
+ This component is available in TestingWidgetset, but not in DefaultWidgetset
+
+
+open
+ /run/com.vaadin.tests.components.ui.TestUIWidgetset2
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiTestUIWidgetset2::/VVerticalLayout[0]/VVerticalLayout[0]/VUnknownComponent[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]
+ 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.
+
+
+
+
+
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/ui/UriFragmentTest.html b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.html
new file mode 100644
index 0000000000..bcb9f52afe
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.html
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+New Test
+
+open
+ /run/com.vaadin.tests.components.ui.UIsInMultipleTabs?restartApplication
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiUIsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ This is UI number 1
+
+
+open
+ /run/com.vaadin.tests.components.ui.UIsInMultipleTabs
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiUIsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ This is UI number 2
+
+
+open
+ /run/com.vaadin.tests.components.ui.UIsInMultipleTabs?restartApplication
+
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiUIsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ This is UI number 1
+
+
+
+
+
diff --git a/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.java b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.java
new file mode 100644
index 0000000000..d2167e67c7
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.java
@@ -0,0 +1,53 @@
+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.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+
+public class UriFragmentTest extends AbstractTestUI {
+
+ private final Label fragmentLabel = new Label();
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(fragmentLabel);
+ updateLabel();
+ getPage().addListener(new Page.FragmentChangedListener() {
+ @Override
+ public void fragmentChanged(FragmentChangedEvent event) {
+ updateLabel();
+ }
+ });
+ addComponent(new Button("Navigate to #test",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ getPage().setFragment("test");
+ }
+ }));
+ }
+
+ private void updateLabel() {
+ String fragment = getPage().getFragment();
+ if (fragment == null) {
+ fragmentLabel.setValue("No URI fragment set");
+ } else {
+ fragmentLabel.setValue("Current URI fragment: " + fragment);
+ }
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "URI fragment status should be known when the page is loaded and retained while navigating to different fragments or using the back and forward buttons.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8048);
+ }
+
+}
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/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/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/minitutorials/v7a1/CustomConverterFactoryRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryRoot.java
deleted file mode 100644
index 89b4a0f8db..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryRoot.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.vaadin.tests.minitutorials.v7a1;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
-import com.vaadin.ui.TextField;
-
-public class CustomConverterFactoryRoot extends AbstractTestRoot {
- @Override
- public void setup(WrappedRequest request) {
- getApplication().setConverterFactory(new MyConverterFactory());
-
- TextField tf = new TextField("This is my double field");
- tf.setImmediate(true);
- tf.setConverter(Double.class);
- addComponent(tf);
-
- // As we do not set the locale explicitly for the field we set the value
- // after the field has been attached so it uses the application locale
- // for conversion
- tf.setConvertedValue(50.1);
-
- }
-
- @Override
- protected String getTestDescription() {
- return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Changing%20the%20default%20converters%20for%20an%20application";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return null;
- }
-}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryUI.java
new file mode 100644
index 0000000000..eb34747450
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryUI.java
@@ -0,0 +1,33 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.TextField;
+
+public class CustomConverterFactoryUI extends AbstractTestUI {
+ @Override
+ public void setup(WrappedRequest request) {
+ getApplication().setConverterFactory(new MyConverterFactory());
+
+ TextField tf = new TextField("This is my double field");
+ tf.setImmediate(true);
+ tf.setConverter(Double.class);
+ addComponent(tf);
+
+ // As we do not set the locale explicitly for the field we set the value
+ // after the field has been attached so it uses the application locale
+ // for conversion
+ tf.setConvertedValue(50.1);
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Changing%20the%20default%20converters%20for%20an%20application";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java
deleted file mode 100644
index 6c9282eb01..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.minitutorials.v7a1;
-
-import com.vaadin.annotations.Theme;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.UI;
-import com.vaadin.ui.VerticalLayout;
-
-/**
- * Mini tutorial code for
- * https://vaadin.com/wiki/-/wiki/Main/Defining%20the%20theme%20for%20a%20Root
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-@Theme("hello-theme")
-public class DefineRootTheme extends UI {
-
- @Override
- protected void init(WrappedRequest request) {
- VerticalLayout view = new VerticalLayout();
- view.addComponent(new Label("Hello Vaadin"));
- setContent(view);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java
new file mode 100644
index 0000000000..12938f9f12
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.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.minitutorials.v7a1;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Defining%20the%20theme%20for%20a%20Root
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+@Theme("hello-theme")
+public class DefineUITheme extends UI {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ VerticalLayout view = new VerticalLayout();
+ view.addComponent(new Label("Hello Vaadin"));
+ setContent(view);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageRoot.java
deleted file mode 100644
index 81f225bc63..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageRoot.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.vaadin.tests.minitutorials.v7a1;
-
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.imageio.ImageIO;
-
-import com.vaadin.Application;
-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.ui.Embedded;
-
-public class DynamicImageRoot extends AbstractTestRoot {
-
- @Override
- public void setup(WrappedRequest request) {
- // Add the request handler that handles our dynamic image
- getApplication().addRequestHandler(new DynamicImageRequestHandler());
-
- // Create a URL that we can handle in DynamicImageRequestHandler
- URL imageUrl;
- try {
- imageUrl = new URL(getApplication().getURL(),
- DynamicImageRequestHandler.IMAGE_URL + "?text=Hello!");
- } catch (MalformedURLException e) {
- // This should never happen
- throw new RuntimeException(e);
- }
-
- // Add an embedded using the created URL
- Embedded embedded = new Embedded("A dynamically generated image",
- new ExternalResource(imageUrl));
- embedded.setType(Embedded.TYPE_IMAGE);
- getContent().addComponent(embedded);
-
- }
-
- @Override
- protected String getTestDescription() {
- return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Generating%20dynamic%20resources%20based%20on%20URI%20or%20parameters";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return null;
- }
-}
-
-class DynamicImageRequestHandler implements RequestHandler {
-
- public static final String IMAGE_URL = "myimage.png";
-
- @Override
- public boolean handleRequest(Application application,
- WrappedRequest request, WrappedResponse response)
- throws IOException {
- String pathInfo = request.getRequestPathInfo();
- if (("/" + IMAGE_URL).equals(pathInfo)) {
- // Create an image, draw the "text" parameter to it and output it to
- // the browser.
- String text = request.getParameter("text");
- BufferedImage bi = new BufferedImage(100, 30,
- BufferedImage.TYPE_3BYTE_BGR);
- bi.getGraphics().drawChars(text.toCharArray(), 0, text.length(),
- 10, 20);
- response.setContentType("image/png");
- ImageIO.write(bi, "png", response.getOutputStream());
-
- return true;
- }
- // If the URL did not match our image URL, let the other request
- // handlers handle it
- return false;
- }
-}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java
new file mode 100644
index 0000000000..f3e96aaafc
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java
@@ -0,0 +1,80 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.imageio.ImageIO;
+
+import com.vaadin.Application;
+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.AbstractTestUI;
+import com.vaadin.ui.Embedded;
+
+public class DynamicImageUI extends AbstractTestUI {
+
+ @Override
+ public void setup(WrappedRequest request) {
+ // Add the request handler that handles our dynamic image
+ getApplication().addRequestHandler(new DynamicImageRequestHandler());
+
+ // Create a URL that we can handle in DynamicImageRequestHandler
+ URL imageUrl;
+ try {
+ imageUrl = new URL(getApplication().getURL(),
+ DynamicImageRequestHandler.IMAGE_URL + "?text=Hello!");
+ } catch (MalformedURLException e) {
+ // This should never happen
+ throw new RuntimeException(e);
+ }
+
+ // Add an embedded using the created URL
+ Embedded embedded = new Embedded("A dynamically generated image",
+ new ExternalResource(imageUrl));
+ embedded.setType(Embedded.TYPE_IMAGE);
+ getContent().addComponent(embedded);
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Generating%20dynamic%20resources%20based%20on%20URI%20or%20parameters";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+}
+
+class DynamicImageRequestHandler implements RequestHandler {
+
+ public static final String IMAGE_URL = "myimage.png";
+
+ @Override
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ String pathInfo = request.getRequestPathInfo();
+ if (("/" + IMAGE_URL).equals(pathInfo)) {
+ // Create an image, draw the "text" parameter to it and output it to
+ // the browser.
+ String text = request.getParameter("text");
+ BufferedImage bi = new BufferedImage(100, 30,
+ BufferedImage.TYPE_3BYTE_BGR);
+ bi.getGraphics().drawChars(text.toCharArray(), 0, text.length(),
+ 10, 20);
+ response.setContentType("image/png");
+ ImageIO.write(bi, "png", response.getOutputStream());
+
+ return true;
+ }
+ // If the URL did not match our image URL, let the other request
+ // handlers handle it
+ return false;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java
deleted file mode 100644
index a786ecb533..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.minitutorials.v7a1;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.WrappedRequest;
-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.UI;
-
-/**
- * Mini tutorial code for
- * https://vaadin.com/wiki/-/wiki/Main/Finding%20the%20current
- * %20Root%20and%20Application
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-public class FindCurrentRootAndApplication extends UI {
-
- @Override
- protected void init(WrappedRequest request) {
- Button helloButton = new Button("Say Hello");
- helloButton.addListener(new ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- String msg = "Running in ";
- msg += Application.getCurrent().isProductionMode() ? "production"
- : "debug";
- Notification.show(msg);
- }
- });
-
- helloButton.addListener(new ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- Notification.show("This UI is "
- + UI.getCurrent().getClass().getSimpleName());
- }
- });
-
- addComponent(helloButton);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java
new file mode 100644
index 0000000000..9830ee6aeb
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java
@@ -0,0 +1,61 @@
+/*
+ * 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.minitutorials.v7a1;
+
+import com.vaadin.Application;
+import com.vaadin.terminal.WrappedRequest;
+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.UI;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Finding%20the%20current
+ * %20Root%20and%20Application
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+public class FindCurrentUI extends UI {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ Button helloButton = new Button("Say Hello");
+ helloButton.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String msg = "Running in ";
+ msg += Application.getCurrent().isProductionMode() ? "production"
+ : "debug";
+ Notification.show(msg);
+ }
+ });
+
+ helloButton.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Notification.show("This UI is "
+ + UI.getCurrent().getClass().getSimpleName());
+ }
+ });
+
+ addComponent(helloButton);
+ }
+
+}
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/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/v7a2/ComponentInStateRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.java
deleted file mode 100644
index b5bf8538ed..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.java
+++ /dev/null
@@ -1,26 +0,0 @@
-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.UI;
-
-/**
- * Mini tutorial code for
- * https://vaadin.com/wiki/-/wiki/Main/Using%20Components%
- * 20in%20the%20shared%20state
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
-public class ComponentInStateRoot extends UI {
- @Override
- protected void init(WrappedRequest request) {
- ComponentInStateComponent component = new ComponentInStateComponent();
- component.setOtherComponent(this);
- addComponent(component);
- addComponent(new Label("Server-side type of other component: "
- + component.getOtherComponent().getClass().getName()));
- }
-}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateUI.java
new file mode 100644
index 0000000000..1bde122dbf
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateUI.java
@@ -0,0 +1,26 @@
+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.UI;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Using%20Components%
+ * 20in%20the%20shared%20state
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class ComponentInStateUI extends UI {
+ @Override
+ protected void init(WrappedRequest request) {
+ ComponentInStateComponent component = new ComponentInStateComponent();
+ component.setOtherComponent(this);
+ addComponent(component);
+ addComponent(new Label("Server-side type of other component: "
+ + component.getOtherComponent().getClass().getName()));
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java
deleted file mode 100644
index 87aede8da9..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.minitutorials.v7a2;
-
-import com.vaadin.annotations.Widgetset;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.UI;
-
-/**
- * Mini tutorial code for
- * https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20component,
- * https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20component,
- * https://vaadin.com/wiki/-/wiki/Main/Sending%
- * 20events%20from%20the%20client%20to%20the%20server%20using%20RPC,
- * https://vaadin
- * .com/wiki/-/wiki/Main/Using%20RPC%20to%20send%20events%20to%20the%20client
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
-public class MyComponentRoot extends UI {
-
- @Override
- protected void init(WrappedRequest request) {
- MyComponent component = new MyComponent();
-
- component.setText("My component text");
-
- addComponent(component);
- }
-
-}
\ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java
new file mode 100644
index 0000000000..d9091e4287
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java
@@ -0,0 +1,47 @@
+/*
+ * 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.minitutorials.v7a2;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.UI;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20component,
+ * https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20component,
+ * https://vaadin.com/wiki/-/wiki/Main/Sending%
+ * 20events%20from%20the%20client%20to%20the%20server%20using%20RPC,
+ * https://vaadin
+ * .com/wiki/-/wiki/Main/Using%20RPC%20to%20send%20events%20to%20the%20client
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class MyComponentUI extends UI {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ MyComponent component = new MyComponent();
+
+ component.setText("My component text");
+
+ addComponent(component);
+ }
+
+}
\ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java
deleted file mode 100644
index 04e2cf089e..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.minitutorials.v7a2;
-
-import com.vaadin.annotations.Widgetset;
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.UI;
-
-/**
- * Mini tutorial code for
- * https://vaadin.com/wiki/-/wiki/Main/Using%20Resources%20
- * in%20the%20shared%20state
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
-public class ResourceInStateRoot extends UI {
-
- @Override
- protected void init(WrappedRequest request) {
- ResourceInStateComponent component = new ResourceInStateComponent();
- component.setIcon(new ThemeResource("../runo/icons/32/calendar.png"));
-
- addComponent(component);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java
new file mode 100644
index 0000000000..37f4255cdd
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java
@@ -0,0 +1,43 @@
+/*
+ * 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.minitutorials.v7a2;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.ThemeResource;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.UI;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Using%20Resources%20
+ * in%20the%20shared%20state
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class ResourceInStateUI extends UI {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ ResourceInStateComponent component = new ResourceInStateComponent();
+ component.setIcon(new ThemeResource("../runo/icons/32/calendar.png"));
+
+ addComponent(component);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java
deleted file mode 100644
index 38f008d8a0..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.vaadin.tests.minitutorials.v7a2;
-
-import java.util.Random;
-
-import com.vaadin.annotations.Widgetset;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-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.UI;
-
-@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
-public class WidgetcontainerRoot extends UI {
- @Override
- public void init(WrappedRequest request) {
- Label label = new Label("Hello Vaadin user");
- addComponent(label);
- final WidgetContainer widgetContainer = new WidgetContainer();
- addComponent(widgetContainer);
- widgetContainer.addComponent(new Label(
- "Click the button to add components to the WidgetContainer."));
- Button button = new Button("Add more components", new ClickListener() {
-
- @Override
- public void buttonClick(ClickEvent event) {
- Random randomGenerator = new Random();
- int random = randomGenerator.nextInt(3);
- Component component;
- if (random % 3 == 0) {
- component = new Label("A new label");
- } else if (random % 3 == 1) {
- component = new Button("A button!");
- } else {
- component = new CheckBox("A textfield");
- }
- widgetContainer.addComponent(component);
- }
- });
- addComponent(button);
- }
-
-}
\ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java
new file mode 100644
index 0000000000..8c728548c0
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java
@@ -0,0 +1,45 @@
+package com.vaadin.tests.minitutorials.v7a2;
+
+import java.util.Random;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+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.UI;
+
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class WidgetcontainerUI extends UI {
+ @Override
+ public void init(WrappedRequest request) {
+ Label label = new Label("Hello Vaadin user");
+ addComponent(label);
+ final WidgetContainer widgetContainer = new WidgetContainer();
+ addComponent(widgetContainer);
+ widgetContainer.addComponent(new Label(
+ "Click the button to add components to the WidgetContainer."));
+ Button button = new Button("Add more components", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Random randomGenerator = new Random();
+ int random = randomGenerator.nextInt(3);
+ Component component;
+ if (random % 3 == 0) {
+ component = new Label("A new label");
+ } else if (random % 3 == 1) {
+ component = new Button("A button!");
+ } else {
+ component = new CheckBox("A textfield");
+ }
+ widgetContainer.addComponent(component);
+ }
+ });
+ addComponent(button);
+ }
+
+}
\ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java
deleted file mode 100644
index 05255d71cb..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.minitutorials.v7a3;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.UI;
-
-public class AnalyticsRoot extends UI {
-
- @Override
- protected void init(WrappedRequest request) {
- final Analytics analytics = new Analytics("UA-33036133-12");
- analytics.extend(this);
-
- addComponent(new Button("Track pageview", new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- analytics.trackPageview("/fake/url");
- }
- }));
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java
new file mode 100644
index 0000000000..bae3c4fc9c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java
@@ -0,0 +1,39 @@
+/*
+ * 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.minitutorials.v7a3;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI;
+
+public class AnalyticsUI extends UI {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ final Analytics analytics = new Analytics("UA-33036133-12");
+ analytics.extend(this);
+
+ addComponent(new Button("Track pageview", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ analytics.trackPageview("/fake/url");
+ }
+ }));
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRoot.java
deleted file mode 100644
index ffe654d0b3..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRoot.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.minitutorials.v7a3;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.UI;
-
-public class ComplexTypesRoot extends UI {
-
- @Override
- protected void init(WrappedRequest request) {
- ComplexTypesComponent complexTypesComponent = new ComplexTypesComponent();
- complexTypesComponent.sendComplexTypes();
- addComponent(complexTypesComponent);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java
new file mode 100644
index 0000000000..093f3269e0
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java
@@ -0,0 +1,31 @@
+/*
+ * 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.minitutorials.v7a3;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.UI;
+
+public class ComplexTypesUI extends UI {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ ComplexTypesComponent complexTypesComponent = new ComplexTypesComponent();
+ complexTypesComponent.sendComplexTypes();
+ addComponent(complexTypesComponent);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptRoot.java
deleted file mode 100644
index a8bf867fb5..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptRoot.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.minitutorials.v7a3;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.UI;
-
-public class FlotJavaScriptRoot extends UI {
-
- @Override
- protected void init(WrappedRequest request) {
- final Flot flot = new Flot();
- flot.setHeight("300px");
- flot.setWidth("400px");
-
- flot.addSeries(1, 2, 4, 8, 16);
- addComponent(flot);
-
- addComponent(new Button("Highlight point", new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- flot.highlight(0, 3);
- }
- }));
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java
new file mode 100644
index 0000000000..02bd8a7cce
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java
@@ -0,0 +1,43 @@
+/*
+ * 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.minitutorials.v7a3;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI;
+
+public class FlotJavaScriptUI extends UI {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ final Flot flot = new Flot();
+ flot.setHeight("300px");
+ flot.setWidth("400px");
+
+ flot.addSeries(1, 2, 4, 8, 16);
+ addComponent(flot);
+
+ addComponent(new Button("Highlight point", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ flot.highlight(0, 3);
+ }
+ }));
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonRoot.java
deleted file mode 100644
index 73fba3fd7e..0000000000
--- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonRoot.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.minitutorials.v7a3;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.UI;
-
-public class RedButtonRoot extends UI {
- @Override
- protected void init(WrappedRequest request) {
- addComponent(new RedButton("My red button"));
- }
-}
\ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java
new file mode 100644
index 0000000000..9384394870
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java
@@ -0,0 +1,27 @@
+/*
+ * 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.minitutorials.v7a3;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.UI;
+
+public class RedButtonUI extends UI {
+ @Override
+ protected void init(WrappedRequest request) {
+ addComponent(new RedButton("My red button"));
+ }
+}
\ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java b/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java
index 54170c880f..b775c18f8f 100644
--- a/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java
+++ b/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java
@@ -18,12 +18,12 @@ 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.DelegateToWidgetComponent;
@Widgetset(TestingWidgetSet.NAME)
-public class DelegateToWidgetTest extends AbstractTestRoot {
+public class DelegateToWidgetTest extends AbstractTestUI {
@Override
protected void setup(WrappedRequest request) {
addComponent(new DelegateToWidgetComponent());
diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java
index 110475e5a9..0bb3b6c542 100644
--- a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java
+++ b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java
@@ -18,13 +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(TestingWidgetSet.NAME)
-public class SerializerNamespaceTest extends AbstractTestRoot {
+public class SerializerNamespaceTest extends AbstractTestUI {
@Override
protected void setup(WrappedRequest request) {
diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java
index 3e194010d1..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);
diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModify.html b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModify.html
deleted file mode 100644
index 8888f95d15..0000000000
--- a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModify.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
+
+New Test
+
+open
+ /run/com.vaadin.tests.components.ui.UriFragmentTest?restartApplication#urifragment
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ Current URI fragment: urifragment
+
+
+click
+ vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ Current URI fragment: test
+
+
+runScript
+ history.back()
+
+
+
+pause
+
+ 1000
+
+
+waitForVaadin
+
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ Current URI fragment: urifragment
+
+
+runScript
+ history.forward()
+
+
+
+pause
+
+ 1000
+
+
+waitForVaadin
+
+
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]
+ Current URI fragment: test
+
-
-
-
-
diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyRoot.java b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyRoot.java
deleted file mode 100644
index eefd37522b..0000000000
--- a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyRoot.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.vaadincontext;
-
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
-
-public class BootstrapModifyRoot extends AbstractTestRoot {
-
- @Override
- protected void setup(WrappedRequest request) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- protected String getTestDescription() {
- return "There should be two additional divs in the HTML of the bootstrap page for this UI";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return Integer.valueOf(9274);
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.html b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.html
new file mode 100644
index 0000000000..e6fafb14fa
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
-
-New Test
-
-open
- /run/com.vaadin.tests.vaadincontext.BootstrapModifyRoot?restartApplication
-
-
-
-assertText
- vaadin=runcomvaadintestsvaadincontextBootstrapModifyRoot::/VVerticalLayout[0]/VLabel[0]
- There should be two additional divs in the HTML of the bootstrap page for this Root
-
-
-assertText
- //div[1]
- Added by modifyBootstrapPage
-
-
-assertText
- //div[2]
- Added by modifyBootstrapFragment
-
+
+
+
+
diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java
new file mode 100644
index 0000000000..c197bbde5d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java
@@ -0,0 +1,40 @@
+/*
+ * 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.vaadincontext;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+
+public class BootstrapModifyUI extends AbstractTestUI {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "There should be two additional divs in the HTML of the bootstrap page for this UI";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(9274);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java b/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java
index 4fa007b11d..9cd67e24b6 100644
--- a/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java
+++ b/tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java
@@ -44,7 +44,7 @@ public class TestAddonContextListener implements AddonContextListener {
private boolean shouldModify(BootstrapResponse response) {
UI uI = response.getUI();
boolean shouldModify = uI != null
- && uI.getClass() == BootstrapModifyRoot.class;
+ && uI.getClass() == BootstrapModifyUI.class;
return shouldModify;
}
--
cgit v1.2.3
From e362dec1811c9872419c5ea627c9e157a7abf8a0 Mon Sep 17 00:00:00 2001
From: Artur Signell
+
+New Test
+
+open
+ /run/com.vaadin.tests.vaadincontext.BootstrapModifyUI?restartApplication
+
+
+
+assertText
+ vaadin=runcomvaadintestsvaadincontextBootstrapModifyUI::/VVerticalLayout[0]/VLabel[0]
+ There should be two additional divs in the HTML of the bootstrap page for this UI
+
+
+assertText
+ //div[1]
+ Added by modifyBootstrapPage
+
+
+assertText
+ //div[2]
+ Added by modifyBootstrapFragment
+
+
+
+
+
--
cgit v1.2.3
From d379f5cb09a8530b9f6f24c600c5cc5acc7f36ea Mon Sep 17 00:00:00 2001
From: Johannes Dahlström
+
+New Test
+
+open
+ /run/com.vaadin.tests.components.loginform.LoginFormUIInLoginHandler?restartApplication
+
+
+
+waitForElementPresent
+ username
+
+
+
+enterCharacter
+ username
+ abc
+
+
+enterCharacter
+ password
+ def
+
+
+click
+ //form[@id='loginf']/div[5]/div/span/span
+
+
+
+pauseAndWait
+ 1000
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsloginformLoginFormUIInLoginHandler::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]
+ UI.getCurrent().data: This UI
+
+
+
+assertText
+ vaadin=runcomvaadintestscomponentsloginformLoginFormUIInLoginHandler::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]
+ event.getSource().data: This UI
+
+
+
+
+
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 @@
+
+
+
+
+
+
+
+
+EmbeddedBrowserIsVisible
+
+open
+ /run/com.vaadin.tests.components.embeddedbrowser.EmbeddedBrowserIsVisible?restartApplication
+
+
+
+screenCapture
+
+ show_initial
+
+
+click
+ vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[0]/domChild[0]/domChild[0]
+
+
+
+screenCapture
+
+ show_hello
+
+
+click
+ vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]
+
+
+
+screenCapture
+
+ show_lorem
+
+
+click
+ vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[2]/domChild[0]/domChild[0]
+
+
+
+screenCapture
+
+ show_alternative_text
+
+
+click
+ vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]
+
+
+
+
+screenCapture
+
+ show_lorem2
+
+
+
+
+
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/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 @@
+
+
+
+
+
+
+
+
+New Test
+
+
+open
+ /run/com.vaadin.tests.components.flash.FlashIsVisible
+
+
+
+pause
+ 5000
+
+
+
+
+screenCapture
+
+
+
+
+
+
+
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 @@
+
+
+
+
+
+
+
+
+ImageAltText
+
+open
+ /run/com.vaadin.tests.components.image.ImageAltText?restartApplication
+
+
+
+assertAttribute
+ vaadin=runcomvaadintestscomponentsimageImageAltText::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]@alt
+ Original alt text
+
+
+click
+ vaadin=runcomvaadintestscomponentsimageImageAltText::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]
+
+
+
+assertAttribute
+ vaadin=runcomvaadintestscomponentsimageImageAltText::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]@alt
+ New alt text!
+
+
+
+screenCapture
+
+ image_alt_text
+
+
+
+
+
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;
+ }
+ }
+
+ }
+}
--
cgit v1.2.3
From fc3f7f62b05ae69b242d64084f676d7733962c60 Mon Sep 17 00:00:00 2001
From: Johannes Dahlström
+
+ImageClicks
+
+open
+ /run/com.vaadin.tests.components.image.ImageClicks?restartApplication
+
+
+
+screenCapture
+
+ 0_clicks
+
+
+mouseClick
+ vaadin=runcomvaadintestscomponentsimageImageClicks::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]
+ 129,107
+
+
+screenCapture
+
+ 1_click
+
+
+mouseClick
+ vaadin=runcomvaadintestscomponentsimageImageClicks::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]
+ 129,107
+
+
+screenCapture
+
+ 2_clicks
+
+
+mouseClick
+ vaadin=runcomvaadintestscomponentsimageImageClicks::/VVerticalLayout[0]/VVerticalLayout[0]/VImage[0]
+ 273,273
+
+
+
+screenCapture
+
+ 3_clicks
+