]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remaining Root -> UI renames (#8908)
authorArtur Signell <artur@vaadin.com>
Fri, 24 Aug 2012 08:47:50 +0000 (11:47 +0300)
committerArtur Signell <artur@vaadin.com>
Fri, 24 Aug 2012 10:23:20 +0000 (13:23 +0300)
43 files changed:
client/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
client/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
client/src/com/vaadin/terminal/gwt/client/ui/UI/UIConnector.java
client/src/com/vaadin/terminal/gwt/client/ui/UI/VUI.java
client/src/com/vaadin/terminal/gwt/client/ui/notification/VNotification.java
server/src/com/vaadin/Application.java
server/src/com/vaadin/UIRequiresMoreInformationException.java
server/src/com/vaadin/terminal/AbstractRootProvider.java [deleted file]
server/src/com/vaadin/terminal/AbstractUIProvider.java [new file with mode: 0644]
server/src/com/vaadin/terminal/DefaultRootProvider.java [deleted file]
server/src/com/vaadin/terminal/DefaultUIProvider.java [new file with mode: 0644]
server/src/com/vaadin/terminal/Page.java
server/src/com/vaadin/terminal/WrappedRequest.java
server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java
server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java
server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java
server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java
server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java
server/src/com/vaadin/terminal/gwt/server/ClientConnector.java
server/src/com/vaadin/terminal/gwt/server/Constants.java
server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
server/src/com/vaadin/ui/AbstractComponent.java
server/src/com/vaadin/ui/ConnectorTracker.java
server/src/com/vaadin/ui/UI.java
server/src/com/vaadin/ui/Window.java
shared/src/com/vaadin/shared/ApplicationConstants.java
shared/src/com/vaadin/shared/ui/root/PageClientRpc.java [deleted file]
shared/src/com/vaadin/shared/ui/root/RootConstants.java [deleted file]
shared/src/com/vaadin/shared/ui/root/UIServerRpc.java [deleted file]
shared/src/com/vaadin/shared/ui/root/UIState.java [deleted file]
shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java [new file with mode: 0644]
shared/src/com/vaadin/shared/ui/ui/UIConstants.java [new file with mode: 0644]
shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java [new file with mode: 0644]
shared/src/com/vaadin/shared/ui/ui/UIState.java [new file with mode: 0644]
tests/server-side/com/vaadin/tests/server/component/root/CustomRootClassLoader.java
tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
tests/testbench/com/vaadin/tests/vaadincontext/TestAddonContextListener.java

index aa7a9fc72a7a4ffeda1ccc9535bbe2e4d0cd55e6..6621de7f957e4f324d2c2db1ac7867ce1fc21d13 100644 (file)
@@ -31,6 +31,7 @@ import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.Window;
 import com.vaadin.shared.ApplicationConstants;
+import com.vaadin.shared.ui.ui.UIConstants;
 import com.vaadin.terminal.gwt.client.metadata.BundleLoadCallback;
 import com.vaadin.terminal.gwt.client.metadata.ConnectorBundleLoader;
 import com.vaadin.terminal.gwt.client.metadata.NoDataException;
@@ -202,7 +203,7 @@ public class ApplicationConfiguration implements EntryPoint {
     private String id;
     private String themeUri;
     private String appUri;
-    private int rootId;
+    private int uiId;
     private boolean standalone;
     private ErrorMessage communicationError;
     private ErrorMessage authorizationError;
@@ -288,8 +289,8 @@ public class ApplicationConfiguration implements EntryPoint {
      * 
      * @return the root id
      */
-    public int getRootId() {
-        return rootId;
+    public int getUIId() {
+        return uiId;
     }
 
     public JavaScriptObject getVersionInfoJSObject() {
@@ -314,7 +315,8 @@ public class ApplicationConfiguration implements EntryPoint {
             appUri += '/';
         }
         themeUri = jsoConfiguration.getConfigString("themeUri");
-        rootId = jsoConfiguration.getConfigInteger("rootId").intValue();
+        uiId = jsoConfiguration.getConfigInteger(UIConstants.UI_ID_PARAMETER)
+                .intValue();
 
         // null -> true
         useDebugIdInDom = jsoConfiguration.getConfigBoolean("useDebugIdInDom") != Boolean.FALSE;
index 44f52d3e7f5bb23d746d081bebd091ec176d93a3..fc063a19081c25b866187fb59971ea8f9797b9b8 100644 (file)
@@ -58,6 +58,7 @@ import com.vaadin.shared.Version;
 import com.vaadin.shared.communication.LegacyChangeVariablesInvocation;
 import com.vaadin.shared.communication.MethodInvocation;
 import com.vaadin.shared.communication.SharedState;
+import com.vaadin.shared.ui.ui.UIConstants;
 import com.vaadin.terminal.gwt.client.ApplicationConfiguration.ErrorMessage;
 import com.vaadin.terminal.gwt.client.ResourceLoader.ResourceLoadEvent;
 import com.vaadin.terminal.gwt.client.ResourceLoader.ResourceLoadListener;
@@ -495,8 +496,8 @@ public class ApplicationConnection {
         if (extraParams != null && extraParams.length() > 0) {
             uri = addGetParameters(uri, extraParams);
         }
-        uri = addGetParameters(uri, ApplicationConstants.ROOT_ID_PARAMETER
-                + "=" + configuration.getRootId());
+        uri = addGetParameters(uri, UIConstants.UI_ID_PARAMETER + "="
+                + configuration.getUIId());
 
         doUidlRequest(uri, payload, forceSync);
 
index 2fb48623fdbcae66f3b676224c01f5881d5c3b39..f260481c3c87dec7009fc45d63ae34d418d05a2d 100644 (file)
@@ -36,10 +36,10 @@ import com.google.web.bindery.event.shared.HandlerRegistration;
 import com.vaadin.shared.MouseEventDetails;
 import com.vaadin.shared.ui.Connect;
 import com.vaadin.shared.ui.Connect.LoadStyle;
-import com.vaadin.shared.ui.root.PageClientRpc;
-import com.vaadin.shared.ui.root.RootConstants;
-import com.vaadin.shared.ui.root.UIServerRpc;
-import com.vaadin.shared.ui.root.UIState;
+import com.vaadin.shared.ui.ui.PageClientRpc;
+import com.vaadin.shared.ui.ui.UIConstants;
+import com.vaadin.shared.ui.ui.UIServerRpc;
+import com.vaadin.shared.ui.ui.UIState;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.ComponentConnector;
@@ -107,7 +107,7 @@ public class UIConnector extends AbstractComponentContainerConnector
         getWidget().connection = client;
 
         getWidget().immediate = getState().isImmediate();
-        getWidget().resizeLazy = uidl.hasAttribute(RootConstants.RESIZE_LAZY);
+        getWidget().resizeLazy = uidl.hasAttribute(UIConstants.RESIZE_LAZY);
         String newTheme = uidl.getStringAttribute("theme");
         if (getWidget().theme != null && !newTheme.equals(getWidget().theme)) {
             // Complete page refresh is needed due css can affect layout
@@ -263,9 +263,9 @@ public class UIConnector extends AbstractComponentContainerConnector
             scrollIntoView(connector);
         }
 
-        if (uidl.hasAttribute(RootConstants.FRAGMENT_VARIABLE)) {
+        if (uidl.hasAttribute(UIConstants.FRAGMENT_VARIABLE)) {
             getWidget().currentFragment = uidl
-                    .getStringAttribute(RootConstants.FRAGMENT_VARIABLE);
+                    .getStringAttribute(UIConstants.FRAGMENT_VARIABLE);
             if (!getWidget().currentFragment.equals(History.getToken())) {
                 History.newItem(getWidget().currentFragment, true);
             }
@@ -276,7 +276,7 @@ public class UIConnector extends AbstractComponentContainerConnector
 
             // Include current fragment in the next request
             client.updateVariable(getWidget().id,
-                    RootConstants.FRAGMENT_VARIABLE,
+                    UIConstants.FRAGMENT_VARIABLE,
                     getWidget().currentFragment, false);
         }
 
index cb6b181f1df793e512f2be834750b7c40f41fe0d..1c4b69a3b9a13f75cf81d35a3763d86b2ac01748 100644 (file)
@@ -33,7 +33,7 @@ import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.SimplePanel;
 import com.vaadin.shared.ApplicationConstants;
-import com.vaadin.shared.ui.root.RootConstants;
+import com.vaadin.shared.ui.ui.UIConstants;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.ComponentConnector;
@@ -130,7 +130,7 @@ public class VUI extends SimplePanel implements ResizeHandler,
             // Send the new fragment to the server if it has changed
             if (!newFragment.equals(currentFragment) && connection != null) {
                 currentFragment = newFragment;
-                connection.updateVariable(id, RootConstants.FRAGMENT_VARIABLE,
+                connection.updateVariable(id, UIConstants.FRAGMENT_VARIABLE,
                         newFragment, true);
             }
         }
index b4cea2dc7230d41d3d54b013b18e9c581db64e86..b668c9a88c1bded96cbeccf143122011ea040c30 100644 (file)
@@ -30,7 +30,7 @@ import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.shared.Position;
-import com.vaadin.shared.ui.root.RootConstants;
+import com.vaadin.shared.ui.ui.UIConstants;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.UIDL;
@@ -384,19 +384,19 @@ public class VNotification extends VOverlay {
     public static void showNotification(ApplicationConnection client,
             final UIDL notification) {
         boolean onlyPlainText = notification
-                .hasAttribute(RootConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED);
+                .hasAttribute(UIConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED);
         String html = "";
         if (notification
-                .hasAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_ICON)) {
+                .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_ICON)) {
             final String parsedUri = client
                     .translateVaadinUri(notification
-                            .getStringAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_ICON));
+                            .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_ICON));
             html += "<img src=\"" + Util.escapeAttribute(parsedUri) + "\" />";
         }
         if (notification
-                .hasAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_CAPTION)) {
+                .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION)) {
             String caption = notification
-                    .getStringAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_CAPTION);
+                    .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION);
             if (onlyPlainText) {
                 caption = Util.escapeHTML(caption);
                 caption = caption.replaceAll("\\n", "<br />");
@@ -404,9 +404,9 @@ public class VNotification extends VOverlay {
             html += "<h1>" + caption + "</h1>";
         }
         if (notification
-                .hasAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_MESSAGE)) {
+                .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE)) {
             String message = notification
-                    .getStringAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_MESSAGE);
+                    .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE);
             if (onlyPlainText) {
                 message = Util.escapeHTML(message);
                 message = message.replaceAll("\\n", "<br />");
@@ -415,16 +415,16 @@ public class VNotification extends VOverlay {
         }
 
         final String style = notification
-                .hasAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_STYLE) ? notification
-                .getStringAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_STYLE)
+                .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_STYLE) ? notification
+                .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_STYLE)
                 : null;
 
         final int pos = notification
