From c468f4b16cf79910449a5f0b8e5d030d2e128c4b Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 3 Apr 2012 00:39:22 +0300 Subject: [PATCH] Removed unused createState() from client side --- .../client/ui/AbstractComponentConnector.java | 25 +------------------ .../gwt/client/ui/AbstractFieldConnector.java | 7 ------ .../ui/AbstractSplitPanelConnector.java | 6 ----- .../gwt/client/ui/ButtonConnector.java | 5 ---- .../terminal/gwt/client/ui/FormConnector.java | 6 ----- .../gwt/client/ui/NativeButtonConnector.java | 5 ---- .../gwt/client/ui/PanelConnector.java | 5 ---- .../gwt/client/ui/TableConnector.java | 6 ----- .../terminal/gwt/client/ui/TreeConnector.java | 6 ----- .../gwt/client/ui/WindowConnector.java | 5 ---- 10 files changed, 1 insertion(+), 75 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java index 78a6ce889b..91c7fe3299 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java @@ -5,7 +5,6 @@ package com.vaadin.terminal.gwt.client.ui; import java.util.Set; -import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.ui.FocusWidget; import com.google.gwt.user.client.ui.Focusable; import com.google.gwt.user.client.ui.Widget; @@ -76,10 +75,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector } /** - * Returns the shared state object for a paintable widget. - * - * A new state instance is created using {@link #createState()} if none has - * been set by the server. + * Returns the shared state object for this connector. * * If overriding this method to return a more specific type, also * {@link #createState()} must be overridden. @@ -87,28 +83,9 @@ public abstract class AbstractComponentConnector extends AbstractConnector * @return current shared state (not null) */ public ComponentState getState() { - if (state == null) { - state = createState(); - } - return state; } - /** - * Creates a new instance of a shared state object for the widget. Normally, - * the state instance is created by the server and sent to the client before - * being used - this method is used if no shared state has been sent by the - * server. - * - * When overriding {@link #getState()}, also {@link #createState()} should - * be overridden to match it. - * - * @return newly created component shared state instance - */ - protected ComponentState createState() { - return GWT.create(ComponentState.class); - } - public static boolean isRealUpdate(UIDL uidl) { return !uidl.hasAttribute("cached"); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractFieldConnector.java index 76f23c761a..5e629f2dc9 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractFieldConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractFieldConnector.java @@ -3,9 +3,7 @@ */ package com.vaadin.terminal.gwt.client.ui; -import com.google.gwt.core.client.GWT; import com.vaadin.terminal.gwt.client.AbstractFieldState; -import com.vaadin.terminal.gwt.client.ComponentState; public abstract class AbstractFieldConnector extends AbstractComponentConnector { @@ -14,11 +12,6 @@ public abstract class AbstractFieldConnector extends AbstractComponentConnector return (AbstractFieldState) super.getState(); } - @Override - protected ComponentState createState() { - return GWT.create(AbstractFieldState.class); - } - @Override public boolean isReadOnly() { return super.isReadOnly() || getState().isPropertyReadOnly(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractSplitPanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractSplitPanelConnector.java index 827490524a..dbf16f5b97 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractSplitPanelConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractSplitPanelConnector.java @@ -5,7 +5,6 @@ package com.vaadin.terminal.gwt.client.ui; import java.util.LinkedList; -import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.event.dom.client.DomEvent; import com.google.gwt.event.dom.client.DomEvent.Type; @@ -252,11 +251,6 @@ public abstract class AbstractSplitPanelConnector extends return (AbstractSplitPanelState) super.getState(); } - @Override - protected AbstractSplitPanelState createState() { - return GWT.create(AbstractSplitPanelState.class); - } - private ComponentConnector getFirstChild() { return (ComponentConnector) getState().getFirstChild(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java b/src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java index 07d62a10e7..4ad7804709 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java @@ -8,7 +8,6 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.ComponentState; import com.vaadin.terminal.gwt.client.EventHelper; import com.vaadin.terminal.gwt.client.MouseEventDetails; import com.vaadin.terminal.gwt.client.UIDL; @@ -124,8 +123,4 @@ public class ButtonConnector extends AbstractComponentConnector { return (ButtonState) super.getState(); } - @Override - protected ComponentState createState() { - return GWT.create(ButtonState.class); - } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java b/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java index 5ed86fce6d..bf2e31d057 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java @@ -10,7 +10,6 @@ import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.AbstractFieldState; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.ComponentConnector; -import com.vaadin.terminal.gwt.client.ComponentState; import com.vaadin.terminal.gwt.client.ConnectorMap; import com.vaadin.terminal.gwt.client.LayoutManager; import com.vaadin.terminal.gwt.client.UIDL; @@ -192,9 +191,4 @@ public class FormConnector extends AbstractComponentContainerConnector return (AbstractFieldState) super.getState(); } - @Override - protected ComponentState createState() { - return GWT.create(AbstractFieldState.class); - } - } diff --git a/src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java b/src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java index 144b5eb391..44da878884 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java @@ -7,7 +7,6 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.ComponentState; import com.vaadin.terminal.gwt.client.EventHelper; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.communication.RpcProxy; @@ -103,8 +102,4 @@ public class NativeButtonConnector extends AbstractComponentConnector { return (ButtonState) super.getState(); } - @Override - protected ComponentState createState() { - return GWT.create(ButtonState.class); - } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java index 89219f5be8..815af10480 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java @@ -249,11 +249,6 @@ public class PanelConnector extends AbstractComponentContainerConnector return (PanelState) super.getState(); } - @Override - protected PanelState createState() { - return GWT.create(PanelState.class); - } - @Override public void connectorHierarchyChanged(ConnectorHierarchyChangedEvent event) { super.connectorHierarchyChanged(event); diff --git a/src/com/vaadin/terminal/gwt/client/ui/TableConnector.java b/src/com/vaadin/terminal/gwt/client/ui/TableConnector.java index 14231c3504..8cda749fb9 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/TableConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/TableConnector.java @@ -14,7 +14,6 @@ import com.vaadin.terminal.gwt.client.AbstractFieldState; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.ComponentConnector; -import com.vaadin.terminal.gwt.client.ComponentState; import com.vaadin.terminal.gwt.client.DirectionalManagedLayout; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; @@ -294,11 +293,6 @@ public class TableConnector extends AbstractComponentContainerConnector return (AbstractFieldState) super.getState(); } - @Override - protected ComponentState createState() { - return GWT.create(AbstractFieldState.class); - } - /** * Shows a saved row context menu if the row for the context menu is still * visible. Does nothing if a context menu has not been saved. diff --git a/src/com/vaadin/terminal/gwt/client/ui/TreeConnector.java b/src/com/vaadin/terminal/gwt/client/ui/TreeConnector.java index dce88ff5ec..f0b07e9125 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/TreeConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/TreeConnector.java @@ -9,7 +9,6 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.AbstractFieldState; import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.ComponentState; import com.vaadin.terminal.gwt.client.TooltipInfo; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.ui.VTree.TreeNode; @@ -250,9 +249,4 @@ public class TreeConnector extends AbstractComponentConnector { return (AbstractFieldState) super.getState(); } - @Override - protected ComponentState createState() { - return GWT.create(AbstractFieldState.class); - } - } diff --git a/src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java b/src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java index 811b00d929..f080ced3fa 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java @@ -321,11 +321,6 @@ public class WindowConnector extends AbstractComponentContainerConnector return (WindowState) super.getState(); } - @Override - protected WindowState createState() { - return GWT.create(WindowState.class); - } - /** * Gives the WindowConnector an order number. As a side effect, moves the * window according to its order number so the windows are stacked. This -- 2.39.5