summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-08-24 08:44:20 +0300
committerArtur Signell <artur@vaadin.com>2012-08-24 13:23:16 +0300
commitda176c32c4d92676424021712a7f6d7ee8cedf76 (patch)
tree36e5c97e5c556dd882498516415663384db18185 /server/src/com/vaadin/ui
parent86bbe59bb855b6cf57486322bca92e2ace88e8a2 (diff)
downloadvaadin-framework-da176c32c4d92676424021712a7f6d7ee8cedf76.tar.gz
vaadin-framework-da176c32c4d92676424021712a7f6d7ee8cedf76.zip
Renamed Root to UI, automatic rename (#8908)
Automatic rename in Eclipse of the class Root to UI with all rename options enabled, rename also embedded "Root" in variable and method names. The following classes/methods were excluded in the rename: - BootstrapHandler.getApplicationCSSClassName() - ComponentLocator - ConnectorMap - ItemClickEvent - KeepAllItemsVisible - MenuBarTest - MenuBarTooltips - TreeTableTest - TreeWithIcons - Trees - VDebugConsole.printLayoutProblems()
Diffstat (limited to 'server/src/com/vaadin/ui')
-rw-r--r--server/src/com/vaadin/ui/AbstractComponent.java6
-rw-r--r--server/src/com/vaadin/ui/Component.java14
-rw-r--r--server/src/com/vaadin/ui/ConnectorTracker.java36
-rw-r--r--server/src/com/vaadin/ui/LoginForm.java4
-rw-r--r--server/src/com/vaadin/ui/UI.java (renamed from server/src/com/vaadin/ui/Root.java)52
-rw-r--r--server/src/com/vaadin/ui/Window.java20
6 files changed, 66 insertions, 66 deletions
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java
index b1393488f7..147034fe6b 100644
--- a/server/src/com/vaadin/ui/AbstractComponent.java
+++ b/server/src/com/vaadin/ui/AbstractComponent.java
@@ -561,7 +561,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
* 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();
}
@@ -588,9 +588,9 @@ public abstract class AbstractComponent extends AbstractClientConnector
public void detach() {
super.detach();
if (actionManager != null) {
- // Remove any existing viewer. Root cast is just to make the
+ // Remove any existing viewer. UI cast is just to make the
// compiler happy
- actionManager.setViewer((Root) null);
+ actionManager.setViewer((UI) null);
}
}
diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java
index 89e282d4e1..7406303af9 100644
--- a/server/src/com/vaadin/ui/Component.java
+++ b/server/src/com/vaadin/ui/Component.java
@@ -507,18 +507,18 @@ public interface Component extends ClientConnector, Sizeable, Serializable {
public void setIcon(Resource icon);
/**
- * Gets the Root the component is attached to.
+ * Gets the UI the component is attached to.
*
* <p>
- * If the component is not attached to a Root through a component
+ * If the component is not attached to a UI through a component
* containment hierarchy, <code>null</code> is returned.
* </p>
*
- * @return the Root of the component or <code>null</code> if it is not
- * attached to a Root
+ * @return the UI of the component or <code>null</code> if it is not
+ * attached to a UI
*/
@Override
- public Root getRoot();
+ public UI getRoot();
/**
* Gets the application object to which the component is attached.
@@ -574,8 +574,8 @@ public interface Component extends ClientConnector, Sizeable, Serializable {
* {@link #setParent(Component)}.
* </p>
* <p>
- * This method must call {@link Root#componentAttached(Component)} to let
- * the Root know that a new Component has been attached.
+ * This method must call {@link UI#componentAttached(Component)} to let
+ * the UI know that a new Component has been attached.
* </p>
*
*
diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java
index 72879e0a25..3a6e1e4ea8 100644
--- a/server/src/com/vaadin/ui/ConnectorTracker.java
+++ b/server/src/com/vaadin/ui/ConnectorTracker.java
@@ -30,7 +30,7 @@ import com.vaadin.terminal.gwt.server.ClientConnector;
/**
* A class which takes care of book keeping of {@link ClientConnector}s for a
- * Root.
+ * UI.
* <p>
* Provides {@link #getConnector(String)} which can be used to lookup a
* connector from its id. This is for framework use only and should not be
@@ -54,7 +54,7 @@ public class ConnectorTracker implements Serializable {
private Set<ClientConnector> dirtyConnectors = new HashSet<ClientConnector>();
private Set<ClientConnector> uninitializedConnectors = new HashSet<ClientConnector>();
- private Root root;
+ private UI uI;
private Map<ClientConnector, Object> diffStates = new HashMap<ClientConnector, Object>();
/**
@@ -68,15 +68,15 @@ public class ConnectorTracker implements Serializable {
}
/**
- * Creates a new ConnectorTracker for the given root. A tracker is always
- * attached to a root and the root cannot be changed during the lifetime of
+ * Creates a new ConnectorTracker for the given uI. A tracker is always
+ * attached to a uI and the uI cannot be changed during the lifetime of
* a {@link ConnectorTracker}.
*
- * @param root
- * The root to attach to. Cannot be null.
+ * @param uI
+ * The uI to attach to. Cannot be null.
*/
- public ConnectorTracker(Root root) {
- this.root = root;
+ public ConnectorTracker(UI uI) {
+ this.uI = uI;
}
/**
@@ -210,8 +210,8 @@ public class ConnectorTracker implements Serializable {
while (iterator.hasNext()) {
String connectorId = iterator.next();
ClientConnector connector = connectorIdToConnector.get(connectorId);
- if (getRootForConnector(connector) != root) {
- // If connector is no longer part of this root,
+ if (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)
@@ -232,14 +232,14 @@ public class ConnectorTracker implements Serializable {
}
/**
- * 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;
}
@@ -330,15 +330,15 @@ public class ConnectorTracker implements Serializable {
}
/**
- * Mark all connectors in this root as dirty.
+ * Mark all connectors in this uI as dirty.
*/
public void markAllConnectorsDirty() {
- markConnectorsDirtyRecursively(root);
+ markConnectorsDirtyRecursively(uI);
getLogger().fine("All connectors are now dirty");
}
/**
- * Mark all connectors in this root as clean.
+ * Mark all connectors in this uI as clean.
*/
public void markAllConnectorsClean() {
dirtyConnectors.clear();
@@ -370,7 +370,7 @@ public class ConnectorTracker implements Serializable {
* client in the following request.
* </p>
*
- * @return A collection of all dirty connectors for this root. This list may
+ * @return A collection of all dirty connectors for this uI. This list may
* contain invisible connectors.
*/
public Collection<ClientConnector> getDirtyConnectors() {
diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java
index bb7767084c..f127a2705b 100644
--- a/server/src/com/vaadin/ui/LoginForm.java
+++ b/server/src/com/vaadin/ui/LoginForm.java
@@ -99,8 +99,8 @@ public class LoginForm extends CustomComponent {
throws IOException {
String requestPathInfo = request.getRequestPathInfo();
if ("/loginHandler".equals(requestPathInfo)) {
- // Ensure Root.getCurrent() works in listeners
- Root.setCurrent(getRoot());
+ // Ensure UI.getCurrent() works in listeners
+ UI.setCurrent(getRoot());
response.setCacheTime(-1);
response.setContentType("text/html; charset=utf-8");
diff --git a/server/src/com/vaadin/ui/Root.java b/server/src/com/vaadin/ui/UI.java
index 67f2e04a65..33eefff485 100644
--- a/server/src/com/vaadin/ui/Root.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -76,7 +76,7 @@ import com.vaadin.ui.Window.CloseListener;
* </p>
* <p>
* If a {@link EagerInit} annotation is present on a class extending
- * <code>Root</code>, the framework will use a faster initialization method
+ * <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>
@@ -86,7 +86,7 @@ import com.vaadin.ui.Window.CloseListener;
*
* @since 7.0
*/
-public abstract class Root extends AbstractComponentContainer implements
+public abstract class UI extends AbstractComponentContainer implements
Action.Container, Action.Notifier, Vaadin6Component {
/**
@@ -96,7 +96,7 @@ public abstract class Root extends AbstractComponentContainer implements
*/
@Deprecated
@EagerInit
- public static class LegacyWindow extends Root {
+ public static class LegacyWindow extends UI {
private String name;
/**
@@ -210,7 +210,7 @@ public abstract class Root extends AbstractComponentContainer implements
}
/**
- * Opens the given resource in this root. The contents of this Root is
+ * Opens the given resource in this root. The contents of this UI is
* replaced by the {@code Resource}.
*
* @param resource
@@ -422,7 +422,7 @@ public abstract class Root extends AbstractComponentContainer implements
/**
* Thread local for keeping track of the current root.
*/
- private static final ThreadLocal<Root> currentRoot = new ThreadLocal<Root>();
+ private static final ThreadLocal<UI> currentRoot = new ThreadLocal<UI>();
/** Identifies the click event */
private ConnectorTracker connectorTracker = new ConnectorTracker(this);
@@ -432,7 +432,7 @@ public abstract class Root extends AbstractComponentContainer implements
private RootServerRpc rpc = new RootServerRpc() {
@Override
public void click(MouseEventDetails mouseDetails) {
- fireEvent(new ClickEvent(Root.this, mouseDetails));
+ fireEvent(new ClickEvent(UI.this, mouseDetails));
}
@Override
@@ -447,7 +447,7 @@ public abstract class Root extends AbstractComponentContainer implements
* Creates a new empty root without a caption. This root will have a
* {@link VerticalLayout} with margins enabled as its content.
*/
- public Root() {
+ public UI() {
this((ComponentContainer) null);
}
@@ -459,7 +459,7 @@ public abstract class Root extends AbstractComponentContainer implements
*
* @see #setContent(ComponentContainer)
*/
- public Root(ComponentContainer content) {
+ public UI(ComponentContainer content) {
registerRpc(rpc);
setSizeFull();
setContent(content);
@@ -475,7 +475,7 @@ public abstract class Root extends AbstractComponentContainer implements
*
* @see #setCaption(String)
*/
- public Root(String caption) {
+ public UI(String caption) {
this((ComponentContainer) null);
setCaption(caption);
}
@@ -492,7 +492,7 @@ public abstract class Root extends AbstractComponentContainer implements
* @see #setContent(ComponentContainer)
* @see #setCaption(String)
*/
- public Root(String caption, ComponentContainer content) {
+ public UI(String caption, ComponentContainer content) {
this(content);
setCaption(caption);
}
@@ -517,7 +517,7 @@ public abstract class Root extends AbstractComponentContainer implements
* @see com.vaadin.ui.AbstractComponent#getRoot()
*/
@Override
- public Root getRoot() {
+ public UI getRoot() {
return this;
}
@@ -668,7 +668,7 @@ public abstract class Root extends AbstractComponentContainer implements
*/
public void setRootId(int rootId) {
if (this.rootId != -1) {
- throw new IllegalStateException("Root id has already been defined");
+ throw new IllegalStateException("UI id has already been defined");
}
this.rootId = rootId;
}
@@ -845,7 +845,7 @@ public abstract class Root extends AbstractComponentContainer implements
*
* @return a component container to use as content
*
- * @see #Root(ComponentContainer)
+ * @see #UI(ComponentContainer)
* @see #createDefaultLayout()
*/
public void setContent(ComponentContainer content) {
@@ -920,7 +920,7 @@ public abstract class Root extends AbstractComponentContainer implements
* {@link BrowserDetails} will be available in the request. If the browser
* details are not required, loading the application in the browser can take
* some shortcuts giving a faster initial rendering. This can be indicated
- * by adding the {@link EagerInit} annotation to the Root class.
+ * by adding the {@link EagerInit} annotation to the UI class.
* </p>
*
* @param request
@@ -938,14 +938,14 @@ public abstract class Root extends AbstractComponentContainer implements
* background threads.
* </p>
*
- * @param root
+ * @param uI
* the root to register as the current root
*
* @see #getCurrent()
* @see ThreadLocal
*/
- public static void setCurrent(Root root) {
- currentRoot.set(root);
+ public static void setCurrent(UI uI) {
+ currentRoot.set(uI);
}
/**
@@ -956,9 +956,9 @@ public abstract class Root extends AbstractComponentContainer implements
* @return the current root instance if available, otherwise
* <code>null</code>
*
- * @see #setCurrent(Root)
+ * @see #setCurrent(UI)
*/
- public static Root getCurrent() {
+ public static UI getCurrent() {
return currentRoot.get();
}
@@ -1027,9 +1027,9 @@ public abstract class Root extends AbstractComponentContainer implements
}
/**
- * Add a click listener to the Root. The listener is called whenever the
- * user clicks inside the Root. Also when the click targets a component
- * inside the Root, provided the targeted component does not prevent the
+ * Add a click listener to the UI. The listener is called whenever the
+ * user clicks inside the UI. Also when the click targets a component
+ * inside the UI, provided the targeted component does not prevent the
* click event from propagating.
*
* Use {@link #removeListener(ClickListener)} to remove the listener.
@@ -1043,7 +1043,7 @@ public abstract class Root extends AbstractComponentContainer implements
}
/**
- * Remove a click listener from the Root. The listener should earlier have
+ * Remove a click listener from the UI. The listener should earlier have
* been added using {@link #addListener(ClickListener)}.
*
* @param listener
@@ -1056,7 +1056,7 @@ public abstract class Root extends AbstractComponentContainer implements
@Override
public boolean isConnectorEnabled() {
- // TODO How can a Root be invisible? What does it mean?
+ // TODO How can a UI be invisible? What does it mean?
return isVisible() && isEnabled();
}
@@ -1069,7 +1069,7 @@ public abstract class Root extends AbstractComponentContainer implements
}
/**
- * Setting the caption of a Root is not supported. To set the title of the
+ * Setting the caption of a UI is not supported. To set the title of the
* HTML page, use Page.setTitle
*
* @deprecated as of 7.0.0, use {@link Page#setTitle(String)}
@@ -1078,7 +1078,7 @@ public abstract class Root extends AbstractComponentContainer implements
@Deprecated
public void setCaption(String caption) {
throw new IllegalStateException(
- "You can not set the title of a Root. To set the title of the HTML page, use Page.setTitle");
+ "You can not set the title of a UI. To set the title of the HTML page, use Page.setTitle");
}
/**
diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java
index d79588cc63..335f7fd67d 100644
--- a/server/src/com/vaadin/ui/Window.java
+++ b/server/src/com/vaadin/ui/Window.java
@@ -40,8 +40,8 @@ import com.vaadin.terminal.Vaadin6Component;
/**
* A component that represents a floating popup window that can be added to a
- * {@link Root}. A window is added to a {@code Root} using
- * {@link Root#addWindow(Window)}. </p>
+ * {@link UI}. A window is added to a {@code UI} using
+ * {@link UI#addWindow(Window)}. </p>
* <p>
* The contents of a window is set using {@link #setContent(ComponentContainer)}
* or by using the {@link #Window(String, ComponentContainer)} constructor. The
@@ -57,7 +57,7 @@ import com.vaadin.terminal.Vaadin6Component;
* </p>
* <p>
* In Vaadin versions prior to 7.0.0, Window was also used as application level
- * windows. This function is now covered by the {@link Root} class.
+ * windows. This function is now covered by the {@link UI} class.
* </p>
*
* @author Vaadin Ltd.
@@ -222,14 +222,14 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier,
* </p>
*/
public void close() {
- Root root = getRoot();
+ UI uI = getRoot();
// Don't do anything if not attached to a root
- if (root != null) {
+ if (uI != null) {
// focus is restored to the parent window
- root.focus();
+ uI.focus();
// subwindow is removed from the root
- root.removeWindow(this);
+ uI.removeWindow(this);
}
}
@@ -476,13 +476,13 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier,
* <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.");