-                .getIntAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_POSITION);
+                .getIntAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_POSITION);
         Position position = Position.values()[pos];
 
         final int delay = notification
-                .getIntAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_DELAY);
+                .getIntAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY);
         createNotification(delay).show(html, position, style);
     }
 
index 1827a55b725d664aa8e2cbd66eb5898f24ee8560..96d38e31cffda218e8b267b1e43e13711f517daa 100644 (file)
@@ -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;
     }
index 0d491895e5f534770421c15b0dc491dac5212e3e..493c31acb61c16f2864117eceed5ddb1bce56365 100644 (file)
@@ -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 (file)
index f316a58..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*\r
- * Copyright 2011 Vaadin Ltd.\r
- * \r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy of\r
- * the License at\r
- * \r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-\r
-package com.vaadin.terminal;\r
-\r
-import com.vaadin.Application;\r
-import com.vaadin.ui.UI;\r
-\r
-public abstract class AbstractRootProvider implements UIProvider {\r
-\r
-    @Override\r
-    public UI instantiateUI(Application application,\r
-            Class<? extends UI> type, WrappedRequest request) {\r
-        try {\r
-            return type.newInstance();\r
-        } catch (InstantiationException e) {\r
-            throw new RuntimeException("Could not instantiate root class", e);\r
-        } catch (IllegalAccessException e) {\r
-            throw new RuntimeException("Could not access root class", e);\r
-        }\r
-    }\r
-}\r
diff --git a/server/src/com/vaadin/terminal/AbstractUIProvider.java b/server/src/com/vaadin/terminal/AbstractUIProvider.java
new file mode 100644 (file)
index 0000000..5bb4d35
--- /dev/null
@@ -0,0 +1,35 @@
+/*\r
+ * Copyright 2011 Vaadin Ltd.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
+ * use this file except in compliance with the License. You may obtain a copy of\r
+ * the License at\r
+ * \r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
+ * License for the specific language governing permissions and limitations under\r
+ * the License.\r
+ */\r
+\r
+package com.vaadin.terminal;\r
+\r
+import com.vaadin.Application;\r
+import com.vaadin.ui.UI;\r
+\r
+public abstract class AbstractUIProvider implements UIProvider {\r
+\r
+    @Override\r
+    public UI instantiateUI(Application application,\r
+            Class<? extends UI> type, WrappedRequest request) {\r
+        try {\r
+            return type.newInstance();\r
+        } catch (InstantiationException e) {\r
+            throw new RuntimeException("Could not instantiate root class", e);\r
+        } catch (IllegalAccessException e) {\r
+            throw new RuntimeException("Could not access root class", e);\r
+        }\r
+    }\r
+}\r
diff --git a/server/src/com/vaadin/terminal/DefaultRootProvider.java b/server/src/com/vaadin/terminal/DefaultRootProvider.java
deleted file mode 100644 (file)
index b201be5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*\r
- * Copyright 2011 Vaadin Ltd.\r
- * \r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy of\r
- * the License at\r
- * \r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-\r
-package com.vaadin.terminal;\r
-\r
-import com.vaadin.Application;\r
-import com.vaadin.UIRequiresMoreInformationException;\r
-import com.vaadin.ui.UI;\r
-\r
-public class DefaultRootProvider extends AbstractRootProvider {\r
-\r
-    @Override\r
-    public Class<? extends UI> getUIClass(Application application,\r
-            WrappedRequest request) throws UIRequiresMoreInformationException {\r
-        Object rootClassNameObj = application\r
-                .getProperty(Application.UI_PARAMETER);\r
-\r
-        if (rootClassNameObj instanceof String) {\r
-            String rootClassName = rootClassNameObj.toString();\r
-\r
-            ClassLoader classLoader = request.getDeploymentConfiguration()\r
-                    .getClassLoader();\r
-            if (classLoader == null) {\r
-                classLoader = getClass().getClassLoader();\r
-            }\r
-            try {\r
-                Class<? extends UI> rootClass = Class.forName(rootClassName,\r
-                        true, classLoader).asSubclass(UI.class);\r
-\r
-                return rootClass;\r
-            } catch (ClassNotFoundException e) {\r
-                throw new RuntimeException("Could not find root class", e);\r
-            }\r
-        }\r
-\r
-        return null;\r
-    }\r
-}\r
diff --git a/server/src/com/vaadin/terminal/DefaultUIProvider.java b/server/src/com/vaadin/terminal/DefaultUIProvider.java
new file mode 100644 (file)
index 0000000..8713c45
--- /dev/null
@@ -0,0 +1,51 @@
+/*\r
+ * Copyright 2011 Vaadin Ltd.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
+ * use this file except in compliance with the License. You may obtain a copy of\r
+ * the License at\r
+ * \r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
+ * License for the specific language governing permissions and limitations under\r
+ * the License.\r
+ */\r
+\r
+package com.vaadin.terminal;\r
+\r
+import com.vaadin.Application;\r
+import com.vaadin.UIRequiresMoreInformationException;\r
+import com.vaadin.ui.UI;\r
+\r
+public class DefaultUIProvider extends AbstractUIProvider {\r
+\r
+    @Override\r
+    public Class<? extends UI> getUIClass(Application application,\r
+            WrappedRequest request) throws UIRequiresMoreInformationException {\r
+        Object uiClassNameObj = application\r
+                .getProperty(Application.UI_PARAMETER);\r
+\r
+        if (uiClassNameObj instanceof String) {\r
+            String uiClassName = uiClassNameObj.toString();\r
+\r
+            ClassLoader classLoader = request.getDeploymentConfiguration()\r
+                    .getClassLoader();\r
+            if (classLoader == null) {\r
+                classLoader = getClass().getClassLoader();\r
+            }\r
+            try {\r
+                Class<? extends UI> uiClass = Class.forName(uiClassName, true,\r
+                        classLoader).asSubclass(UI.class);\r
+\r
+                return uiClass;\r
+            } catch (ClassNotFoundException e) {\r
+                throw new RuntimeException("Could not find UI class", e);\r
+            }\r
+        }\r
+\r
+        return null;\r
+    }\r
+}\r
index 95f9a7b3ecfe46ace823057da518dacb489033f6..66ef7da2966e67a79d748caacc2d2d0e2b79da89 100644 (file)
@@ -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 {
      *         <code>null</code>
      */
     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();
     }
 
     /**
index 9ef98fcc41354c05e7f12012491615a4c3f8a43a..343a60848ee03bafd582d692ccc84ec3fe3cccd7 100644 (file)
@@ -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}
      * 
index 7a69a4c2b0bbe4e0a66111e8878cc985f8a1c8de..a9e60280901fb2d9bf83e65d311e84f0678fadd0 100644 (file)
@@ -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,
index b71c6ec20ced8d62599fc45a0391f55baeb974c6..6cf9b76b0d1bb1542ee281da3099519f598b2eea 100644 (file)
@@ -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;
index e19cfc4de6af9abc60d640078b0979e5e1521335..87eadd5df728470ec4c77e74824ede37c96a299b 100644 (file)
@@ -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 HashMap<Integer, ClientCache> rootToClientCache = new HashMap<Integer, ClientCache>();
+    private final HashMap<Integer, ClientCache> uiToClientCache = new HashMap<Integer, ClientCache>();
 
     private static final int MAX_BUFFER_SIZE = 64 * 1024;
 
@@ -570,7 +571,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
                 if (uI == null) {
                     // This should not happen, no windows exists but
                     // application is still open.
-                    getLogger().warning("Could not get root for application");
+                    getLogger().warning("Could not get UI for application");
                     return;
                 }
             } else {
@@ -810,17 +811,17 @@ public abstract class AbstractCommunicationManager implements Serializable {
 
     @SuppressWarnings("unchecked")
     public void writeUidlResponse(WrappedRequest request, boolean repaintAll,
-            final PrintWriter outWriter, UI uI, boolean analyzeLayouts)
+            final PrintWriter outWriter, UI ui, boolean analyzeLayouts)
             throws PaintException, JSONException {
         ArrayList<ClientConnector> dirtyVisibleConnectors = new ArrayList<ClientConnector>();
-        Application application = uI.getApplication();
+        Application application = ui.getApplication();
         // Paints components
-        ConnectorTracker rootConnectorTracker = uI.getConnectorTracker();
+        ConnectorTracker uiConnectorTracker = ui.getConnectorTracker();
         getLogger().log(Level.FINE, "* Creating response to client");
         if (repaintAll) {
-            getClientCache(uI).clear();
-            rootConnectorTracker.markAllConnectorsDirty();
-            rootConnectorTracker.markAllClientSidesUninitialized();
+            getClientCache(ui).clear();
+            uiConnectorTracker.markAllConnectorsDirty();
+            uiConnectorTracker.markAllClientSidesUninitialized();
 
             // Reset sent locales
             locales = null;
@@ -828,18 +829,18 @@ public abstract class AbstractCommunicationManager implements Serializable {
         }
 
         dirtyVisibleConnectors
-                .addAll(getDirtyVisibleConnectors(rootConnectorTracker));
+                .addAll(getDirtyVisibleConnectors(uiConnectorTracker));
 
         getLogger().log(
                 Level.FINE,
                 "Found " + dirtyVisibleConnectors.size()
                         + " dirty connectors to paint");
         for (ClientConnector connector : dirtyVisibleConnectors) {
-            boolean initialized = rootConnectorTracker
+            boolean initialized = uiConnectorTracker
                     .isClientSideInitialized(connector);
             connector.beforeClientResponse(!initialized);
         }
-        rootConnectorTracker.markAllConnectorsClean();
+        uiConnectorTracker.markAllConnectorsClean();
 
         outWriter.print("\"changes\":[");
 
@@ -851,12 +852,11 @@ public abstract class AbstractCommunicationManager implements Serializable {
 
         if (analyzeLayouts) {
             invalidComponentRelativeSizes = ComponentSizeValidator
-                    .validateComponentRelativeSizes(uI.getContent(), null,
-                            null);
+                    .validateComponentRelativeSizes(ui.getContent(), null, null);
 
             // Also check any existing subwindows
-            if (uI.getWindows() != null) {
-                for (Window subWindow : uI.getWindows()) {
+            if (ui.getWindows() != null) {
+                for (Window subWindow : ui.getWindows()) {
                     invalidComponentRelativeSizes = ComponentSizeValidator
                             .validateComponentRelativeSizes(
                                     subWindow.getContent(),
@@ -951,10 +951,10 @@ public abstract class AbstractCommunicationManager implements Serializable {
         outWriter.append(hierarchyInfo.toString());
         outWriter.print(", "); // close hierarchy
 
-        // send server to client RPC calls for components in the root, in call
+        // send server to client RPC calls for components in the UI, in call
         // order
 
-        // collect RPC calls from components in the root in the order in
+        // collect RPC calls from components in the UI in the order in
         // which they were performed, remove the calls from components
 
         LinkedList<ClientConnector> rpcPendingQueue = new LinkedList<ClientConnector>(
@@ -985,7 +985,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
                     // }
                     paramJson.put(JsonCodec.encode(
                             invocation.getParameters()[i], referenceParameter,
-                            parameterType, uI.getConnectorTracker()));
+                            parameterType, ui.getConnectorTracker()));
                 }
                 invocationJson.put(paramJson);
                 rpcCalls.put(invocationJson);
@@ -1087,7 +1087,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
             final String resource = (String) i.next();
             InputStream is = null;
             try {
-                is = getThemeResourceAsStream(uI, getTheme(uI), resource);
+                is = getThemeResourceAsStream(ui, getTheme(ui), resource);
             } catch (final Exception e) {
                 // FIXME: Handle exception
                 getLogger().log(Level.FINER,
@@ -1124,7 +1124,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
         Collection<Class<? extends ClientConnector>> usedClientConnectors = paintTarget
                 .getUsedClientConnectors();
         boolean typeMappingsOpen = false;
-        ClientCache clientCache = getClientCache(uI);
+        ClientCache clientCache = getClientCache(ui);
 
         List<Class<? extends ClientConnector>> newConnectorTypes = new ArrayList<Class<? extends ClientConnector>>();
 
@@ -1237,7 +1237,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
         }
 
         for (ClientConnector connector : dirtyVisibleConnectors) {
-            rootConnectorTracker.markClientSideInitialized(connector);
+            uiConnectorTracker.markClientSideInitialized(connector);
         }
 
         writePerformanceData(outWriter);
@@ -1390,11 +1390,11 @@ public abstract class AbstractCommunicationManager implements Serializable {
     }
 
     private ClientCache getClientCache(UI uI) {
-        Integer rootId = Integer.valueOf(uI.getUIId());
-        ClientCache cache = rootToClientCache.get(rootId);
+        Integer uiId = Integer.valueOf(uI.getUIId());
+        ClientCache cache = uiToClientCache.get(uiId);
         if (cache == null) {
             cache = new ClientCache();
-            rootToClientCache.put(rootId, cache);
+            uiToClientCache.put(uiId, cache);
         }
         return cache;
     }
@@ -1633,14 +1633,13 @@ public abstract class AbstractCommunicationManager implements Serializable {
      * 
      * @param source
      * @param uI
-     *            the root receiving the burst
+     *            the UI receiving the burst
      * @param burst
      *            the content of the burst as a String to be parsed
      * @return true if the processing of the burst was successful and there were
      *         no messages to non-existent components
      */
