/**
* Gets the root if of this application instance. The root id should be
* included in every request originating from this instance in order to
- * associate it with the right Root instance on the server.
+ * associate it with the right UI instance on the server.
*
* @return the root id
*/
}
public ApplicationConnection() {
- // Assuming Root data is eagerly loaded
+ // Assuming UI data is eagerly loaded
ConnectorBundleLoader.get().loadBundle(
ConnectorBundleLoader.EAGER_BUNDLE_NAME, null);
rootConnector = GWT.create(RootConnector.class);
import com.vaadin.terminal.gwt.client.ui.layout.MayScrollChildren;
import com.vaadin.terminal.gwt.client.ui.notification.VNotification;
import com.vaadin.terminal.gwt.client.ui.window.WindowConnector;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
-@Connect(value = Root.class, loadStyle = LoadStyle.EAGER)
+@Connect(value = UI.class, loadStyle = LoadStyle.EAGER)
public class RootConnector extends AbstractComponentContainerConnector
implements Paintable, MayScrollChildren {
}
/**
- * Checks if the given sub window is a child of this Root Connector
+ * Checks if the given sub window is a child of this UI Connector
*
* @deprecated Should be replaced by a more generic mechanism for getting
* non-ComponentConnector children
import com.vaadin.tools.ReflectTools;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractField;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
import com.vaadin.ui.Table;
import com.vaadin.ui.Window;
/**
* The name of the parameter that is by default used in e.g. web.xml to
- * define the name of the default {@link Root} class.
+ * define the name of the default {@link UI} class.
*/
public static final String ROOT_PARAMETER = "root";
private static final Pattern WINDOW_NAME_PATTERN = Pattern
.compile("^/?([^/]+).*");
- private Root.LegacyWindow mainWindow;
+ private UI.LegacyWindow mainWindow;
private String theme;
- private Map<String, Root.LegacyWindow> legacyRootNames = new HashMap<String, Root.LegacyWindow>();
+ private Map<String, UI.LegacyWindow> legacyRootNames = new HashMap<String, UI.LegacyWindow>();
/**
* Sets the main window of this application. Setting window as a main
* @param mainWindow
* the root to set as the default window
*/
- public void setMainWindow(Root.LegacyWindow mainWindow) {
+ public void setMainWindow(UI.LegacyWindow mainWindow) {
if (this.mainWindow != null) {
throw new IllegalStateException(
"mainWindow has already been set");
*
* @return the root used as the default window
*/
- public Root.LegacyWindow getMainWindow() {
+ public UI.LegacyWindow getMainWindow() {
return mainWindow;
}
*/
@Override
- public Root.LegacyWindow getRoot(WrappedRequest request) {
+ public UI.LegacyWindow getRoot(WrappedRequest request) {
String pathInfo = request.getRequestPathInfo();
String name = null;
if (pathInfo != null && pathInfo.length() > 0) {
name = matcher.group(1);
}
}
- Root.LegacyWindow window = getWindow(name);
+ UI.LegacyWindow window = getWindow(name);
if (window != null) {
return window;
}
* Sets the application's theme.
* <p>
* Note that this theme can be overridden for a specific root with
- * {@link Application#getThemeForRoot(Root)}. Setting theme to be
+ * {@link Application#getThemeForRoot(UI)}. Setting theme to be
* <code>null</code> selects the default theme. For the available theme
* names, see the contents of the VAADIN/themes directory.
* </p>
/**
* Gets the application's theme. The application's theme is the default
- * theme used by all the roots for which a theme is not explicitly
+ * theme used by all the uIs for which a theme is not explicitly
* defined. If the application theme is not explicitly set,
* <code>null</code> is returned.
*
*/
@Override
- public String getThemeForRoot(Root root) {
+ public String getThemeForRoot(UI uI) {
return theme;
}
* @return a root corresponding to the name, or <code>null</code> to use
* the default window
*/
- public Root.LegacyWindow getWindow(String name) {
+ public UI.LegacyWindow getWindow(String name) {
return legacyRootNames.get(name);
}
/**
* 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)}.
*
* <p>
* Note that removing window from the application does not close the
* browser window - the window is only removed from the server-side.
* </p>
*
- * @param root
+ * @param uI
* the root to remove
*/
- public void removeWindow(Root.LegacyWindow root) {
- for (Entry<String, Root.LegacyWindow> entry : legacyRootNames
+ public void removeWindow(UI.LegacyWindow uI) {
+ for (Entry<String, UI.LegacyWindow> entry : legacyRootNames
.entrySet()) {
- if (entry.getValue() == root) {
+ if (entry.getValue() == uI) {
legacyRootNames.remove(entry.getKey());
}
}
*
* @return the unmodifiable collection of windows.
*/
- public Collection<Root.LegacyWindow> getWindows() {
+ public Collection<UI.LegacyWindow> getWindows() {
return Collections.unmodifiableCollection(legacyRootNames.values());
}
}
private LinkedList<RequestHandler> requestHandlers = new LinkedList<RequestHandler>();
private int nextRootId = 0;
- private Map<Integer, Root> roots = new HashMap<Integer, Root>();
+ private Map<Integer, UI> uIs = new HashMap<Integer, UI>();
private final Map<String, Integer> retainOnRefreshRoots = new HashMap<String, Integer>();
private final EventRouter eventRouter = new EventRouter();
/**
- * Keeps track of which roots have been inited.
+ * Keeps track of which uIs have been inited.
* <p>
* TODO Investigate whether this might be derived from the different states
* in getRootForRrequest.
* </p>
*
* <p>
- * 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
*
* <p>
* 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.
* </p>
*
* {@link BrowserDetails} are required to create a root
*
* @see #getRootClassName(WrappedRequest)
- * @see Root
+ * @see UI
* @see RootRequiresMoreInformationException
* @see WrappedRequest#getBrowserDetails()
*
* @since 7.0
*/
- protected Root getRoot(WrappedRequest request)
+ protected UI getRoot(WrappedRequest request)
throws RootRequiresMoreInformationException {
// Iterate in reverse order - test check newest provider first
for (int i = rootProviders.size() - 1; i >= 0; i--) {
RootProvider provider = rootProviders.get(i);
- Class<? extends Root> rootClass = provider.getRootClass(this,
+ Class<? extends UI> rootClass = provider.getRootClass(this,
request);
if (rootClass != null) {
*
* TODO Tell what the default implementation does once it does something.
*
- * @param root
+ * @param uI
* the root to get a theme for
* @return the name of the theme, or <code>null</code> if the default theme
* should be used
*
* @since 7.0
*/
- public String getThemeForRoot(Root root) {
- Theme rootTheme = getAnnotationFor(root.getClass(), Theme.class);
+ public String getThemeForRoot(UI uI) {
+ Theme rootTheme = getAnnotationFor(uI.getClass(), Theme.class);
if (rootTheme != null) {
return rootTheme.value();
} else {
*
* 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 <code>null</code> 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();
}
/**
- * 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.
* <p>
* Please note that this method can also return a newly created
- * <code>Root</code> which has not yet been initialized. You can use
+ * <code>UI</code> which has not yet been initialized. You can use
* {@link #isRootInitPending(int)} with the root's id (
- * {@link Root#getRootId()} to check whether the initialization is still
+ * {@link UI#getRootId()} to check whether the initialization is still
* pending.
* </p>
*
*
* @since 7.0
*/
- public Root getRootForRequest(WrappedRequest request)
+ public UI getRootForRequest(WrappedRequest request)
throws RootRequiresMoreInformationException {
- Root root = Root.getCurrent();
- if (root != null) {
- return root;
+ UI uI = UI.getCurrent();
+ if (uI != null) {
+ return uI;
}
Integer rootId = getRootId(request);
boolean hasBrowserDetails = browserDetails != null
&& browserDetails.getUriFragment() != null;
- root = roots.get(rootId);
+ uI = uIs.get(rootId);
- if (root == null && isRootPreserved()) {
+ if (uI == null && isRootPreserved()) {
// Check for a known root
if (!retainOnRefreshRoots.isEmpty()) {
if (retainedRootId != null) {
rootId = retainedRootId;
- root = roots.get(rootId);
+ uI = uIs.get(rootId);
}
}
}
- if (root == null) {
+ if (uI == null) {
// Throws exception if root can not yet be created
- root = getRoot(request);
+ uI = getRoot(request);
// Initialize some fields for a newly created root
- if (root.getApplication() == null) {
- root.setApplication(this);
+ if (uI.getApplication() == null) {
+ uI.setApplication(this);
}
- if (root.getRootId() < 0) {
+ if (uI.getRootId() < 0) {
if (rootId == null) {
// Get the next id if none defined
rootId = Integer.valueOf(nextRootId++);
}
- root.setRootId(rootId.intValue());
- roots.put(rootId, root);
+ uI.setRootId(rootId.intValue());
+ uIs.put(rootId, uI);
}
}
// Set thread local here so it is available in init
- Root.setCurrent(root);
+ UI.setCurrent(uI);
if (!initedRoots.contains(rootId)) {
boolean initRequiresBrowserDetails = isRootPreserved()
- || !root.getClass()
+ || !uI.getClass()
.isAnnotationPresent(EagerInit.class);
if (!initRequiresBrowserDetails || hasBrowserDetails) {
- root.doInit(request);
+ uI.doInit(request);
// Remember that this root has been initialized
initedRoots.add(rootId);
}
} // end synchronized block
- return root;
+ return uI;
}
/**
}
/**
- * Sets whether the same Root state should be reused if the framework can
+ * Sets whether the same UI state should be reused if the framework can
* detect that the application is opened in a browser window where it has
* previously been open. The framework attempts to discover this by checking
* the value of window.name in the browser.
* </p>
*
* @param rootPreserved
- * <code>true</code>if the same Root instance should be reused
+ * <code>true</code>if the same UI instance should be reused
* e.g. when the browser window is refreshed.
*/
public void setRootPreserved(boolean rootPreserved) {
}
/**
- * Checks whether the same Root state should be reused if the framework can
+ * Checks whether the same UI state should be reused if the framework can
* detect that the application is opened in a browser window where it has
* previously been open. The framework attempts to discover this by checking
* the value of window.name in the browser.
*
- * @return <code>true</code>if the same Root instance should be reused e.g.
+ * @return <code>true</code>if the same UI instance should be reused e.g.
* when the browser window is refreshed.
*/
public boolean isRootPreserved() {
}
/**
- * 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<Root> getRoots() {
- return Collections.unmodifiableCollection(roots.values());
+ public Collection<UI> getRoots() {
+ return Collections.unmodifiableCollection(uIs.values());
}
private int connectorIdSequence = 0;
}
/**
- * Returns a Root with the given id.
+ * Returns a UI with the given id.
* <p>
* This is meant for framework internal use.
* </p>
* 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);
}
/**
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
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)
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)
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
/* 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);
}
}
sharedState = createState();
}
- Root root = getRoot();
- if (root != null && !root.getConnectorTracker().isDirty(this)) {
+ UI uI = getRoot();
+ if (uI != null && !uI.getConnectorTracker().isDirty(this)) {
requestRepaint();
}
* @return The connector's application, or <code>null</code> 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. <code>null</code> is returned if
- * no Root ancestor is found (typically because the connector is not
+ * Finds a UI ancestor of this connector. <code>null</code> is returned if
+ * no UI ancestor is found (typically because the connector is not
* attached to a proper hierarchy).
*
- * @return the Root ancestor of this connector, or <code>null</code> if none
+ * @return the UI ancestor of this connector, or <code>null</code> if none
* is found.
*/
@Override
- public Root getRoot() {
+ public UI getRoot() {
ClientConnector connector = this;
while (connector != null) {
- if (connector instanceof Root) {
- return (Root) connector;
+ if (connector instanceof UI) {
+ return (UI) connector;
}
connector = connector.getParent();
}
package com.vaadin.terminal;\r
\r
import com.vaadin.Application;\r
-import com.vaadin.ui.Root;\r
+import com.vaadin.ui.UI;\r
\r
public abstract class AbstractRootProvider implements RootProvider {\r
\r
@Override\r
- public Root instantiateRoot(Application application,\r
- Class<? extends Root> type, WrappedRequest request) {\r
+ public UI instantiateRoot(Application application,\r
+ Class<? extends UI> type, WrappedRequest request) {\r
try {\r
return type.newInstance();\r
} catch (InstantiationException e) {\r
\r
import com.vaadin.Application;\r
import com.vaadin.RootRequiresMoreInformationException;\r
-import com.vaadin.ui.Root;\r
+import com.vaadin.ui.UI;\r
\r
public class DefaultRootProvider extends AbstractRootProvider {\r
\r
@Override\r
- public Class<? extends Root> getRootClass(Application application,\r
+ public Class<? extends UI> getRootClass(Application application,\r
WrappedRequest request) throws RootRequiresMoreInformationException {\r
Object rootClassNameObj = application\r
.getProperty(Application.ROOT_PARAMETER);\r
classLoader = getClass().getClassLoader();\r
}\r
try {\r
- Class<? extends Root> rootClass = Class.forName(rootClassName,\r
- true, classLoader).asSubclass(Root.class);\r
+ Class<? extends UI> rootClass = Class.forName(rootClassName,\r
+ true, classLoader).asSubclass(UI.class);\r
\r
return rootClass;\r
} catch (ClassNotFoundException e) {\r
/**
* Get the class loader to use for loading classes loaded by name, e.g.
- * custom Root classes. <code>null</code> indicates that the default class
+ * custom UI classes. <code>null</code> indicates that the default class
* loader should be used.
*
* @return the class loader to use, or <code>null</code>
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
}
/**
- * 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 {
* 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
}
/**
- * 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();
*/
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) {
if (fireEvents) {
fireEvent(new FragmentChangedEvent(this, newFragment));
}
- root.markAsDirty();
+ uI.markAsDirty();
}
}
}
public WebBrowser getWebBrowser() {
- return ((WebApplicationContext) root.getApplication().getContext())
+ return ((WebApplicationContext) uI.getApplication().getContext())
.getBrowser();
}
}
/**
- * 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
}
/**
- * 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
}
/**
- * 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
}
/**
- * 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
if (javaScript == null) {
// Create and attach on first use
javaScript = new JavaScript();
- javaScript.extend(root);
+ javaScript.extend(uI);
}
return javaScript;
}
/**
- * 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();
}
/**
public void open(Resource resource, String windowName) {
openList.add(new OpenResource(resource, windowName, -1, -1,
BORDER_DEFAULT));
- root.markAsDirty();
+ uI.markAsDirty();
}
/**
int height, BorderStyle border) {
openList.add(new OpenResource(resource, windowName, width, height,
border));
- root.markAsDirty();
+ uI.markAsDirty();
}
/**
notifications = new LinkedList<Notification>();
}
notifications.add(notification);
- root.markAsDirty();
+ uI.markAsDirty();
}
/**
}
/**
- * Gets the Page to which the current root belongs. This is automatically
+ * Gets the Page to which the current uI belongs. This is automatically
* defined when processing requests to the server. In other cases, (e.g.
- * from background threads), the current root is not automatically defined.
+ * from background threads), the current uI is not automatically defined.
*
- * @see Root#getCurrent()
+ * @see UI#getCurrent()
*
* @return the current page instance if available, otherwise
* <code>null</code>
*/
public static Page getCurrent() {
- Root currentRoot = Root.getCurrent();
+ UI currentRoot = UI.getCurrent();
if (currentRoot == null) {
return null;
}
* the new page title to set
*/
public void setTitle(String title) {
- root.getRpcProxy(PageClientRpc.class).setTitle(title);
+ uI.getRpcProxy(PageClientRpc.class).setTitle(title);
}
}
\r
import com.vaadin.Application;\r
import com.vaadin.RootRequiresMoreInformationException;\r
-import com.vaadin.ui.Root;\r
+import com.vaadin.ui.UI;\r
\r
public interface RootProvider {\r
- public Class<? extends Root> getRootClass(Application application,\r
+ public Class<? extends UI> getRootClass(Application application,\r
WrappedRequest request) throws RootRequiresMoreInformationException;\r
\r
- public Root instantiateRoot(Application application,\r
- Class<? extends Root> type, WrappedRequest request);\r
+ public UI instantiateRoot(Application application,\r
+ Class<? extends UI> type, WrappedRequest request);\r
}\r
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.
* 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 <code>null</code> if details are not
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
/* 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
// root = application.getRoot();
break;
default:
- root = application
+ uI = application
.getRootForRequest(wrappedRequest);
}
// if window not found, not a problem - use null
// 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);
} else if (requestType == RequestType.UIDL) {
// Handles AJAX UIDL requests
applicationManager.handleUidlRequest(wrappedRequest,
- wrappedResponse, portletWrapper, root);
+ wrappedResponse, portletWrapper, uI);
return;
} else {
/*
}
} finally {
- Root.setCurrent(null);
+ UI.setCurrent(null);
Application.setCurrent(null);
PortletSession session = request
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
/* 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
.onRequestEnd(request, response);
}
} finally {
- Root.setCurrent(null);
+ UI.setCurrent(null);
Application.setCurrent(null);
HttpSession session = request.getSession(false);
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;
/**
* 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()}.
*
* @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
* @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);
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);
}
// 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");
}
// 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;
}
paintAfterVariableChanges(request, response, callback, repaintAll,
- outWriter, root, analyzeLayouts);
- postPaint(root);
+ outWriter, uI, analyzeLayouts);
+ postPaint(uI);
}
outWriter.close();
* Method called after the paint phase while still being synchronized on the
* application
*
- * @param root
+ * @param uI
*
*/
- protected void postPaint(Root root) {
+ protected void postPaint(UI uI) {
// Remove connectors that have been detached from the application during
// handling of the request
- root.getConnectorTracker().cleanConnectorMap();
+ uI.getConnectorTracker().cleanConnectorMap();
if (pidToNameToStreamVariable != null) {
Iterator<String> iterator = pidToNameToStreamVariable.keySet()
.iterator();
while (iterator.hasNext()) {
String connectorId = iterator.next();
- if (root.getConnectorTracker().getConnector(connectorId) == null) {
+ if (uI.getConnectorTracker().getConnector(connectorId) == null) {
// Owner is no longer attached to the application
Map<String, StreamVariable> removed = pidToNameToStreamVariable
.get(connectorId);
*/
private void paintAfterVariableChanges(WrappedRequest request,
WrappedResponse response, Callback callback, boolean repaintAll,
- final PrintWriter outWriter, Root root, boolean analyzeLayouts)
+ final PrintWriter outWriter, UI uI, boolean analyzeLayouts)
throws PaintException, IOException, JSONException {
// Removes application if it has stopped during variable changes
outWriter.print(getSecurityKeyUIDL(request));
}
- writeUidlResponse(request, repaintAll, outWriter, root, analyzeLayouts);
+ writeUidlResponse(request, repaintAll, outWriter, uI, analyzeLayouts);
closeJsonMessage(outWriter);
@SuppressWarnings("unchecked")
public void writeUidlResponse(WrappedRequest request, boolean repaintAll,
- final PrintWriter outWriter, Root root, boolean analyzeLayouts)
+ final PrintWriter outWriter, UI uI, boolean analyzeLayouts)
throws PaintException, JSONException {
ArrayList<ClientConnector> dirtyVisibleConnectors = new ArrayList<ClientConnector>();
- Application application = root.getApplication();
+ Application application = uI.getApplication();
// Paints components
- ConnectorTracker rootConnectorTracker = root.getConnectorTracker();
+ ConnectorTracker rootConnectorTracker = uI.getConnectorTracker();
getLogger().log(Level.FINE, "* Creating response to client");
if (repaintAll) {
- getClientCache(root).clear();
+ getClientCache(uI).clear();
rootConnectorTracker.markAllConnectorsDirty();
rootConnectorTracker.markAllClientSidesUninitialized();
if (analyzeLayouts) {
invalidComponentRelativeSizes = ComponentSizeValidator
- .validateComponentRelativeSizes(root.getContent(), null,
+ .validateComponentRelativeSizes(uI.getContent(), null,
null);
// Also check any existing subwindows
- if (root.getWindows() != null) {
- for (Window subWindow : root.getWindows()) {
+ if (uI.getWindows() != null) {
+ for (Window subWindow : uI.getWindows()) {
invalidComponentRelativeSizes = ComponentSizeValidator
.validateComponentRelativeSizes(
subWindow.getContent(),
// }
paramJson.put(JsonCodec.encode(
invocation.getParameters()[i], referenceParameter,
- parameterType, root.getConnectorTracker()));
+ parameterType, uI.getConnectorTracker()));
}
invocationJson.put(paramJson);
rpcCalls.put(invocationJson);
final String resource = (String) i.next();
InputStream is = null;
try {
- is = getThemeResourceAsStream(root, getTheme(root), resource);
+ is = getThemeResourceAsStream(uI, getTheme(uI), resource);
} catch (final Exception e) {
// FIXME: Handle exception
getLogger().log(Level.FINER,
Collection<Class<? extends ClientConnector>> usedClientConnectors = paintTarget
.getUsedClientConnectors();
boolean typeMappingsOpen = false;
- ClientCache clientCache = getClientCache(root);
+ ClientCache clientCache = getClientCache(uI);
List<Class<? extends ClientConnector>> newConnectorTypes = new ArrayList<Class<? extends ClientConnector>>();
public static JSONObject encodeState(ClientConnector connector,
SharedState state) throws JSONException {
- Root root = connector.getRoot();
- ConnectorTracker connectorTracker = root.getConnectorTracker();
+ UI uI = connector.getRoot();
+ ConnectorTracker connectorTracker = uI.getConnectorTracker();
Class<? extends SharedState> stateType = connector.getStateType();
Object diffState = connectorTracker.getDiffState(connector);
if (diffState == null) {
try {
SharedState referenceState = stateType.newInstance();
diffState = JsonCodec.encode(referenceState, null,
- stateType, root.getConnectorTracker());
+ stateType, uI.getConnectorTracker());
} catch (Exception e) {
getLogger().log(
Level.WARNING,
}
}
JSONObject stateJson = (JSONObject) JsonCodec.encode(state, diffState,
- stateType, root.getConnectorTracker());
+ stateType, uI.getConnectorTracker());
return stateJson;
}
}
- private ClientCache getClientCache(Root root) {
- Integer rootId = Integer.valueOf(root.getRootId());
+ private ClientCache getClientCache(UI uI) {
+ Integer rootId = Integer.valueOf(uI.getRootId());
ClientCache cache = rootToClientCache.get(rootId);
if (cache == null) {
cache = new ClientCache();
HasComponents parent = child.getParent();
if (parent == null) {
- if (child instanceof Root) {
+ if (child instanceof UI) {
return child.isVisible();
} else {
return false;
return pendingInvocations;
}
- protected abstract InputStream getThemeResourceAsStream(Root root,
+ protected abstract InputStream getThemeResourceAsStream(UI uI,
String themeName, String resource);
private int getTimeoutInterval() {
return maxInactiveInterval;
}
- private String getTheme(Root root) {
- String themeName = root.getApplication().getThemeForRoot(root);
+ private String getTheme(UI uI) {
+ String themeName = uI.getApplication().getThemeForRoot(uI);
String requestThemeName = getRequestTheme();
if (requestThemeName != null) {
*/
private boolean handleVariables(WrappedRequest request,
WrappedResponse response, Callback callback,
- Application application2, Root root) throws IOException,
+ Application application2, UI uI) throws IOException,
InvalidUIDLSecurityKeyException, JSONException {
boolean success = true;
for (int bi = 1; bi < bursts.length; bi++) {
// unescape any encoded separator characters in the burst
final String burst = unescapeBurst(bursts[bi]);
- success &= handleBurst(request, root, burst);
+ success &= handleBurst(request, uI, burst);
// In case that there were multiple bursts, we know that this is
// a special synchronous case for closing window. Thus we are
new CharArrayWriter());
paintAfterVariableChanges(request, response, callback,
- true, outWriter, root, false);
+ true, outWriter, uI, false);
}
* directly.
*
* @param source
- * @param root
+ * @param uI
* the root receiving the burst
* @param burst
* the content of the burst as a String to be parsed
* @return true if the processing of the burst was successful and there were
* no messages to non-existent components
*/
- public boolean handleBurst(WrappedRequest source, Root root,
+ public boolean handleBurst(WrappedRequest source, UI uI,
final String burst) {
boolean success = true;
try {
Set<Connector> enabledConnectors = new HashSet<Connector>();
List<MethodInvocation> invocations = parseInvocations(
- root.getConnectorTracker(), burst);
+ uI.getConnectorTracker(), burst);
for (MethodInvocation invocation : invocations) {
- final ClientConnector connector = getConnector(root,
+ final ClientConnector connector = getConnector(uI,
invocation.getConnectorId());
if (connector != null && connector.isConnectorEnabled()) {
for (int i = 0; i < invocations.size(); i++) {
MethodInvocation invocation = invocations.get(i);
- final ClientConnector connector = getConnector(root,
+ final ClientConnector connector = getConnector(uI,
invocation.getConnectorId());
if (connector == null) {
if (connector instanceof Component) {
errorComponent = (Component) connector;
}
- handleChangeVariablesError(root.getApplication(),
+ handleChangeVariablesError(uI.getApplication(),
errorComponent, realException, null);
}
} else {
errorComponent = (Component) dropHandlerOwner;
}
}
- handleChangeVariablesError(root.getApplication(),
+ handleChangeVariablesError(uI.getApplication(),
errorComponent, e, changes);
}
}
owner.changeVariables(source, m);
}
- protected ClientConnector getConnector(Root root, String connectorId) {
- ClientConnector c = root.getConnectorTracker()
+ protected ClientConnector getConnector(UI uI, String connectorId) {
+ ClientConnector c = uI.getConnectorTracker()
.getConnector(connectorId);
if (c == null
&& connectorId.equals(getDragAndDropService().getConnectorId())) {
// if we do not yet have a currentRoot, it should be initialized
// shortly, and we should send the initial UIDL
- boolean sendUIDL = Root.getCurrent() == null;
+ boolean sendUIDL = UI.getCurrent() == null;
try {
CombinedRequest combinedRequest = new CombinedRequest(request);
- Root root = application.getRootForRequest(combinedRequest);
+ UI uI = application.getRootForRequest(combinedRequest);
response.setContentType("application/json; charset=UTF-8");
// Use the same logic as for determined roots
BootstrapHandler bootstrapHandler = getBootstrapHandler();
BootstrapContext context = bootstrapHandler.createContext(
- combinedRequest, response, application, root.getRootId());
+ combinedRequest, response, application, uI.getRootId());
String widgetset = context.getWidgetsetName();
String theme = context.getThemeName();
JSONObject params = new JSONObject();
params.put("widgetset", widgetset);
params.put("themeUri", themeUri);
- // Root id might have changed based on e.g. window.name
- params.put(ApplicationConstants.ROOT_ID_PARAMETER, root.getRootId());
+ // UI id might have changed based on e.g. window.name
+ params.put(ApplicationConstants.ROOT_ID_PARAMETER, uI.getRootId());
if (sendUIDL) {
- String initialUIDL = getInitialUIDL(combinedRequest, root);
+ String initialUIDL = getInitialUIDL(combinedRequest, uI);
params.put("uidl", initialUIDL);
}
*
* @param request
* the request that caused the initialization
- * @param root
+ * @param uI
* the root for which the UIDL should be generated
* @return a string with the initial UIDL message
* @throws PaintException
* @throws JSONException
* if an exception occurs while encoding output
*/
- protected String getInitialUIDL(WrappedRequest request, Root root)
+ protected String getInitialUIDL(WrappedRequest request, UI uI)
throws PaintException, JSONException {
// TODO maybe unify writeUidlResponse()?
StringWriter sWriter = new StringWriter();
PrintWriter pWriter = new PrintWriter(sWriter);
pWriter.print("{");
- if (isXSRFEnabled(root.getApplication())) {
+ if (isXSRFEnabled(uI.getApplication())) {
pWriter.print(getSecurityKeyUIDL(request));
}
- writeUidlResponse(request, true, pWriter, root, false);
+ writeUidlResponse(request, true, pWriter, uI, false);
pWriter.print("}");
String initialUIDL = sWriter.toString();
getLogger().log(Level.FINE, "Initial UIDL:" + initialUIDL);
String rootId = parts[0];
String connectorId = parts[1];
String variableName = parts[2];
- Root root = application.getRootById(Integer.parseInt(rootId));
- Root.setCurrent(root);
+ UI uI = application.getRootById(Integer.parseInt(rootId));
+ UI.setCurrent(uI);
StreamVariable streamVariable = getStreamVariable(connectorId,
variableName);
String secKey = streamVariableToSeckey.get(streamVariable);
if (secKey.equals(parts[3])) {
- ClientConnector source = getConnector(root, connectorId);
+ ClientConnector source = getConnector(uI, connectorId);
String contentType = request.getContentType();
if (contentType.contains("boundary")) {
// Multipart requests contain boundary string
* the application for which the bootstrap page should be
* generated
* @param rootId
- * the generated id of the Root that will be displayed on the
+ * 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
import com.vaadin.terminal.RequestHandler;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.terminal.WrappedResponse;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
public abstract class BootstrapHandler implements RequestHandler {
return bootstrapResponse.getRootId();
}
- public Root getRoot() {
+ public UI getRoot() {
return bootstrapResponse.getRoot();
}
public String getWidgetsetName() {
if (widgetsetName == null) {
- Root root = getRoot();
- if (root != null) {
+ UI uI = getRoot();
+ if (uI != null) {
widgetsetName = getWidgetsetForRoot(this);
}
}
public String getThemeName() {
if (themeName == null) {
- Root root = getRoot();
- if (root != null) {
+ UI uI = getRoot();
+ if (uI != null) {
themeName = findAndEscapeThemeName(this);
}
}
// TODO Should all urls be handled here?
Integer rootId = null;
try {
- Root root = application.getRootForRequest(request);
- if (root == null) {
- writeError(response, new Throwable("No Root found"));
+ UI uI = application.getRootForRequest(request);
+ if (uI == null) {
+ writeError(response, new Throwable("No UI found"));
return true;
}
- rootId = Integer.valueOf(root.getRootId());
+ rootId = Integer.valueOf(uI.getRootId());
} catch (RootRequiresMoreInformationException e) {
// Just keep going without rootId
}
head.appendElement("meta").attr("http-equiv", "X-UA-Compatible")
.attr("content", "chrome=1");
- Root root = context.getRoot();
- String title = ((root == null || root.getCaption() == null) ? "" : root
+ UI uI = context.getRoot();
+ String title = ((uI == null || uI.getCaption() == null) ? "" : uI
.getCaption());
head.appendElement("title").appendText(title);
protected abstract String getApplicationId(BootstrapContext context);
public String getWidgetsetForRoot(BootstrapContext context) {
- Root root = context.getRoot();
+ UI uI = context.getRoot();
WrappedRequest request = context.getRequest();
- String widgetset = root.getApplication().getWidgetsetForRoot(root);
+ String widgetset = uI.getApplication().getWidgetsetForRoot(uI);
if (widgetset == null) {
widgetset = request.getDeploymentConfiguration()
.getConfiguredWidgetset(request);
*
* @param request
* the originating request
- * @param root
+ * @param uI
* the root for which the UIDL should be generated
* @return a string with the initial UIDL message
* @throws PaintException
* @throws JSONException
* if an exception occurs while formatting the output
*/
- protected abstract String getInitialUIDL(WrappedRequest request, Root root)
+ protected abstract String getInitialUIDL(WrappedRequest request, UI uI)
throws PaintException, JSONException;
}
* the application for which the bootstrap page should be
* generated
* @param rootId
- * the generated id of the Root that will be displayed on the
+ * the generated id of the UI that will be displayed on the
* page
* @param document
* the DOM document making up the HTML page
import com.vaadin.Application;
import com.vaadin.RootRequiresMoreInformationException;
import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
/**
* Base class providing common functionality used in different bootstrap
* the application for which the bootstrap page should be
* generated
* @param rootId
- * the generated id of the Root that will be displayed on the
+ * the generated id of the UI that will be displayed on the
* page
*/
public BootstrapResponse(BootstrapHandler handler, WrappedRequest request,
/**
* Gets the root id that has been generated for this response. Please note
* that if {@link Application#isRootPreserved()} is enabled, a previously
- * created Root with a different id might eventually end up being used.
+ * created UI with a different id might eventually end up being used.
*
* @return the root id
*/
}
/**
- * Gets the Root for which this page is being rendered, if available. Some
- * features of the framework will postpone the Root selection until after
+ * Gets the UI for which this page is being rendered, if available. Some
+ * features of the framework will postpone the UI selection until after
* the bootstrap page has been rendered and required information from the
* browser has been sent back. This method will return <code>null</code> if
- * no Root instance is yet available.
+ * no UI instance is yet available.
*
* @see Application#isRootPreserved()
* @see Application#getRoot(WrappedRequest)
* @see RootRequiresMoreInformationException
*
- * @return The Root that will be displayed in the page being generated, or
+ * @return The UI that will be displayed in the page being generated, or
* <code>null</code> if all required information is not yet
* available.
*/
- public Root getRoot() {
- return Root.getCurrent();
+ public UI getRoot() {
+ return UI.getCurrent();
}
}
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
/**
* 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
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;
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
}
@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();
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 {
}
@Override
- public Root getRoot() {
+ public UI getRoot() {
return null;
}
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.
}
}
- public void firePortletRenderRequest(Application app, Root root,
+ public void firePortletRenderRequest(Application app, UI uI,
RenderRequest request, RenderResponse response) {
Set<PortletListener> listeners = portletListeners.get(app);
if (listeners != null) {
for (PortletListener l : listeners) {
l.handleRenderRequest(request, new RestrictedRenderResponse(
- response), root);
+ response), uI);
}
}
}
- public void firePortletActionRequest(Application app, Root root,
+ public void firePortletActionRequest(Application app, UI uI,
ActionRequest request, ActionResponse response) {
String key = request.getParameter(ActionRequest.ACTION_NAME);
if (eventActionDestinationMap.containsKey(key)) {
Set<PortletListener> listeners = portletListeners.get(app);
if (listeners != null) {
for (PortletListener l : listeners) {
- l.handleActionRequest(request, response, root);
+ l.handleActionRequest(request, response, uI);
}
}
}
}
- public void firePortletEventRequest(Application app, Root root,
+ public void firePortletEventRequest(Application app, UI uI,
EventRequest request, EventResponse response) {
Set<PortletListener> listeners = portletListeners.get(app);
if (listeners != null) {
for (PortletListener l : listeners) {
- l.handleEventRequest(request, response, root);
+ l.handleEventRequest(request, response, uI);
}
}
}
- public void firePortletResourceRequest(Application app, Root root,
+ public void firePortletResourceRequest(Application app, UI uI,
ResourceRequest request, ResourceResponse response) {
Set<PortletListener> listeners = portletListeners.get(app);
if (listeners != null) {
for (PortletListener l : listeners) {
- l.handleResourceRequest(request, response, root);
+ l.handleResourceRequest(request, response, uI);
}
}
}
public interface PortletListener extends Serializable {
public void handleRenderRequest(RenderRequest request,
- RenderResponse response, Root root);
+ RenderResponse response, UI uI);
public void handleActionRequest(ActionRequest request,
- ActionResponse response, Root root);
+ ActionResponse response, UI uI);
public void handleEventRequest(EventRequest request,
- EventResponse response, Root root);
+ EventResponse response, UI uI);
public void handleResourceRequest(ResourceRequest request,
- ResourceResponse response, Root root);
+ ResourceResponse response, UI uI);
}
/**
* Event names for events sent and received by a portlet need to be declared
* in portlet.xml .
*
- * @param root
+ * @param uI
* a window in which a temporary action URL can be opened if
* necessary
* @param name
* event value object that is Serializable and, if appropriate,
* has a valid JAXB annotation
*/
- public void sendPortletEvent(Root root, QName name, Serializable value)
+ public void sendPortletEvent(UI uI, QName name, Serializable value)
throws IllegalStateException {
if (response instanceof MimeResponse) {
String actionKey = "" + System.currentTimeMillis();
if (actionUrl != null) {
eventActionDestinationMap.put(actionKey, name);
eventActionValueMap.put(actionKey, value);
- root.getPage().open(new ExternalResource(actionUrl.toString()));
+ uI.getPage().open(new ExternalResource(actionUrl.toString()));
} else {
// this should never happen as we already know the response is a
// MimeResponse
* Shared parameters set or read by a portlet need to be declared in
* portlet.xml .
*
- * @param root
+ * @param uI
* a window in which a temporary action URL can be opened if
* necessary
* @param name
* @param value
* parameter value
*/
- public void setSharedRenderParameter(Root root, String name, String value)
+ public void setSharedRenderParameter(UI uI, String name, String value)
throws IllegalStateException {
if (response instanceof MimeResponse) {
String actionKey = "" + System.currentTimeMillis();
if (actionUrl != null) {
sharedParameterActionNameMap.put(actionKey, name);
sharedParameterActionValueMap.put(actionKey, value);
- root.getPage().open(new ExternalResource(actionUrl.toString()));
+ uI.getPage().open(new ExternalResource(actionUrl.toString()));
} else {
// this should never happen as we already know the response is a
// MimeResponse
*
* Portlet modes used by a portlet need to be declared in portlet.xml .
*
- * @param root
+ * @param uI
* a window in which the render URL can be opened if necessary
* @param portletMode
* the portlet mode to switch to
* if the portlet mode is not allowed for some reason
* (configuration, permissions etc.)
*/
- public void setPortletMode(Root root, PortletMode portletMode)
+ public void setPortletMode(UI uI, PortletMode portletMode)
throws IllegalStateException, PortletModeException {
if (response instanceof MimeResponse) {
PortletURL url = ((MimeResponse) response).createRenderURL();
url.setPortletMode(portletMode);
- throw new RuntimeException("Root.open has not yet been implemented");
+ throw new RuntimeException("UI.open has not yet been implemented");
// root.open(new ExternalResource(url.toString()));
} else if (response instanceof StateAwareResponse) {
((StateAwareResponse) response).setPortletMode(portletMode);
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.terminal.WrappedResponse;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
/**
* TODO document me!
}
@Override
- protected String getInitialUIDL(WrappedRequest request, Root root)
+ protected String getInitialUIDL(WrappedRequest request, UI uI)
throws PaintException, JSONException {
return PortletCommunicationManager.this.getInitialUIDL(request,
- root);
+ uI);
}
@Override
}
@Override
- protected InputStream getThemeResourceAsStream(Root root, String themeName,
+ protected InputStream getThemeResourceAsStream(UI uI, String themeName,
String resource) {
- PortletApplicationContext2 context = (PortletApplicationContext2) root
+ PortletApplicationContext2 context = (PortletApplicationContext2) uI
.getApplication().getContext();
PortletContext portletContext = context.getPortletSession()
.getPortletContext();
import com.vaadin.shared.ApplicationConstants;
import com.vaadin.terminal.DeploymentConfiguration;
import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
/*
* Copyright 2011 Vaadin Ltd.
// Check that the root layout class can be found
try {
Class<?> rootClass = classLoader.loadClass(className);
- if (!Root.class.isAssignableFrom(rootClass)) {
+ if (!UI.class.isAssignableFrom(rootClass)) {
throw new ApplicationClassException(className
- + " does not implement Root");
+ + " does not implement UI");
}
// Try finding a default constructor, else throw exception
rootClass.getConstructor();
* here, we use the default documentation from implemented interface.
*/
@Override
- public Root getRoot() {
+ public UI getRoot() {
// Just make method from implemented Component interface public
return super.getRoot();
}
public void detach() {
super.detach();
if (actionManager != null) {
- // Remove any existing viewer. Root cast is just to make the
+ // Remove any existing viewer. UI cast is just to make the
// compiler happy
- actionManager.setViewer((Root) null);
+ actionManager.setViewer((UI) null);
}
}
public void setIcon(Resource icon);
/**
- * Gets the Root the component is attached to.
+ * Gets the UI the component is attached to.
*
* <p>
- * If the component is not attached to a Root through a component
+ * If the component is not attached to a UI through a component
* containment hierarchy, <code>null</code> is returned.
* </p>
*
- * @return the Root of the component or <code>null</code> if it is not
- * attached to a Root
+ * @return the UI of the component or <code>null</code> if it is not
+ * attached to a UI
*/
@Override
- public Root getRoot();
+ public UI getRoot();
/**
* Gets the application object to which the component is attached.
* {@link #setParent(Component)}.
* </p>
* <p>
- * This method must call {@link Root#componentAttached(Component)} to let
- * the Root know that a new Component has been attached.
+ * This method must call {@link UI#componentAttached(Component)} to let
+ * the UI know that a new Component has been attached.
* </p>
*
*
/**
* A class which takes care of book keeping of {@link ClientConnector}s for a
- * Root.
+ * UI.
* <p>
* Provides {@link #getConnector(String)} which can be used to lookup a
* connector from its id. This is for framework use only and should not be
private Set<ClientConnector> dirtyConnectors = new HashSet<ClientConnector>();
private Set<ClientConnector> uninitializedConnectors = new HashSet<ClientConnector>();
- private Root root;
+ private UI uI;
private Map<ClientConnector, Object> diffStates = new HashMap<ClientConnector, Object>();
/**
}
/**
- * Creates a new ConnectorTracker for the given root. A tracker is always
- * attached to a root and the root cannot be changed during the lifetime of
+ * Creates a new ConnectorTracker for the given uI. A tracker is always
+ * attached to a uI and the uI cannot be changed during the lifetime of
* a {@link ConnectorTracker}.
*
- * @param root
- * The root to attach to. Cannot be null.
+ * @param uI
+ * The uI to attach to. Cannot be null.
*/
- public ConnectorTracker(Root root) {
- this.root = root;
+ public ConnectorTracker(UI uI) {
+ this.uI = uI;
}
/**
while (iterator.hasNext()) {
String connectorId = iterator.next();
ClientConnector connector = connectorIdToConnector.get(connectorId);
- if (getRootForConnector(connector) != root) {
- // If connector is no longer part of this root,
+ if (getRootForConnector(connector) != uI) {
+ // If connector is no longer part of this uI,
// remove it from the map. If it is re-attached to the
// application at some point it will be re-added through
// registerConnector(connector)
}
/**
- * Finds the root that the connector is attached to.
+ * Finds the uI that the connector is attached to.
*
* @param connector
* The connector to lookup
- * @return The root the connector is attached to or null if it is not
- * attached to any root.
+ * @return The uI the connector is attached to or null if it is not
+ * attached to any uI.
*/
- private Root getRootForConnector(ClientConnector connector) {
+ private UI getRootForConnector(ClientConnector connector) {
if (connector == null) {
return null;
}
}
/**
- * Mark all connectors in this root as dirty.
+ * Mark all connectors in this uI as dirty.
*/
public void markAllConnectorsDirty() {
- markConnectorsDirtyRecursively(root);
+ markConnectorsDirtyRecursively(uI);
getLogger().fine("All connectors are now dirty");
}
/**
- * Mark all connectors in this root as clean.
+ * Mark all connectors in this uI as clean.
*/
public void markAllConnectorsClean() {
dirtyConnectors.clear();
* client in the following request.
* </p>
*
- * @return A collection of all dirty connectors for this root. This list may
+ * @return A collection of all dirty connectors for this uI. This list may
* contain invisible connectors.
*/
public Collection<ClientConnector> getDirtyConnectors() {
throws IOException {
String requestPathInfo = request.getRequestPathInfo();
if ("/loginHandler".equals(requestPathInfo)) {
- // Ensure Root.getCurrent() works in listeners
- Root.setCurrent(getRoot());
+ // Ensure UI.getCurrent() works in listeners
+ UI.setCurrent(getRoot());
response.setCacheTime(-1);
response.setContentType("text/html; charset=utf-8");
+++ /dev/null
-/*
- * 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.
- * <p>
- * 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.
- * </p>
- * <p>
- * When a new application instance is needed, typically because the user opens
- * the application in a browser window,
- * {@link Application#gerRoot(WrappedRequest)} is invoked to get a root. That
- * method does by default create a root according to the
- * {@value Application#ROOT_PARAMETER} parameter from web.xml.
- * </p>
- * <p>
- * 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)}.
- * </p>
- * <p>
- * If a {@link EagerInit} annotation is present on a class extending
- * <code>Root</code>, the framework will use a faster initialization method
- * which will not ensure that {@link BrowserDetails} are present in the
- * {@link WrappedRequest} passed to the init method.
- * </p>
- *
- * @see #init(WrappedRequest)
- * @see Application#getRoot(WrappedRequest)
- *
- * @since 7.0
- */
-public abstract class Root extends AbstractComponentContainer implements
- Action.Container, Action.Notifier, Vaadin6Component {
-
- /**
- * Helper class to emulate the main window from Vaadin 6 using roots. This
- * class should be used in the same way as Window used as a browser level
- * window in Vaadin 6 with {@link com.vaadin.Application.LegacyApplication}
- */
- @Deprecated
- @EagerInit
- public static class LegacyWindow extends Root {
- private String name;
-
- /**
- * Create a new legacy window
- */
- public LegacyWindow() {
- super();
- }
-
- /**
- * Creates a new legacy window with the given caption
- *
- * @param caption
- * the caption of the window
- */
- public LegacyWindow(String caption) {
- super(caption);
- }
-
- /**
- * Creates a legacy window with the given caption and content layout
- *
- * @param caption
- * @param content
- */
- public LegacyWindow(String caption, ComponentContainer content) {
- super(caption, content);
- }
-
- @Override
- protected void init(WrappedRequest request) {
- // Just empty
- }
-
- /**
- * Gets the unique name of the window. The name of the window is used to
- * uniquely identify it.
- * <p>
- * 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.
- * </p>
- * <p>
- * Note! Portlets do not support direct window access through URLs.
- * </p>
- *
- * @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.
- * <p>
- * 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.
- * </p>
- * <p>
- * This method can only be called before the window is added to an
- * application.
- * <p>
- * Note! Portlets do not support direct window access through URLs.
- * </p>
- *
- * @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.
- * <p>
- * Note! This method can not be used for portlets.
- * </p>
- *
- * @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.
- * <p>
- * 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 <code>null</code> window name is also a special case.
- * </p>
- * <p>
- * "", 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.
- * </p>
- * <p>
- * "_blank" as {@code windowName} causes the resource to always be
- * opened in a new window or tab (depends on the browser and browser
- * settings).
- * </p>
- * <p>
- * "_top" and "_parent" as {@code windowName} works as specified by the
- * HTML standard.
- * </p>
- * <p>
- * 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.
- * </p>
- *
- * @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.
- *
- * <p>
- * 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.
- * </p>
- *
- * <p>
- * 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.
- * </p>
- *
- * @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 LinkedHashSet<Window> windows = new LinkedHashSet<Window>();
-
- /**
- * The component that should be scrolled into view after the next repaint.
- * Null if nothing should be scrolled into view.
- */
- private Component scrollIntoView;
-
- /**
- * The id of this root, used to find the server side instance of the root
- * form which a request originates. A negative value indicates that the root
- * id has not yet been assigned by the Application.
- *
- * @see Application#nextRootId
- */
- private int rootId = -1;
-
- /**
- * Keeps track of the Actions added to this component, and manages the
- * painting and handling as well.
- */
- protected ActionManager actionManager;
-
- /**
- * Thread local for keeping track of the current root.
- */
- private static final ThreadLocal<Root> currentRoot = new ThreadLocal<Root>();
-
- /** Identifies the click event */
- private ConnectorTracker connectorTracker = new ConnectorTracker(this);
-
- private Page page = new Page(this);
-
- private RootServerRpc rpc = new RootServerRpc() {
- @Override
- public void click(MouseEventDetails mouseDetails) {
- fireEvent(new ClickEvent(Root.this, mouseDetails));
- }
-
- @Override
- public void resize(int viewWidth, int viewHeight, int windowWidth,
- int windowHeight) {
- // TODO We're not doing anything with the view dimensions
- getPage().setBrowserWindowSize(windowWidth, windowHeight);
- }
- };
-
- /**
- * Creates a new empty root without a caption. This root will have a
- * {@link VerticalLayout} with margins enabled as its content.
- */
- public Root() {
- this((ComponentContainer) null);
- }
-
- /**
- * Creates a new root with the given component container as its content.
- *
- * @param content
- * the content container to use as this roots content.
- *
- * @see #setContent(ComponentContainer)
- */
- public Root(ComponentContainer content) {
- registerRpc(rpc);
- setSizeFull();
- setContent(content);
- }
-
- /**
- * Creates a new empty root with the given caption. This root will have a
- * {@link VerticalLayout} with margins enabled as its content.
- *
- * @param caption
- * the caption of the root, used as the page title if there's
- * nothing but the application on the web page
- *
- * @see #setCaption(String)
- */
- public Root(String caption) {
- this((ComponentContainer) null);
- setCaption(caption);
- }
-
- /**
- * Creates a new root with the given caption and content.
- *
- * @param caption
- * the caption of the root, used as the page title if there's
- * nothing but the application on the web page
- * @param content
- * the content container to use as this roots content.
- *
- * @see #setContent(ComponentContainer)
- * @see #setCaption(String)
- */
- public Root(String caption, ComponentContainer content) {
- this(content);
- setCaption(caption);
- }
-
- @Override
- protected RootState getState() {
- return (RootState) super.getState();
- }
-
- @Override
- public Class<? extends RootState> getStateType() {
- // This is a workaround for a problem with creating the correct state
- // object during build
- return RootState.class;
- }
-
- /**
- * Overridden to return a value instead of referring to the parent.
- *
- * @return this root
- *
- * @see com.vaadin.ui.AbstractComponent#getRoot()
- */
- @Override
- public Root getRoot() {
- return this;
- }
-
- @Override
- public void replaceComponent(Component oldComponent, Component newComponent) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Application getApplication() {
- return application;
- }
-
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
- page.paintContent(target);
-
- if (scrollIntoView != null) {
- target.addAttribute("scrollTo", scrollIntoView);
- scrollIntoView = null;
- }
-
- if (pendingFocus != null) {
- // ensure focused component is still attached to this main window
- if (pendingFocus.getRoot() == this
- || (pendingFocus.getRoot() != null && pendingFocus
- .getRoot().getParent() == this)) {
- target.addAttribute("focused", pendingFocus);
- }
- pendingFocus = null;
- }
-
- if (actionManager != null) {
- actionManager.paintActions(null, target);
- }
-
- if (isResizeLazy()) {
- target.addAttribute(RootConstants.RESIZE_LAZY, true);
- }
- }
-
- /**
- * Fire a click event to all click listeners.
- *
- * @param object
- * The raw "value" of the variable change from the client side.
- */
- private void fireClick(Map<String, Object> parameters) {
- MouseEventDetails mouseDetails = MouseEventDetails
- .deSerialize((String) parameters.get("mouseDetails"));
- fireEvent(new ClickEvent(this, mouseDetails));
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public void changeVariables(Object source, Map<String, Object> variables) {
- if (variables.containsKey(EventId.CLICK_EVENT_IDENTIFIER)) {
- fireClick((Map<String, Object>) variables
- .get(EventId.CLICK_EVENT_IDENTIFIER));
- }
-
- // Actions
- if (actionManager != null) {
- actionManager.handleActions(variables, this);
- }
-
- if (variables.containsKey(RootConstants.FRAGMENT_VARIABLE)) {
- String fragment = (String) variables
- .get(RootConstants.FRAGMENT_VARIABLE);
- getPage().setFragment(fragment, true);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.ui.ComponentContainer#getComponentIterator()
- */
- @Override
- public Iterator<Component> getComponentIterator() {
- // TODO could directly create some kind of combined iterator instead of
- // creating a new ArrayList
- ArrayList<Component> components = new ArrayList<Component>();
-
- if (getContent() != null) {
- components.add(getContent());
- }
-
- components.addAll(windows);
-
- return components.iterator();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.ui.ComponentContainer#getComponentCount()
- */
- @Override
- public int getComponentCount() {
- return windows.size() + (getContent() == null ? 0 : 1);
- }
-
- /**
- * Sets the application to which this root is assigned. It is not legal to
- * change the application once it has been set nor to set a
- * <code>null</code> application.
- * <p>
- * This method is mainly intended for internal use by the framework.
- * </p>
- *
- * @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.
- * <p>
- * This method is mainly intended for internal use by the framework.
- * </p>
- *
- * @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 given <code>Window</code> is <code>null</code>.
- */
- 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<Window> getWindows() {
- return Collections.unmodifiableCollection(windows);
- }
-
- @Override
- public void focus() {
- super.focus();
- }
-
- /**
- * Component that should be focused after the next repaint. Null if no focus
- * change should take place.
- */
- private Focusable pendingFocus;
-
- private boolean resizeLazy = false;
-
- /**
- * This method is used by Component.Focusable objects to request focus to
- * themselves. Focus renders must be handled at window level (instead of
- * Component.Focusable) due we want the last focused component to be focused
- * in client too. Not the one that is rendered last (the case we'd get if
- * implemented in Focusable only).
- *
- * To focus component from Vaadin application, use Focusable.focus(). See
- * {@link Focusable}.
- *
- * @param focusable
- * to be focused on next paint
- */
- public void setFocusedComponent(Focusable focusable) {
- pendingFocus = focusable;
- markAsDirty();
- }
-
- /**
- * 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.
- *
- * @param component
- * the component to be scrolled into view
- * @throws IllegalArgumentException
- * if {@code component} does not belong to this root
- */
- public void scrollIntoView(Component component)
- throws IllegalArgumentException {
- if (component.getRoot() != this) {
- throw new IllegalArgumentException(
- "The component where to scroll must belong to this root.");
- }
- 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.
- *
- * @return a component container to use as content
- *
- * @see #setContent(ComponentContainer)
- * @see #createDefaultLayout()
- */
- public ComponentContainer getContent() {
- return (ComponentContainer) getState().getContent();
- }
-
- /**
- * Helper method to create the default content layout that is used if no
- * content has not been explicitly defined.
- *
- * @return a newly created layout
- */
- private static VerticalLayout createDefaultLayout() {
- VerticalLayout layout = new VerticalLayout();
- layout.setMargin(true);
- return layout;
- }
-
- /**
- * 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
- * content has been set, a {@link VerticalLayout} with margins enabled will
- * be used by default - see {@link #createDefaultLayout()}. The content can
- * also be set in a constructor.
- *
- * @return a component container to use as content
- *
- * @see #Root(ComponentContainer)
- * @see #createDefaultLayout()
- */
- public void setContent(ComponentContainer content) {
- if (content == null) {
- content = createDefaultLayout();
- }
-
- if (getState().getContent() != null) {
- super.removeComponent((Component) getState().getContent());
- }
- getState().setContent(content);
- if (content != null) {
- super.addComponent(content);
- }
- }
-
- /**
- * Adds a component to this root. The component is not added directly to the
- * root, but instead to the content container ({@link #getContent()}).
- *
- * @param component
- * the component to add to this root
- *
- * @see #getContent()
- */
- @Override
- public void addComponent(Component component) {
- getContent().addComponent(component);
- }
-
- /**
- * This implementation removes the component from the content container (
- * {@link #getContent()}) instead of from the actual root.
- */
- @Override
- public void removeComponent(Component component) {
- getContent().removeComponent(component);
- }
-
- /**
- * This implementation removes the components from the content container (
- * {@link #getContent()}) instead of from the actual root.
- */
- @Override
- public void removeAllComponents() {
- getContent().removeAllComponents();
- }
-
- /**
- * Internal initialization method, should not be overridden. This method is
- * not declared as final because that would break compatibility with e.g.
- * CDI.
- *
- * @param request
- * the initialization request
- */
- public void doInit(WrappedRequest request) {
- getPage().init(request);
-
- // Call the init overridden by the application developer
- init(request);
- }
-
- /**
- * Initializes this root. 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.
- * <p>
- * 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.
- * </p>
- *
- * @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.
- * <p>
- * 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.
- * </p>
- *
- * @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
- * <code>null</code>
- *
- * @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 <T extends Action & com.vaadin.event.Action.Listener> void addAction(
- T action) {
- getActionManager().addAction(action);
- }
-
- @Override
- public <T extends Action & com.vaadin.event.Action.Listener> void removeAction(
- T action) {
- if (actionManager != null) {
- actionManager.removeAction(action);
- }
- }
-
- @Override
- public void addActionHandler(Handler actionHandler) {
- getActionManager().addActionHandler(actionHandler);
- }
-
- @Override
- public void removeActionHandler(Handler actionHandler) {
- if (actionManager != null) {
- actionManager.removeActionHandler(actionHandler);
- }
- }
-
- /**
- * Should resize operations be lazy, i.e. should there be a delay before
- * layout sizes are recalculated. Speeds up resize operations in slow UIs
- * with the penalty of slightly decreased usability.
- * <p>
- * Default value: <code>false</code>
- *
- * @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 <code>true</code> if lazy resize is enabled, <code>false</code>
- * 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);
- }
-
-}
--- /dev/null
+/*
+ * 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.
+ * <p>
+ * 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.
+ * </p>
+ * <p>
+ * When a new application instance is needed, typically because the user opens
+ * the application in a browser window,
+ * {@link Application#gerRoot(WrappedRequest)} is invoked to get a root. That
+ * method does by default create a root according to the
+ * {@value Application#ROOT_PARAMETER} parameter from web.xml.
+ * </p>
+ * <p>
+ * 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)}.
+ * </p>
+ * <p>
+ * If a {@link EagerInit} annotation is present on a class extending
+ * <code>UI</code>, the framework will use a faster initialization method
+ * which will not ensure that {@link BrowserDetails} are present in the
+ * {@link WrappedRequest} passed to the init method.
+ * </p>
+ *
+ * @see #init(WrappedRequest)
+ * @see Application#getRoot(WrappedRequest)
+ *
+ * @since 7.0
+ */
+public abstract class UI extends AbstractComponentContainer implements
+ Action.Container, Action.Notifier, Vaadin6Component {
+
+ /**
+ * Helper class to emulate the main window from Vaadin 6 using roots. This
+ * class should be used in the same way as Window used as a browser level
+ * window in Vaadin 6 with {@link com.vaadin.Application.LegacyApplication}
+ */
+ @Deprecated
+ @EagerInit
+ public static class LegacyWindow extends UI {
+ private String name;
+
+ /**
+ * Create a new legacy window
+ */
+ public LegacyWindow() {
+ super();
+ }
+
+ /**
+ * Creates a new legacy window with the given caption
+ *
+ * @param caption
+ * the caption of the window
+ */
+ public LegacyWindow(String caption) {
+ super(caption);
+ }
+
+ /**
+ * Creates a legacy window with the given caption and content layout
+ *
+ * @param caption
+ * @param content
+ */
+ public LegacyWindow(String caption, ComponentContainer content) {
+ super(caption, content);
+ }
+
+ @Override
+ protected void init(WrappedRequest request) {
+ // Just empty
+ }
+
+ /**
+ * Gets the unique name of the window. The name of the window is used to
+ * uniquely identify it.
+ * <p>
+ * 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.
+ * </p>
+ * <p>
+ * Note! Portlets do not support direct window access through URLs.
+ * </p>
+ *
+ * @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.
+ * <p>
+ * 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.
+ * </p>
+ * <p>
+ * This method can only be called before the window is added to an
+ * application.
+ * <p>
+ * Note! Portlets do not support direct window access through URLs.
+ * </p>
+ *
+ * @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.
+ * <p>
+ * Note! This method can not be used for portlets.
+ * </p>
+ *
+ * @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.
+ * <p>
+ * 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 <code>null</code> window name is also a special case.
+ * </p>
+ * <p>
+ * "", 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.
+ * </p>
+ * <p>
+ * "_blank" as {@code windowName} causes the resource to always be
+ * opened in a new window or tab (depends on the browser and browser
+ * settings).
+ * </p>
+ * <p>
+ * "_top" and "_parent" as {@code windowName} works as specified by the
+ * HTML standard.
+ * </p>
+ * <p>
+ * 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.
+ * </p>
+ *
+ * @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.
+ *
+ * <p>
+ * 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.
+ * </p>
+ *
+ * <p>
+ * 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.
+ * </p>
+ *
+ * @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 LinkedHashSet<Window> windows = new LinkedHashSet<Window>();
+
+ /**
+ * The component that should be scrolled into view after the next repaint.
+ * Null if nothing should be scrolled into view.
+ */
+ private Component scrollIntoView;
+
+ /**
+ * The id of this root, used to find the server side instance of the root
+ * form which a request originates. A negative value indicates that the root
+ * id has not yet been assigned by the Application.
+ *
+ * @see Application#nextRootId
+ */
+ private int rootId = -1;
+
+ /**
+ * Keeps track of the Actions added to this component, and manages the
+ * painting and handling as well.
+ */
+ protected ActionManager actionManager;
+
+ /**
+ * Thread local for keeping track of the current root.
+ */
+ private static final ThreadLocal<UI> currentRoot = new ThreadLocal<UI>();
+
+ /** Identifies the click event */
+ private ConnectorTracker connectorTracker = new ConnectorTracker(this);
+
+ private Page page = new Page(this);
+
+ private RootServerRpc rpc = new RootServerRpc() {
+ @Override
+ public void click(MouseEventDetails mouseDetails) {
+ fireEvent(new ClickEvent(UI.this, mouseDetails));
+ }
+
+ @Override
+ public void resize(int viewWidth, int viewHeight, int windowWidth,
+ int windowHeight) {
+ // TODO We're not doing anything with the view dimensions
+ getPage().setBrowserWindowSize(windowWidth, windowHeight);
+ }
+ };
+
+ /**
+ * Creates a new empty root without a caption. This root will have a
+ * {@link VerticalLayout} with margins enabled as its content.
+ */
+ public UI() {
+ this((ComponentContainer) null);
+ }
+
+ /**
+ * Creates a new root with the given component container as its content.
+ *
+ * @param content
+ * the content container to use as this roots content.
+ *
+ * @see #setContent(ComponentContainer)
+ */
+ public UI(ComponentContainer content) {
+ registerRpc(rpc);
+ setSizeFull();
+ setContent(content);
+ }
+
+ /**
+ * Creates a new empty root with the given caption. This root will have a
+ * {@link VerticalLayout} with margins enabled as its content.
+ *
+ * @param caption
+ * the caption of the root, used as the page title if there's
+ * nothing but the application on the web page
+ *
+ * @see #setCaption(String)
+ */
+ public UI(String caption) {
+ this((ComponentContainer) null);
+ setCaption(caption);
+ }
+
+ /**
+ * Creates a new root with the given caption and content.
+ *
+ * @param caption
+ * the caption of the root, used as the page title if there's
+ * nothing but the application on the web page
+ * @param content
+ * the content container to use as this roots content.
+ *
+ * @see #setContent(ComponentContainer)
+ * @see #setCaption(String)
+ */
+ public UI(String caption, ComponentContainer content) {
+ this(content);
+ setCaption(caption);
+ }
+
+ @Override
+ protected RootState getState() {
+ return (RootState) super.getState();
+ }
+
+ @Override
+ public Class<? extends RootState> getStateType() {
+ // This is a workaround for a problem with creating the correct state
+ // object during build
+ return RootState.class;
+ }
+
+ /**
+ * Overridden to return a value instead of referring to the parent.
+ *
+ * @return this root
+ *
+ * @see com.vaadin.ui.AbstractComponent#getRoot()
+ */
+ @Override
+ public UI getRoot() {
+ return this;
+ }
+
+ @Override
+ public void replaceComponent(Component oldComponent, Component newComponent) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Application getApplication() {
+ return application;
+ }
+
+ @Override
+ public void paintContent(PaintTarget target) throws PaintException {
+ page.paintContent(target);
+
+ if (scrollIntoView != null) {
+ target.addAttribute("scrollTo", scrollIntoView);
+ scrollIntoView = null;
+ }
+
+ if (pendingFocus != null) {
+ // ensure focused component is still attached to this main window
+ if (pendingFocus.getRoot() == this
+ || (pendingFocus.getRoot() != null && pendingFocus
+ .getRoot().getParent() == this)) {
+ target.addAttribute("focused", pendingFocus);
+ }
+ pendingFocus = null;
+ }
+
+ if (actionManager != null) {
+ actionManager.paintActions(null, target);
+ }
+
+ if (isResizeLazy()) {
+ target.addAttribute(RootConstants.RESIZE_LAZY, true);
+ }
+ }
+
+ /**
+ * Fire a click event to all click listeners.
+ *
+ * @param object
+ * The raw "value" of the variable change from the client side.
+ */
+ private void fireClick(Map<String, Object> parameters) {
+ MouseEventDetails mouseDetails = MouseEventDetails
+ .deSerialize((String) parameters.get("mouseDetails"));
+ fireEvent(new ClickEvent(this, mouseDetails));
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void changeVariables(Object source, Map<String, Object> variables) {
+ if (variables.containsKey(EventId.CLICK_EVENT_IDENTIFIER)) {
+ fireClick((Map<String, Object>) variables
+ .get(EventId.CLICK_EVENT_IDENTIFIER));
+ }
+
+ // Actions
+ if (actionManager != null) {
+ actionManager.handleActions(variables, this);
+ }
+
+ if (variables.containsKey(RootConstants.FRAGMENT_VARIABLE)) {
+ String fragment = (String) variables
+ .get(RootConstants.FRAGMENT_VARIABLE);
+ getPage().setFragment(fragment, true);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.ComponentContainer#getComponentIterator()
+ */
+ @Override
+ public Iterator<Component> getComponentIterator() {
+ // TODO could directly create some kind of combined iterator instead of
+ // creating a new ArrayList
+ ArrayList<Component> components = new ArrayList<Component>();
+
+ if (getContent() != null) {
+ components.add(getContent());
+ }
+
+ components.addAll(windows);
+
+ return components.iterator();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.ComponentContainer#getComponentCount()
+ */
+ @Override
+ public int getComponentCount() {
+ return windows.size() + (getContent() == null ? 0 : 1);
+ }
+
+ /**
+ * Sets the application to which this root is assigned. It is not legal to
+ * change the application once it has been set nor to set a
+ * <code>null</code> application.
+ * <p>
+ * This method is mainly intended for internal use by the framework.
+ * </p>
+ *
+ * @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.
+ * <p>
+ * This method is mainly intended for internal use by the framework.
+ * </p>
+ *
+ * @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 given <code>Window</code> is <code>null</code>.
+ */
+ 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<Window> getWindows() {
+ return Collections.unmodifiableCollection(windows);
+ }
+
+ @Override
+ public void focus() {
+ super.focus();
+ }
+
+ /**
+ * Component that should be focused after the next repaint. Null if no focus
+ * change should take place.
+ */
+ private Focusable pendingFocus;
+
+ private boolean resizeLazy = false;
+
+ /**
+ * This method is used by Component.Focusable objects to request focus to
+ * themselves. Focus renders must be handled at window level (instead of
+ * Component.Focusable) due we want the last focused component to be focused
+ * in client too. Not the one that is rendered last (the case we'd get if
+ * implemented in Focusable only).
+ *
+ * To focus component from Vaadin application, use Focusable.focus(). See
+ * {@link Focusable}.
+ *
+ * @param focusable
+ * to be focused on next paint
+ */
+ public void setFocusedComponent(Focusable focusable) {
+ pendingFocus = focusable;
+ markAsDirty();
+ }
+
+ /**
+ * 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.
+ *
+ * @param component
+ * the component to be scrolled into view
+ * @throws IllegalArgumentException
+ * if {@code component} does not belong to this root
+ */
+ public void scrollIntoView(Component component)
+ throws IllegalArgumentException {
+ if (component.getRoot() != this) {
+ throw new IllegalArgumentException(
+ "The component where to scroll must belong to this root.");
+ }
+ 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.
+ *
+ * @return a component container to use as content
+ *
+ * @see #setContent(ComponentContainer)
+ * @see #createDefaultLayout()
+ */
+ public ComponentContainer getContent() {
+ return (ComponentContainer) getState().getContent();
+ }
+
+ /**
+ * Helper method to create the default content layout that is used if no
+ * content has not been explicitly defined.
+ *
+ * @return a newly created layout
+ */
+ private static VerticalLayout createDefaultLayout() {
+ VerticalLayout layout = new VerticalLayout();
+ layout.setMargin(true);
+ return layout;
+ }
+
+ /**
+ * 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
+ * content has been set, a {@link VerticalLayout} with margins enabled will
+ * be used by default - see {@link #createDefaultLayout()}. The content can
+ * also be set in a constructor.
+ *
+ * @return a component container to use as content
+ *
+ * @see #UI(ComponentContainer)
+ * @see #createDefaultLayout()
+ */
+ public void setContent(ComponentContainer content) {
+ if (content == null) {
+ content = createDefaultLayout();
+ }
+
+ if (getState().getContent() != null) {
+ super.removeComponent((Component) getState().getContent());
+ }
+ getState().setContent(content);
+ if (content != null) {
+ super.addComponent(content);
+ }
+ }
+
+ /**
+ * Adds a component to this root. The component is not added directly to the
+ * root, but instead to the content container ({@link #getContent()}).
+ *
+ * @param component
+ * the component to add to this root
+ *
+ * @see #getContent()
+ */
+ @Override
+ public void addComponent(Component component) {
+ getContent().addComponent(component);
+ }
+
+ /**
+ * This implementation removes the component from the content container (
+ * {@link #getContent()}) instead of from the actual root.
+ */
+ @Override
+ public void removeComponent(Component component) {
+ getContent().removeComponent(component);
+ }
+
+ /**
+ * This implementation removes the components from the content container (
+ * {@link #getContent()}) instead of from the actual root.
+ */
+ @Override
+ public void removeAllComponents() {
+ getContent().removeAllComponents();
+ }
+
+ /**
+ * Internal initialization method, should not be overridden. This method is
+ * not declared as final because that would break compatibility with e.g.
+ * CDI.
+ *
+ * @param request
+ * the initialization request
+ */
+ public void doInit(WrappedRequest request) {
+ getPage().init(request);
+
+ // Call the init overridden by the application developer
+ init(request);
+ }
+
+ /**
+ * Initializes this root. 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.
+ * <p>
+ * 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.
+ * </p>
+ *
+ * @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.
+ * <p>
+ * 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.
+ * </p>
+ *
+ * @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
+ * <code>null</code>
+ *
+ * @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 <T extends Action & com.vaadin.event.Action.Listener> void addAction(
+ T action) {
+ getActionManager().addAction(action);
+ }
+
+ @Override
+ public <T extends Action & com.vaadin.event.Action.Listener> void removeAction(
+ T action) {
+ if (actionManager != null) {
+ actionManager.removeAction(action);
+ }
+ }
+
+ @Override
+ public void addActionHandler(Handler actionHandler) {
+ getActionManager().addActionHandler(actionHandler);
+ }
+
+ @Override
+ public void removeActionHandler(Handler actionHandler) {
+ if (actionManager != null) {
+ actionManager.removeActionHandler(actionHandler);
+ }
+ }
+
+ /**
+ * Should resize operations be lazy, i.e. should there be a delay before
+ * layout sizes are recalculated. Speeds up resize operations in slow UIs
+ * with the penalty of slightly decreased usability.
+ * <p>
+ * Default value: <code>false</code>
+ *
+ * @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 <code>true</code> if lazy resize is enabled, <code>false</code>
+ * 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);
+ }
+
+}
/**
* A component that represents a floating popup window that can be added to a
- * {@link Root}. A window is added to a {@code Root} using
- * {@link Root#addWindow(Window)}. </p>
+ * {@link UI}. A window is added to a {@code UI} using
+ * {@link UI#addWindow(Window)}. </p>
* <p>
* The contents of a window is set using {@link #setContent(ComponentContainer)}
* or by using the {@link #Window(String, ComponentContainer)} constructor. The
* </p>
* <p>
* In Vaadin versions prior to 7.0.0, Window was also used as application level
- * windows. This function is now covered by the {@link Root} class.
+ * windows. This function is now covered by the {@link UI} class.
* </p>
*
* @author Vaadin Ltd.
* </p>
*/
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);
}
}
* <p>
*/
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.");
/**
* 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);
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;
classes.remove(DragAndDropWrapper.class);
classes.remove(CustomComponent.class);
classes.remove(LoginForm.class);
- classes.remove(Root.class);
+ classes.remove(UI.class);
return classes;
}
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 {
@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
};
owner = new Upload() {
@Override
- public Root getRoot() {
- return root;
+ public UI getRoot() {
+ return uI;
}
};
streamVariable = EasyMock.createMock(StreamVariable.class);
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 {
int numReadOnlyChanges = 0;
AbstractField field = new AbstractField() {
- private Root root = new Root() {
+ private UI uI = new UI() {
@Override
protected void init(WrappedRequest request) {
}
@Override
- public com.vaadin.ui.Root getRoot() {
- return root;
+ public com.vaadin.ui.UI getRoot() {
+ return uI;
};
@Override
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
}
/**
- * 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
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() {
/**
* Tests that the ClassLoader passed in the ApplicationStartEvent is used to
- * load Root classes.
+ * load UI classes.
*
* @throws Exception
* if thrown
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));
}
@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)
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 {
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
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
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;
}
}
- 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();;
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;
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 {
// 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;
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);
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");
}
}
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;
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;
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;
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
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;
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 {
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;
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;
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;
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;
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;
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 {
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;
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 {
public void buttonClick(ClickEvent event) {
final ExternalResource r = new ExternalResource(
"http://www.google.com");
- Root.getCurrent().getPage().open(r);
+ UI.getCurrent().getPage().open(r);
}
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");
}
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");
}
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;
w.addComponent(s);
- Root.getCurrent().addWindow(w);
+ UI.getCurrent().addWindow(w);
}
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 {
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;
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 {
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;
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;
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;
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
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 {
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;
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()));
}
}
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;
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 {
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();
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
}
@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
}
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) {
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 {
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) {
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 {
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
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;
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")
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")
@Override
public void init() {
- Root.LegacyWindow mainWindow = new Root.LegacyWindow(
+ UI.LegacyWindow mainWindow = new UI.LegacyWindow(
"Gridlayoutbug Application");
setMainWindow(mainWindow);
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;
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 {
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")
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;
import com.vaadin.ui.LoginForm;\r
import com.vaadin.ui.LoginForm.LoginEvent;\r
import com.vaadin.ui.LoginForm.LoginListener;\r
-import com.vaadin.ui.Root;\r
+import com.vaadin.ui.UI;\r
\r
public class LoginFormRootInLoginHandler extends TestBase {\r
\r
\r
@Override\r
public void onLogin(LoginEvent event) {\r
- Root r1 = Root.getCurrent();\r
+ UI r1 = UI.getCurrent();\r
if (r1 != null) {\r
- addComponent(new Label("Root.getCurrent().data: "\r
+ addComponent(new Label("UI.getCurrent().data: "\r
+ r1.getData()));\r
} else {\r
- addComponent(new Label("Root.getCurrent() is null"));\r
+ addComponent(new Label("UI.getCurrent() is null"));\r
}\r
- Root r2 = ((LoginForm) event.getSource()).getRoot();\r
+ UI r2 = ((LoginForm) event.getSource()).getRoot();\r
if (r2 != null) {\r
addComponent(new Label("event.getSource().data: "\r
+ r2.getData()));\r
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();
}
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;
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 {
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;
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));
}
@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));
}
};
- return root;
+ return uI;
}
}
@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
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();
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;
@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
@Override
public String getTestDescription() {
- return "Root with @RootTheme(\"tests-tickets\")";
+ return "UI with @RootTheme(\"tests-tickets\")";
}
@Override
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 {
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;
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 {
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;
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;
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;
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 {
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;
/**
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;
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;
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;
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;
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;
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;
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 {
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
@Override
public void init() {
- Root.LegacyWindow mainWindow = new Root.LegacyWindow() {
+ UI.LegacyWindow mainWindow = new UI.LegacyWindow() {
@Override
public void attach() {
log(this);
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 {
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;
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;
}
});
- Root main = getLayout().getRoot();
+ UI main = getLayout().getRoot();
main.addWindow(window);
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 {
@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);
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;
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 {
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
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 .
@Override
public void init() {
- setMainWindow(new Root.LegacyWindow("Test window"));
+ setMainWindow(new UI.LegacyWindow("Test window"));
ComboBox combo = new ComboBox("Names",
databaseHelper.getTestContainer());
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
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;
@Override
protected void setup() {
- Root w = getLayout().getRoot();
+ UI w = getLayout().getRoot();
/* darn reindeer has no icons */
/* Make all trees (their nodes actually) draggable */
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 {
@Override
protected void setup() {
- Root w = getLayout().getRoot();
+ UI w = getLayout().getRoot();
TestUtils
.injectCSS(
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 {
@Override
protected void setup() {
- Root w = getLayout().getRoot();
+ UI w = getLayout().getRoot();
HorizontalSortableCssLayoutWithWrappers verticalSortableCssLayoutWithWrappers = new HorizontalSortableCssLayoutWithWrappers();
w.addWindow(verticalSortableCssLayoutWithWrappers);
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 {
@Override
protected void setup() {
- Root w = getLayout().getRoot();
+ UI w = getLayout().getRoot();
TestUtils
.injectCSS(
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 {
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 {
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;
@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);
@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
}
}
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;
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;
/**
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;
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;
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;
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 {
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 {
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;
}
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;
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;
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;
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;
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
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class AutoGeneratingForm extends Root {
+public class AutoGeneratingForm extends UI {
@Override
protected void init(WrappedRequest request) {
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;
/**
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class BasicApplication extends Root {
+public class BasicApplication extends UI {
@Override
protected void init(WrappedRequest request) {
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;
/**
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class CreatingPreserveState extends Root {
+public class CreatingPreserveState extends UI {
private static int windowCounter = 0;
@Override
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;
/**
* @since 7.0.0
*/
@Theme("hello-theme")
-public class DefineRootTheme extends Root {
+public class DefineRootTheme extends UI {
@Override
protected void init(WrappedRequest request) {
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
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
}
}
-class DefaultRoot extends Root {
+class DefaultRoot extends UI {
@Override
protected void init(WrappedRequest request) {
getContent().addComponent(
}
}
-class TouchRoot extends Root {
+class TouchRoot extends UI {
@Override
protected void init(WrappedRequest request) {
WebBrowser webBrowser = request.getBrowserDetails().getWebBrowser();
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
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class FindCurrentRootAndApplication extends Root {
+public class FindCurrentRootAndApplication extends UI {
@Override
protected void init(WrappedRequest request) {
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());
}
});
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;
/**
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class MultiTabApplication extends Root {
+public class MultiTabApplication extends UI {
private class MainView extends VerticalLayout {
public MainView() {
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;
/**
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class UsingBeanValidation extends Root {
+public class UsingBeanValidation extends UI {
class Person {
@Size(min = 5, max = 50)
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
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class UsingUriFragments extends Root {
+public class UsingUriFragments extends UI {
@Override
protected void init(WrappedRequest request) {
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
/**
* Mini tutorial code for
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class UsingXyzWhenInitializing extends Root {
+public class UsingXyzWhenInitializing extends UI {
@Override
protected void init(WrappedRequest request) {
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
* @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();
import com.vaadin.annotations.Widgetset;
import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
/**
* Mini tutorial code for
* @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) {
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
* @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) {
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");
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 {
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;
}
}
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) {
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 {
Map<Connector, String> connectorMap = new HashMap<Connector, String>();
connectorMap.put(this, "this");
- connectorMap.put(Root.getCurrent(), "root");
+ connectorMap.put(UI.getCurrent(), "root");
boolean[] bits = { true, true, false, true };
package com.vaadin.tests.minitutorials.v7a3;
import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
-public class ComplexTypesRoot extends Root {
+public class ComplexTypesRoot extends UI {
@Override
protected void init(WrappedRequest request) {
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
-public class FlotJavaScriptRoot extends Root {
+public class FlotJavaScriptRoot extends UI {
@Override
protected void init(WrappedRequest request) {
package com.vaadin.tests.minitutorials.v7a3;
import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
-public class RedButtonRoot extends Root {
+public class RedButtonRoot extends UI {
@Override
protected void init(WrappedRequest request) {
addComponent(new RedButton("My red button"));
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.NativeButton;
-import com.vaadin.ui.Root;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.UI.LegacyWindow;
@SuppressWarnings("serial")
public class ButtonsTest extends com.vaadin.Application.LegacyApplication {
- final Root.LegacyWindow main = new LegacyWindow("Button states & themes");
+ final UI.LegacyWindow main = new LegacyWindow("Button states & themes");
CheckBox styleToggle;
CheckBox iconToggle;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Select;
public class Ticket1230 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket124 extends Application.LegacyApplication {
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ShortcutAction;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket1365 extends com.vaadin.Application.LegacyApplication
import com.vaadin.Application;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
/**
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PopupView;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.MarginHandler;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.Application;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket1444 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Window;
public class Ticket1465ModalNotification extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
public class Ticket1519 extends Application.LegacyApplication {
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1572 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.ProgressIndicator;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1581 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.Link;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1589 extends Application.LegacyApplication {
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.Command;
import com.vaadin.ui.MenuBar.MenuItem;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1598 extends Application.LegacyApplication {
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
/**
import com.vaadin.data.Item;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
/**
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1659 extends Application.LegacyApplication {
package com.vaadin.tests.tickets;
import com.vaadin.terminal.SystemError;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket1663 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1673 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket1737 extends Application.LegacyApplication {
package com.vaadin.tests.tickets;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1767 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket1772 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1775 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.Window;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout.MarginHandler;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket1805 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket1806 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.Window;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1834PanelScrolling extends
com.vaadin.Application.LegacyApplication {
import com.vaadin.event.Action.Handler;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
package com.vaadin.tests.tickets;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1868 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket1869 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Validator;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket1900 extends Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket1904 extends Application.LegacyApplication {
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket1916 extends Application.LegacyApplication {
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1919 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket1921 extends Application.LegacyApplication implements
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket1923 extends com.vaadin.Application.LegacyApplication {
package com.vaadin.tests.tickets;
import com.vaadin.Application;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1925 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
package com.vaadin.tests.tickets;
import com.vaadin.Application;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1953 extends Application.LegacyApplication {
public static final String cellStyle = "test-cell";
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket1966 extends Application.LegacyApplication {
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket1966_2 extends Application.LegacyApplication {
import com.vaadin.ui.Alignment;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1970 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1972 extends Application.LegacyApplication {
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1975 extends Application.LegacyApplication {
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket1982 extends Application.LegacyApplication {
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Layout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.OptionGroup;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.TwinColSelect;
package com.vaadin.tests.tickets;
import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
public class Ticket1991 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.data.util.filter.SimpleStringFilter;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
public class Ticket1995 extends Application.LegacyApplication {
import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket20 extends Application.LegacyApplication {
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2001 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.data.util.MethodProperty;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket2002 extends Application.LegacyApplication {
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2007 extends Application.LegacyApplication {
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Select;
public class Ticket2011 extends Application.LegacyApplication {
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2014 extends Application.LegacyApplication {
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.MarginHandler;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2022 extends Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2023 extends com.vaadin.Application.LegacyApplication
implements Button.ClickListener {
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket2026 extends Application.LegacyApplication {
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2037 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Notification;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket2038 extends Application.LegacyApplication {
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout.MarginHandler;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2042 extends Application.LegacyApplication {
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Link;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2043 extends Application.LegacyApplication {
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2048 extends Application.LegacyApplication {
import com.vaadin.ui.DateField;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket2053 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2060 extends Application.LegacyApplication {
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
import com.vaadin.Application;
import com.vaadin.ui.HorizontalSplitPanel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2083 extends Application.LegacyApplication {
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket2090 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Embedded;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2095 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
public class Ticket2098 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import com.vaadin.Application;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2101 extends Application.LegacyApplication {
import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Component;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Tree;
main.addComponent(tree);
tree.setImmediate(true);
tree.setNullSelectionAllowed(false);
- tree.addItem("Root 1");
+ tree.addItem("UI 1");
tree.addItem("1. Child 1");
- tree.setParent("1. Child 1", "Root 1");
+ tree.setParent("1. Child 1", "UI 1");
tree.addItem("1. Child 2");
- tree.setParent("1. Child 2", "Root 1");
- tree.addItem("Root 2");
+ tree.setParent("1. Child 2", "UI 1");
+ tree.addItem("UI 2");
tree.addItem("2. Child 1");
- tree.setParent("2. Child 1", "Root 2");
+ tree.setParent("2. Child 1", "UI 2");
tree.addItem("2. Child 2");
- tree.setParent("2. Child 2", "Root 2");
+ tree.setParent("2. Child 2", "UI 2");
tree.addContainerProperty("icon", ExternalResource.class,
new ExternalResource(
"http://www.itmill.com/res/images/itmill_logo.gif"));
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2106 extends Application.LegacyApplication {
import com.vaadin.data.Validator;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Notification;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket2107 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2117 extends Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.CellStyleGenerator;
import com.vaadin.ui.Table.ColumnGenerator;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
/**
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2151 extends Application.LegacyApplication {
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2157 extends Application.LegacyApplication {
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2178 extends Application.LegacyApplication {
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Validator;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket2179 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
public class Ticket2180 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.OptionGroup;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
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.Layout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.RichTextArea;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.data.Item;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.CellStyleGenerator;
import com.vaadin.ui.Table.ColumnGenerator;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2209 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2209OL extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2209OL2 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Reindeer;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2222 extends Application.LegacyApplication {
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2231 extends Application.LegacyApplication {
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.SpacingHandler;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2232 extends Application.LegacyApplication {
import com.vaadin.data.Item;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2234 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextArea;
public class Ticket2235 extends Application.LegacyApplication {
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket2240 extends Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
public class Ticket2242 extends Application.LegacyApplication implements
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2244 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.HorizontalSplitPanel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2245 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2267 extends Application.LegacyApplication {
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2271 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2282 extends Application.LegacyApplication {
import com.vaadin.ui.Alignment;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2283 extends Application.LegacyApplication {
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2287 extends Ticket2292 {
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
import com.vaadin.ui.Link;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2292 extends com.vaadin.Application.LegacyApplication
implements RequestHandler {
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2294 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2296 extends Application.LegacyApplication {
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2297 extends Ticket2292 {
import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2303 extends Application.LegacyApplication {
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.themes.Reindeer;
public class Ticket2304 extends Application.LegacyApplication {
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.themes.Reindeer;
public class Ticket2310 extends Application.LegacyApplication {
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.Application;
import com.vaadin.ui.RichTextArea;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Window;
public class Ticket2323 extends Application.LegacyApplication {
package com.vaadin.tests.tickets;
import com.vaadin.Application;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.ColumnGenerator;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2337 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2339 extends Application.LegacyApplication {
import com.vaadin.data.Item;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
public class Ticket2341 extends com.vaadin.Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.BaseTheme;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2347 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Form;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
public class Ticket2365 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
public class Ticket2398 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2404 extends Application.LegacyApplication {
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout.MarginHandler;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
package com.vaadin.tests.tickets;
import com.vaadin.ui.Form;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2411 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket2415 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.ProgressIndicator;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2420 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TabSheet;
public class Ticket2425 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2426 extends Application.LegacyApplication {
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2431 extends Application.LegacyApplication {
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Layout.SpacingHandler;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2432 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
public class Ticket2434 extends Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.PopupView;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket2436 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Window;
public class Ticket2526 extends Application.LegacyApplication {
import com.vaadin.Application;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.NativeSelect;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
/**
* @author Risto Yrjänä / Vaadin Ltd.
import com.vaadin.Application;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.Application;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
/**
* #5053: Last ComboBox item may not be shown if null selection enabled
import com.vaadin.event.ShortcutListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
/**
import com.vaadin.Application;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket5952 extends Application.LegacyApplication {
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
@SuppressWarnings("serial")
public class Ticket695 extends Application.LegacyApplication {
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
public class Ticket736 extends Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
import com.vaadin.ui.Table;
/**
* Test for #8291 and #7666: NegativeArraySizeException when Table scrolled to
* the end and its size reduced.
*/
-public class Ticket8291 extends Root {
+public class Ticket8291 extends UI {
@Override
public void init(WrappedRequest request) {
import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
public class Ticket846 extends Application.LegacyApplication {
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.terminal.SystemError;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
/**
* Provides sample directory based on application directory. If this fails then
* @param application
* @return file pointing to sample directory
*/
- public static File getDirectory(Application application, Root root) {
+ public static File getDirectory(Application application, UI uI) {
String errorMessage = "Access to application "
+ "context base directory failed, "
+ "possible security constraint with Application "
"Cannot provide sample directory"));
errorPanel.addComponent(new Label(errorMessage, ContentMode.XHTML));
// Remove all components from applications main window
- root.getContent().removeAllComponents();
+ uI.getContent().removeAllComponents();
// Add error panel
- root.getContent().addComponent(errorPanel);
+ uI.getContent().addComponent(errorPanel);
return null;
}
}
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
public class TestUtils {
*
* @param cssString
*/
- public static void injectCSS(Root w, String cssString) {
+ public static void injectCSS(UI w, String cssString) {
String script = "if ('\\v'=='v') /* ie only */ {\n"
+ " document.createStyleSheet().cssText = '"
+ cssString
@Override
protected String getTestDescription() {
- return "There should be two additional divs in the HTML of the bootstrap page for this Root";
+ return "There should be two additional divs in the HTML of the bootstrap page for this UI";
}
@Override
import com.vaadin.terminal.gwt.server.BootstrapResponse;
import com.vaadin.terminal.gwt.server.AddonContextEvent;
import com.vaadin.terminal.gwt.server.AddonContextListener;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
public class TestAddonContextListener implements AddonContextListener {
@Override
}
private boolean shouldModify(BootstrapResponse response) {
- Root root = response.getRoot();
- boolean shouldModify = root != null
- && root.getClass() == BootstrapModifyRoot.class;
+ UI uI = response.getRoot();
+ boolean shouldModify = uI != null
+ && uI.getClass() == BootstrapModifyRoot.class;
return shouldModify;
}
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Form;
-import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;