From: Johannes Dahlström Date: Thu, 26 Jul 2012 14:08:10 +0000 (+0300) Subject: Revert root cleanup changes - this commit was not supposed to go to master X-Git-Tag: 7.0.0.beta1~236^2~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a26f6d702c2eeb72d3045d5b95712f58bc08d116;p=vaadin-framework.git Revert root cleanup changes - this commit was not supposed to go to master This reverts commit 25f664f993a1eb936cb516f1b748773b9b4d5239. --- diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java index 79480f8dab..468a7ee8be 100644 --- a/src/com/vaadin/Application.java +++ b/src/com/vaadin/Application.java @@ -1066,7 +1066,6 @@ public class Application implements Terminal.ErrorListener, Serializable { * @see com.vaadin.terminal.Terminal.ErrorListener#terminalError(com.vaadin.terminal.Terminal.ErrorEvent) */ - @Override public void terminalError(Terminal.ErrorEvent event) { final Throwable t = event.getThrowable(); if (t instanceof SocketException) { @@ -1811,7 +1810,6 @@ public class Application implements Terminal.ErrorListener, Serializable { this.throwable = throwable; } - @Override public Throwable getThrowable() { return throwable; } @@ -2190,14 +2188,11 @@ public class Application implements Terminal.ErrorListener, Serializable { */ public Root getRootForRequest(WrappedRequest request) throws RootRequiresMoreInformationException { - System.out.println(" --- GET ROOT"); Root root = Root.getCurrent(); if (root != null) { - System.out.println(" ----- HAS CURRENT " + root.getRootId()); return root; } Integer rootId = getRootId(request); - System.out.println(" ----- ROOT ID FROM REQUEST " + rootId); synchronized (this) { BrowserDetails browserDetails = request.getBrowserDetails(); @@ -2207,7 +2202,6 @@ public class Application implements Terminal.ErrorListener, Serializable { root = roots.get(rootId); if (root == null && isRootPreserved()) { - System.out.println(" ----- ROOT NOT FOUND, CHECK IF PRESERVED"); // Check for a known root if (!retainOnRefreshRoots.isEmpty()) { @@ -2220,9 +2214,6 @@ public class Application implements Terminal.ErrorListener, Serializable { } if (retainedRootId != null) { - System.out.println(" ----- RETAINED ROOT ID " - + retainedRootId); - rootId = retainedRootId; root = roots.get(rootId); } @@ -2230,13 +2221,9 @@ public class Application implements Terminal.ErrorListener, Serializable { } if (root == null) { - System.out.println(" ----- ROOT STILL NULL"); - // Throws exception if root can not yet be created root = getRoot(request); - System.out.println(" ----- GET ROOT " + root.getRootId()); - // Initialize some fields for a newly created root if (root.getApplication() == null) { root.setApplication(this); @@ -2249,7 +2236,6 @@ public class Application implements Terminal.ErrorListener, Serializable { } root.setRootId(rootId.intValue()); roots.put(rootId, root); - System.out.println(" ----- CREATED ROOT " + rootId); } } @@ -2257,8 +2243,6 @@ public class Application implements Terminal.ErrorListener, Serializable { Root.setCurrent(root); if (!initedRoots.contains(rootId)) { - System.out.println(" ----- INIT ROOT " + rootId); - boolean initRequiresBrowserDetails = isRootPreserved() || !root.getClass() .isAnnotationPresent(EagerInit.class); @@ -2279,7 +2263,6 @@ public class Application implements Terminal.ErrorListener, Serializable { } } // end synchronized block - System.out.println(" ----- USING ROOT " + root.getRootId()); return root; } @@ -2404,10 +2387,4 @@ public class Application implements Terminal.ErrorListener, Serializable { public Root getRootById(int rootId) { return roots.get(rootId); } - - public void removeRoot(int rootId) { - System.out.println(" --- REMOVE ROOT ID " + rootId); - System.out.println(" ----- EXISTS? " + roots.containsKey(rootId)); - roots.remove(rootId); - } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java b/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java index 0ab27e92c1..2371fb1140 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java @@ -11,8 +11,6 @@ import com.google.gwt.core.client.Scheduler; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Position; -import com.google.gwt.event.logical.shared.CloseEvent; -import com.google.gwt.event.logical.shared.CloseHandler; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; @@ -53,7 +51,6 @@ public class RootConnector extends AbstractComponentContainerConnector private HandlerRegistration childStateChangeHandlerRegistration; private final StateChangeHandler childStateChangeHandler = new StateChangeHandler() { - @Override public void onStateChanged(StateChangeEvent stateChangeEvent) { // TODO Should use a more specific handler that only reacts to // size changes @@ -65,14 +62,12 @@ public class RootConnector extends AbstractComponentContainerConnector protected void init() { super.init(); registerRpc(PageClientRpc.class, new PageClientRpc() { - @Override public void setTitle(String title) { com.google.gwt.user.client.Window.setTitle(title); } }); } - @Override public void updateFromUIDL(final UIDL uidl, ApplicationConnection client) { ConnectorMap paintableMap = ConnectorMap.get(getConnection()); getWidget().rendering = true; @@ -123,7 +118,6 @@ public class RootConnector extends AbstractComponentContainerConnector // to finish rendering this window in case this is a download // (and window stays open). Scheduler.get().scheduleDeferred(new Command() { - @Override public void execute() { VRoot.goTo(url); } @@ -188,7 +182,6 @@ public class RootConnector extends AbstractComponentContainerConnector if (uidl.hasAttribute("focused")) { // set focused component when render phase is finished Scheduler.get().scheduleDeferred(new Command() { - @Override public void execute() { ComponentConnector paintable = (ComponentConnector) uidl .getPaintableAttribute("focused", getConnection()); @@ -281,13 +274,6 @@ public class RootConnector extends AbstractComponentContainerConnector root.add(getWidget()); - Window.addCloseHandler(new CloseHandler() { - @Override - public void onClose(CloseEvent event) { - rpc.close(); - } - }); - if (applicationConnection.getConfiguration().isStandalone()) { // set focus to iview element by default to listen possible keyboard // shortcuts. For embedded applications this is unacceptable as we @@ -307,7 +293,6 @@ public class RootConnector extends AbstractComponentContainerConnector }; - @Override public void updateCaption(ComponentConnector component) { // NOP The main view never draws caption for its layout } @@ -427,7 +412,6 @@ public class RootConnector extends AbstractComponentContainerConnector } Scheduler.get().scheduleDeferred(new Command() { - @Override public void execute() { componentConnector.getWidget().getElement().scrollIntoView(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/root/RootServerRpc.java b/src/com/vaadin/terminal/gwt/client/ui/root/RootServerRpc.java index 066645d130..389500949d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/root/RootServerRpc.java +++ b/src/com/vaadin/terminal/gwt/client/ui/root/RootServerRpc.java @@ -8,5 +8,4 @@ import com.vaadin.terminal.gwt.client.ui.ClickRpc; public interface RootServerRpc extends ClickRpc, ServerRpc { - public void close(); } \ No newline at end of file diff --git a/src/com/vaadin/ui/Root.java b/src/com/vaadin/ui/Root.java index 23f491949f..9271097a46 100644 --- a/src/com/vaadin/ui/Root.java +++ b/src/com/vaadin/ui/Root.java @@ -419,16 +419,9 @@ public abstract class Root extends AbstractComponentContainer implements 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 close() { - System.out.println(" --- ROOT CLOSE RPC " + rootId); - getApplication().removeRoot(rootId); - } }; /** @@ -509,7 +502,6 @@ public abstract class Root extends AbstractComponentContainer implements return this; } - @Override public void replaceComponent(Component oldComponent, Component newComponent) { throw new UnsupportedOperationException(); } @@ -519,7 +511,6 @@ public abstract class Root extends AbstractComponentContainer implements return application; } - @Override public void paintContent(PaintTarget target) throws PaintException { page.paintContent(target); @@ -559,7 +550,6 @@ public abstract class Root extends AbstractComponentContainer implements fireEvent(new ClickEvent(this, mouseDetails)); } - @Override @SuppressWarnings("unchecked") public void changeVariables(Object source, Map variables) { if (variables.containsKey(CLICK_EVENT_ID)) { @@ -588,7 +578,6 @@ public abstract class Root extends AbstractComponentContainer implements * * @see com.vaadin.ui.ComponentContainer#getComponentIterator() */ - @Override public Iterator getComponentIterator() { // TODO could directly create some kind of combined iterator instead of // creating a new ArrayList @@ -608,7 +597,6 @@ public abstract class Root extends AbstractComponentContainer implements * * @see com.vaadin.ui.ComponentContainer#getComponentCount() */ - @Override public int getComponentCount() { return windows.size() + (getContent() == null ? 0 : 1); } @@ -968,13 +956,11 @@ public abstract class Root extends AbstractComponentContainer implements return actionManager; } - @Override public void addAction( T action) { getActionManager().addAction(action); } - @Override public void removeAction( T action) { if (actionManager != null) { @@ -982,12 +968,10 @@ public abstract class Root extends AbstractComponentContainer implements } } - @Override public void addActionHandler(Handler actionHandler) { getActionManager().addActionHandler(actionHandler); } - @Override public void removeActionHandler(Handler actionHandler) { if (actionManager != null) { actionManager.removeActionHandler(actionHandler);