-    public boolean handleBurst(WrappedRequest source, UI uI,
-            final String burst) {
+    public boolean handleBurst(WrappedRequest source, UI uI, final String burst) {
         boolean success = true;
         try {
             Set<Connector> enabledConnectors = new HashSet<Connector>();
@@ -1878,8 +1877,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
     }
 
     protected ClientConnector getConnector(UI uI, String connectorId) {
-        ClientConnector c = uI.getConnectorTracker()
-                .getConnector(connectorId);
+        ClientConnector c = uI.getConnectorTracker().getConnector(connectorId);
         if (c == null
                 && connectorId.equals(getDragAndDropService().getConnectorId())) {
             return getDragAndDropService();
@@ -2231,7 +2229,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
      * invisible subtrees are omitted.
      * 
      * @param w
-     *            root window for which dirty components is to be fetched
+     *            UI window for which dirty components is to be fetched
      * @return
      */
     private ArrayList<ClientConnector> getDirtyVisibleConnectors(
@@ -2344,7 +2342,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
          * We will use the same APP/* URI space as ApplicationResources but
          * prefix url with UPLOAD
          * 
-         * eg. APP/UPLOAD/[ROOTID]/[PID]/[NAME]/[SECKEY]
+         * eg. APP/UPLOAD/[UIID]/[PID]/[NAME]/[SECKEY]
          * 
          * SECKEY is created on each paint to make URL's unpredictable (to
          * prevent CSRF attacks).
@@ -2353,8 +2351,8 @@ public abstract class AbstractCommunicationManager implements Serializable {
          * handling post
          */
         String paintableId = owner.getConnectorId();
-        int rootId = owner.getUI().getUIId();
-        String key = rootId + "/" + paintableId + "/" + name;
+        int uiId = owner.getUI().getUIId();
+        String key = uiId + "/" + paintableId + "/" + name;
 
         if (pidToNameToStreamVariable == null) {
             pidToNameToStreamVariable = new HashMap<String, Map<String, StreamVariable>>();
@@ -2415,7 +2413,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
             WrappedResponse response, Application application)
             throws IOException {
 
-        // if we do not yet have a currentRoot, it should be initialized
+        // if we do not yet have a currentUI, it should be initialized
         // shortly, and we should send the initial UIDL
         boolean sendUIDL = UI.getCurrent() == null;
 
@@ -2425,7 +2423,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
             UI uI = application.getUIForRequest(combinedRequest);
             response.setContentType("application/json; charset=UTF-8");
 
-            // Use the same logic as for determined roots
+            // Use the same logic as for determined UIs
             BootstrapHandler bootstrapHandler = getBootstrapHandler();
             BootstrapContext context = bootstrapHandler.createContext(
                     combinedRequest, response, application, uI.getUIId());
@@ -2434,13 +2432,13 @@ public abstract class AbstractCommunicationManager implements Serializable {
             String theme = context.getThemeName();
             String themeUri = bootstrapHandler.getThemeUri(context, theme);
 
-            // TODO These are not required if it was only the init of the root
+            // TODO These are not required if it was only the init of the UI
             // that was delayed
             JSONObject params = new JSONObject();
             params.put("widgetset", widgetset);
             params.put("themeUri", themeUri);
             // UI id might have changed based on e.g. window.name
-            params.put(ApplicationConstants.ROOT_ID_PARAMETER, uI.getUIId());
+            params.put(UIConstants.UI_ID_PARAMETER, uI.getUIId());
             if (sendUIDL) {
                 String initialUIDL = getInitialUIDL(combinedRequest, uI);
                 params.put("uidl", initialUIDL);
@@ -2474,7 +2472,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
      * @param request
      *            the request that caused the initialization
      * @param uI
-     *            the root for which the UIDL should be generated
+     *            the UI for which the UIDL should be generated
      * @return a string with the initial UIDL message
      * @throws PaintException
      *             if an exception occurs while painting
@@ -2523,7 +2521,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
         final String mimetype = response.getDeploymentConfiguration()
                 .getMimeType(resourceName);
 
-        // Security check: avoid accidentally serving from the root of the
+        // Security check: avoid accidentally serving from the UI of the
         // classpath instead of relative to the context class
         if (resourceName.startsWith("/")) {
             getLogger().warning(
@@ -2598,8 +2596,8 @@ public abstract class AbstractCommunicationManager implements Serializable {
     /**
      * Handles file upload request submitted via Upload component.
      * 
-     * @param root
-     *            The root for this request
+     * @param UI
+     *            The UI for this request
      * 
      * @see #getStreamVariableTargetUrl(ReceiverOwner, String, StreamVariable)
      * 
@@ -2613,7 +2611,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
             throws IOException, InvalidUIDLSecurityKeyException {
 
         /*
-         * URI pattern: APP/UPLOAD/[ROOTID]/[PID]/[NAME]/[SECKEY] See
+         * URI pattern: APP/UPLOAD/[UIID]/[PID]/[NAME]/[SECKEY] See
          * #createReceiverUrl
          */
 
@@ -2623,12 +2621,12 @@ public abstract class AbstractCommunicationManager implements Serializable {
                 .indexOf(ServletPortletHelper.UPLOAD_URL_PREFIX)
                 + ServletPortletHelper.UPLOAD_URL_PREFIX.length();
         String uppUri = pathInfo.substring(startOfData);
-        String[] parts = uppUri.split("/", 4); // 0= rootid, 1 = cid, 2= name, 3
+        String[] parts = uppUri.split("/", 4); // 0= UIid, 1 = cid, 2= name, 3
                                                // = sec key
-        String rootId = parts[0];
+        String uiId = parts[0];
         String connectorId = parts[1];
         String variableName = parts[2];
-        UI uI = application.getUIById(Integer.parseInt(rootId));
+        UI uI = application.getUIById(Integer.parseInt(uiId));
         UI.setCurrent(uI);
 
         StreamVariable streamVariable = getStreamVariable(connectorId,
index 14500b01de7e9b6cea1ba103c3713fd5f95c76ce..857c7c738c985ab80f5dd899fcc32859cd78efa1 100644 (file)
@@ -20,7 +20,7 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 
 import com.vaadin.Application;
-import com.vaadin.terminal.DefaultRootProvider;
+import com.vaadin.terminal.DefaultUIProvider;
 import com.vaadin.terminal.gwt.server.ServletPortletHelper.ApplicationClassException;
 
 /**
@@ -70,7 +70,7 @@ public class ApplicationServlet extends AbstractApplicationServlet {
         // Creates a new application instance
         try {
             final Application application = getApplicationClass().newInstance();
-            application.addUIProvider(new DefaultRootProvider());
+            application.addUIProvider(new DefaultUIProvider());
 
             return application;
         } catch (final IllegalAccessException e) {
index df776001506b080a1e3cafd46e535f20e96ffc55..6f690865236f5b46711f28d46300dc0bf68a3313 100644 (file)
@@ -48,17 +48,16 @@ public class BootstrapFragmentResponse extends BootstrapResponse {
      * @param application
      *            the application for which the bootstrap page should be
      *            generated
-     * @param rootId
-     *            the generated id of the UI that will be displayed on the
-     *            page
+     * @param uiId
+     *            the generated id of the UI that will be displayed on the page
      * @param fragmentNodes
      *            a mutable list containing the DOM nodes that will make up the
      *            application HTML
      */
     public BootstrapFragmentResponse(BootstrapHandler handler,
-            WrappedRequest request, Application application, Integer rootId,
+            WrappedRequest request, Application application, Integer uiId,
             List<Node> fragmentNodes) {
-        super(handler, request, application, rootId);
+        super(handler, request, application, uiId);
         this.fragmentNodes = fragmentNodes;
     }
 
index 1dfe9d1685d15db3aa279cd0212a1e4fddfa57da..d329159d958b946eca53345f2216e4cbcb0aff8d 100644 (file)
@@ -42,6 +42,7 @@ import com.vaadin.external.json.JSONException;
 import com.vaadin.external.json.JSONObject;
 import com.vaadin.shared.ApplicationConstants;
 import com.vaadin.shared.Version;
+import com.vaadin.shared.ui.ui.UIConstants;
 import com.vaadin.terminal.DeploymentConfiguration;
 import com.vaadin.terminal.PaintException;
 import com.vaadin.terminal.RequestHandler;
@@ -78,19 +79,19 @@ public abstract class BootstrapHandler implements RequestHandler {
             return bootstrapResponse.getApplication();
         }
 
-        public Integer getRootId() {
-            return bootstrapResponse.getRootId();
+        public Integer getUIId() {
+            return bootstrapResponse.getUIId();
         }
 
-        public UI getRoot() {
-            return bootstrapResponse.getRoot();
+        public UI getUI() {
+            return bootstrapResponse.getUI();
         }
 
         public String getWidgetsetName() {
             if (widgetsetName == null) {
-                UI uI = getRoot();
+                UI uI = getUI();
                 if (uI != null) {
-                    widgetsetName = getWidgetsetForRoot(this);
+                    widgetsetName = getWidgetsetForUI(this);
                 }
             }
             return widgetsetName;
@@ -98,7 +99,7 @@ public abstract class BootstrapHandler implements RequestHandler {
 
         public String getThemeName() {
             if (themeName == null) {
-                UI uI = getRoot();
+                UI uI = getUI();
                 if (uI != null) {
                     themeName = findAndEscapeThemeName(this);
                 }
@@ -125,7 +126,7 @@ public abstract class BootstrapHandler implements RequestHandler {
             throws IOException {
 
         // TODO Should all urls be handled here?
-        Integer rootId = null;
+        Integer uiId = null;
         try {
             UI uI = application.getUIForRequest(request);
             if (uI == null) {
@@ -133,14 +134,14 @@ public abstract class BootstrapHandler implements RequestHandler {
                 return true;
             }
 
-            rootId = Integer.valueOf(uI.getUIId());
+            uiId = Integer.valueOf(uI.getUIId());
         } catch (UIRequiresMoreInformationException e) {
-            // Just keep going without rootId
+            // Just keep going without uiId
         }
 
         try {
             BootstrapContext context = createContext(request, response,
-                    application, rootId);
+                    application, uiId);
             setupMainDiv(context);
 
             BootstrapFragmentResponse fragmentResponse = context
@@ -170,8 +171,8 @@ public abstract class BootstrapHandler implements RequestHandler {
             Map<String, Object> headers = new LinkedHashMap<String, Object>();
             Document document = Document.createShell("");
             BootstrapPageResponse pageResponse = new BootstrapPageResponse(
-                    this, request, context.getApplication(), context.getRootId(), document,
-                    headers);
+                    this, request, context.getApplication(), context.getUIId(),
+                    document, headers);
             List<Node> fragmentNodes = fragmentResponse.getFragmentNodes();
             Element body = document.body();
             for (Node node : fragmentNodes) {
@@ -246,7 +247,7 @@ public abstract class BootstrapHandler implements RequestHandler {
         head.appendElement("meta").attr("http-equiv", "X-UA-Compatible")
                 .attr("content", "chrome=1");
 
-        UI uI = context.getRoot();
+        UI uI = context.getUI();
         String title = ((uI == null || uI.getCaption() == null) ? "" : uI
                 .getCaption());
         head.appendElement("title").appendText(title);
@@ -272,10 +273,10 @@ public abstract class BootstrapHandler implements RequestHandler {
     }
 
     public BootstrapContext createContext(WrappedRequest request,
-            WrappedResponse response, Application application, Integer rootId) {
+            WrappedResponse response, Application application, Integer uiId) {
         BootstrapContext context = new BootstrapContext(response,
-                new BootstrapFragmentResponse(this, request,
-                        application, rootId, new ArrayList<Node>()));
+                new BootstrapFragmentResponse(this, request, application, uiId,
+                        new ArrayList<Node>()));
         return context;
     }
 
@@ -293,8 +294,8 @@ public abstract class BootstrapHandler implements RequestHandler {
      */
     protected abstract String getApplicationId(BootstrapContext context);
 
-    public String getWidgetsetForRoot(BootstrapContext context) {
-        UI uI = context.getRoot();
+    public String getWidgetsetForUI(BootstrapContext context) {
+        UI uI = context.getUI();
         WrappedRequest request = context.getRequest();
 
         String widgetset = uI.getApplication().getWidgetsetForUI(uI);
@@ -417,12 +418,12 @@ public abstract class BootstrapHandler implements RequestHandler {
     protected JSONObject getApplicationParameters(BootstrapContext context)
             throws JSONException, PaintException {
         Application application = context.getApplication();
-        Integer rootId = context.getRootId();
+        Integer uiId = context.getUIId();
 
         JSONObject appConfig = new JSONObject();
 
-        if (rootId != null) {
-            appConfig.put(ApplicationConstants.ROOT_ID_PARAMETER, rootId);
+        if (uiId != null) {
+            appConfig.put(UIConstants.UI_ID_PARAMETER, uiId);
         }
 
         if (context.getThemeName() != null) {
@@ -437,7 +438,7 @@ public abstract class BootstrapHandler implements RequestHandler {
 
         appConfig.put("widgetset", context.getWidgetsetName());
 
-        if (rootId == null || application.isUIInitPending(rootId.intValue())) {
+        if (uiId == null || application.isUIInitPending(uiId.intValue())) {
             appConfig.put("initialPath", context.getRequest()
                     .getRequestPathInfo());
 
@@ -447,7 +448,7 @@ public abstract class BootstrapHandler implements RequestHandler {
         } else {
             // write the initial UIDL into the config
             appConfig.put("uidl",
-                    getInitialUIDL(context.getRequest(), context.getRoot()));
+                    getInitialUIDL(context.getRequest(), context.getUI()));
         }
 
         return appConfig;
@@ -533,7 +534,7 @@ public abstract class BootstrapHandler implements RequestHandler {
      * @return
      */
     public String getThemeName(BootstrapContext context) {
-        return context.getApplication().getThemeForUI(context.getRoot());
+        return context.getApplication().getThemeForUI(context.getUI());
     }
 
     /**
@@ -568,15 +569,15 @@ public abstract class BootstrapHandler implements RequestHandler {
      * 
      * @param request
      *            the originating request
-     * @param uI
-     *            the root for which the UIDL should be generated
+     * @param ui
+     *            the UI for which the UIDL should be generated
      * @return a string with the initial UIDL message
      * @throws PaintException
      *             if an exception occurs while painting the components
      * @throws JSONException
      *             if an exception occurs while formatting the output
      */
-    protected abstract String getInitialUIDL(WrappedRequest request, UI uI)
+    protected abstract String getInitialUIDL(WrappedRequest request, UI ui)
             throws PaintException, JSONException;
 
 }
index 535ab23c92d513f6d64546c5a76f890d690d1b60..847578ef97dfd4a9069925e63fb515497843821a 100644 (file)
@@ -51,7 +51,7 @@ public class BootstrapPageResponse extends BootstrapResponse {
      * @param application
      *            the application for which the bootstrap page should be
      *            generated
-     * @param rootId
+     * @param uiId
      *            the generated id of the UI that will be displayed on the
      *            page
      * @param document
@@ -60,9 +60,9 @@ public class BootstrapPageResponse extends BootstrapResponse {
      *            a map into which header data can be added
      */
     public BootstrapPageResponse(BootstrapHandler handler,
-            WrappedRequest request, Application application, Integer rootId,
+            WrappedRequest request, Application application, Integer uiId,
             Document document, Map<String, Object> headers) {
-        super(handler, request, application, rootId);
+        super(handler, request, application, uiId);
         this.headers = headers;
         this.document = document;
     }
index 2518f7080ec13d4f1b6f8fc2f233091194131412..a422cba345eb780b3ab940f1447281b07fe0da27 100644 (file)
@@ -33,7 +33,7 @@ import com.vaadin.ui.UI;
 public abstract class BootstrapResponse extends EventObject {
     private final WrappedRequest request;
     private final Application application;
-    private final Integer rootId;
+    private final Integer uiId;
 
     /**
      * Creates a new bootstrap event.
@@ -46,16 +46,15 @@ public abstract class BootstrapResponse extends EventObject {
      * @param application
      *            the application for which the bootstrap page should be
      *            generated
-     * @param rootId
-     *            the generated id of the UI that will be displayed on the
-     *            page
+     * @param uiId
+     *            the generated id of the UI that will be displayed on the page
      */
     public BootstrapResponse(BootstrapHandler handler, WrappedRequest request,
-            Application application, Integer rootId) {
+            Application application, Integer uiId) {
         super(handler);
         this.request = request;
         this.application = application;
-        this.rootId = rootId;
+        this.uiId = uiId;
     }
 
     /**
@@ -91,20 +90,20 @@ public abstract class BootstrapResponse extends EventObject {
     }
 
     /**
-     * Gets the root id that has been generated for this response. Please note
+     * Gets the UI id that has been generated for this response. Please note
      * that if {@link Application#isUiPreserved()} is enabled, a previously
      * created UI with a different id might eventually end up being used.
      * 
-     * @return the root id
+     * @return the UI id
      */
-    public Integer getRootId() {
-        return rootId;
+    public Integer getUIId() {
+        return uiId;
     }
 
     /**
      * Gets the UI for which this page is being rendered, if available. Some
-     * features of the framework will postpone the UI selection until after
-     * the bootstrap page has been rendered and required information from the
+     * features of the framework will postpone the UI selection until after the
+     * bootstrap page has been rendered and required information from the
      * browser has been sent back. This method will return <code>null</code> if
      * no UI instance is yet available.
      * 
@@ -116,7 +115,7 @@ public abstract class BootstrapResponse extends EventObject {
      *         <code>null</code> if all required information is not yet
      *         available.
      */
-    public UI getRoot() {
+    public UI getUI() {
         return UI.getCurrent();
     }
 }
index 1a5019a7c1886fc22f203ea078c0efdc22b75e7d..c2fbbe37d4431d598e936c9296760cdaadf2569a 100644 (file)
@@ -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
index 78c043da694cf9bea2875812b0a497d09b52b878..40386d6eb7d0cd1599d625833084ae55fca3a8a4 100644 (file)
@@ -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";
 
index a5a3e9495449d9f821d4620b2dacddabaacfdfce..8538d42604cde40b7145d03447ce454d88b4c8da 100644 (file)
@@ -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 {
index 7e669d939c04ff2cdd5d17117ee80e2d323f5e2b..403cffb47c53cc8351c848aa3fcab4cacde5fe2b 100644 (file)
@@ -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);
index 0b97e1667d3d867c7e7ceb3026745f4035a411ce..a52a07f2669621aa765d866036ddb1b4a2752244 100644 (file)
@@ -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.
index c7c7bc97841c53054b7b8059b7bad0525a7dbdf3..ad5990137ce5bb7d43371bf9e6062c8087442c77 100644 (file)
@@ -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());
     }
 
     /**
index c0b3ed99291460b451cd730453475bac83a134dc..aede1af54b92dbd80283083d25da9633ee1af777 100644 (file)
@@ -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.
  * </p>
  * <p>
@@ -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);
         }
     }
index ad2bbd05763ed2acf0dfcf2da5113434a535c3a3..6102350566265d39f50c193f47f474e270d144fe 100644 (file)
@@ -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.
      * <p>
-     * This method can only be called if this window connected a root. Else an
+     * This method can only be called if this window connected a UI. Else an
      * illegal state exception is thrown. Also if there are modal windows and
      * this window is not modal, and illegal state exception is thrown.
      * <p>
@@ -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,
index 31e633a210418bf615b61d422147a2a69505294b..ba35ddea50cd7b180f2aa72e7f96ff3617ec4c9b 100644 (file)
@@ -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 (file)
index b7d9419..0000000
+++ /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 (file)
index 34c17ac..0000000
+++ /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 (file)
index 20cdd48..0000000
+++ /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 (file)
index f019d1c..0000000
+++ /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 (file)
index 0000000..a3cbc10
--- /dev/null
@@ -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 (file)
index 0000000..7641362
--- /dev/null
@@ -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 (file)
index 0000000..ef28a12
--- /dev/null
@@ -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 (file)
index 0000000..01426bd
--- /dev/null
@@ -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
index 59b1299db256a41ccdb5ed8d1ffb9775da366826..aa4fa22d06c9a4c614f92b14bcfb7fc4c27a5672 100644 (file)
@@ -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
index 261154620339c1010ec1d6548a7802cddb8c0529..8183ed2d0b5d2674405bc39bc589e64da3c0cf1b 100644 (file)
@@ -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(
index b9b9c509c17b7a259a22be5dd32b6bc7ac943487..f48ca28dbf4b6aa3083cf161fe9fa89c36070d7a 100644 (file)
@@ -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)
index 238983d9069600ef8b0f052122fec191d6a82922..97506f7ad6fc30779a211a5882fbf4c3ec2a25bd 100644 (file)
@@ -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)
index a525d3139b2aeb3101f516f3fbcfc891f9af4c89..4fa007b11d0e2673e2bcd2d59709e5c172b299c9 100644 (file)
@@ -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;