diff options
author | Artur Signell <artur@vaadin.com> | 2012-08-24 11:32:49 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-08-24 13:23:19 +0300 |
commit | 0b0ddb86876a965f68c6160fe7a499412b6c199d (patch) | |
tree | 636de4f5b01e38b4e7d460012438fe7a266e7596 /server/src | |
parent | ff0761f787f94a157d12af2a37e10e808d43fc59 (diff) | |
download | vaadin-framework-0b0ddb86876a965f68c6160fe7a499412b6c199d.tar.gz vaadin-framework-0b0ddb86876a965f68c6160fe7a499412b6c199d.zip |
Component.getRoot() -> Component.getUI() (#8908)
Diffstat (limited to 'server/src')
10 files changed, 28 insertions, 28 deletions
diff --git a/server/src/com/vaadin/terminal/AbstractClientConnector.java b/server/src/com/vaadin/terminal/AbstractClientConnector.java index 87e1dbaa38..157bd17e41 100644 --- a/server/src/com/vaadin/terminal/AbstractClientConnector.java +++ b/server/src/com/vaadin/terminal/AbstractClientConnector.java @@ -94,7 +94,7 @@ public abstract class AbstractClientConnector implements ClientConnector { /* Documentation copied from interface */ @Override public void markAsDirty() { - UI uI = getRoot(); + UI uI = getUI(); if (uI != null) { uI.getConnectorTracker().markDirty(this); } @@ -154,7 +154,7 @@ public abstract class AbstractClientConnector implements ClientConnector { sharedState = createState(); } - UI uI = getRoot(); + UI uI = getUI(); if (uI != null && !uI.getConnectorTracker().isDirty(this)) { requestRepaint(); } @@ -363,7 +363,7 @@ public abstract class AbstractClientConnector implements ClientConnector { * @return The connector's application, or <code>null</code> if not attached */ protected Application getApplication() { - UI uI = getRoot(); + UI uI = getUI(); if (uI == null) { return null; } else { @@ -380,7 +380,7 @@ public abstract class AbstractClientConnector implements ClientConnector { * is found. */ @Override - public UI getRoot() { + public UI getUI() { ClientConnector connector = this; while (connector != null) { if (connector instanceof UI) { @@ -528,7 +528,7 @@ public abstract class AbstractClientConnector implements ClientConnector { public void attach() { markAsDirty(); - getRoot().getConnectorTracker().registerConnector(this); + getUI().getConnectorTracker().registerConnector(this); for (ClientConnector connector : getAllChildrenIterable(this)) { connector.attach(); @@ -540,7 +540,7 @@ public abstract class AbstractClientConnector implements ClientConnector { * {@inheritDoc} * * <p> - * The {@link #getApplication()} and {@link #getRoot()} methods might return + * The {@link #getApplication()} and {@link #getUI()} methods might return * <code>null</code> after this method is called. * </p> */ @@ -550,7 +550,7 @@ public abstract class AbstractClientConnector implements ClientConnector { connector.detach(); } - getRoot().getConnectorTracker().unregisterConnector(this); + getUI().getConnectorTracker().unregisterConnector(this); } @Override diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 7662564233..e19cfc4de6 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1245,7 +1245,7 @@ public abstract class AbstractCommunicationManager implements Serializable { public static JSONObject encodeState(ClientConnector connector, SharedState state) throws JSONException { - UI uI = connector.getRoot(); + UI uI = connector.getUI(); ConnectorTracker connectorTracker = uI.getConnectorTracker(); Class<? extends SharedState> stateType = connector.getStateType(); Object diffState = connectorTracker.getDiffState(connector); @@ -2353,7 +2353,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * handling post */ String paintableId = owner.getConnectorId(); - int rootId = owner.getRoot().getUIId(); + int rootId = owner.getUI().getUIId(); String key = rootId + "/" + paintableId + "/" + name; if (pidToNameToStreamVariable == null) { diff --git a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java index 3a18dbd6f4..1a5019a7c1 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java +++ b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java @@ -180,7 +180,7 @@ public interface ClientConnector extends Connector, RpcTarget { * @return The UI this connector is attached to or null if it is not * attached to any UI */ - public UI getRoot(); + public UI getUI(); /** * Called before the shared state and RPC invocations are sent to the diff --git a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java index 42312b72fd..0106f466fc 100644 --- a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java +++ b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java @@ -327,7 +327,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector { } @Override - public UI getRoot() { + public UI getUI() { return null; } diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 147034fe6b..0b97e1667d 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -561,9 +561,9 @@ public abstract class AbstractComponent extends AbstractClientConnector * here, we use the default documentation from implemented interface. */ @Override - public UI getRoot() { + public UI getUI() { // Just make method from implemented Component interface public - return super.getRoot(); + return super.getUI(); } /* @@ -601,7 +601,7 @@ public abstract class AbstractComponent extends AbstractClientConnector if (this instanceof Focusable) { final Application app = getApplication(); if (app != null) { - getRoot().setFocusedComponent((Focusable) this); + getUI().setFocusedComponent((Focusable) this); delayedFocus = false; } else { delayedFocus = true; @@ -1310,13 +1310,13 @@ public abstract class AbstractComponent extends AbstractClientConnector * component. */ private void setActionManagerViewer() { - if (actionManager != null && getRoot() != null) { + if (actionManager != null && getUI() != null) { // Attached and has action manager Window w = findAncestor(Window.class); if (w != null) { actionManager.setViewer(w); } else { - actionManager.setViewer(getRoot()); + actionManager.setViewer(getUI()); } } diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index 7406303af9..400dd66cac 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -518,7 +518,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * attached to a UI */ @Override - public UI getRoot(); + public UI getUI(); /** * Gets the application object to which the component is attached. @@ -548,7 +548,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * <p> * Reimplementing the {@code attach()} method is useful for tasks that need * to get a reference to the parent, window, or application object with the - * {@link #getParent()}, {@link #getRoot()}, and {@link #getApplication()} + * {@link #getParent()}, {@link #getUI()}, and {@link #getApplication()} * methods. A component does not yet know these objects in the constructor, * so in such case, the methods will return {@code null}. For example, the * following is invalid: diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java index 3a6e1e4ea8..c7c7bc9784 100644 --- a/server/src/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/com/vaadin/ui/ConnectorTracker.java @@ -244,7 +244,7 @@ public class ConnectorTracker implements Serializable { return null; } if (connector instanceof Component) { - return ((Component) connector).getRoot(); + return ((Component) connector).getUI(); } return getRootForConnector(connector.getParent()); diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java index f127a2705b..1c154699d8 100644 --- a/server/src/com/vaadin/ui/LoginForm.java +++ b/server/src/com/vaadin/ui/LoginForm.java @@ -100,7 +100,7 @@ public class LoginForm extends CustomComponent { String requestPathInfo = request.getRequestPathInfo(); if ("/loginHandler".equals(requestPathInfo)) { // Ensure UI.getCurrent() works in listeners - UI.setCurrent(getRoot()); + UI.setCurrent(getUI()); response.setCacheTime(-1); response.setContentType("text/html; charset=utf-8"); diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index 957e00385d..c0b3ed9929 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -515,10 +515,10 @@ public abstract class UI extends AbstractComponentContainer implements * * @return this UI * - * @see com.vaadin.ui.AbstractComponent#getRoot() + * @see com.vaadin.ui.AbstractComponent#getUI() */ @Override - public UI getRoot() { + public UI getUI() { return this; } @@ -543,9 +543,9 @@ public abstract class UI extends AbstractComponentContainer implements if (pendingFocus != null) { // ensure focused component is still attached to this main window - if (pendingFocus.getRoot() == this - || (pendingFocus.getRoot() != null && pendingFocus - .getRoot().getParent() == this)) { + if (pendingFocus.getUI() == this + || (pendingFocus.getUI() != null && pendingFocus + .getUI().getParent() == this)) { target.addAttribute("focused", pendingFocus); } pendingFocus = null; @@ -804,7 +804,7 @@ public abstract class UI extends AbstractComponentContainer implements */ public void scrollIntoView(Component component) throws IllegalArgumentException { - if (component.getRoot() != this) { + if (component.getUI() != this) { throw new IllegalArgumentException( "The component where to scroll must belong to this UI."); } diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index 335f7fd67d..ad2bbd0576 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -222,7 +222,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * </p> */ public void close() { - UI uI = getRoot(); + UI uI = getUI(); // Don't do anything if not attached to a root if (uI != null) { @@ -476,7 +476,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * <p> */ public void bringToFront() { - UI uI = getRoot(); + UI uI = getUI(); if (uI == null) { throw new IllegalStateException( "Window must be attached to parent before calling bringToFront method."); |