]> source.dussan.org Git - vaadin-framework.git/commitdiff
Removed unnecessary updateFromUidl calls from containers
authorArtur Signell <artur@vaadin.com>
Tue, 3 Apr 2012 08:20:11 +0000 (11:20 +0300)
committerArtur Signell <artur@vaadin.com>
Wed, 4 Apr 2012 21:08:46 +0000 (00:08 +0300)
13 files changed:
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
src/com/vaadin/terminal/gwt/client/ServerConnector.java
src/com/vaadin/terminal/gwt/client/ui/CustomLayoutConnector.java
src/com/vaadin/terminal/gwt/client/ui/FormConnector.java
src/com/vaadin/terminal/gwt/client/ui/RootConnector.java
src/com/vaadin/terminal/gwt/client/ui/VAccordion.java
src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java
src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java
src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
src/com/vaadin/terminal/gwt/client/ui/VPopupView.java
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java

index 854755743b41465d29b2324a56f970f99df05d62..640e362e32ddbb1ac3a6fff481060f2b558e1f23 100644 (file)
@@ -1212,10 +1212,11 @@ public class ApplicationConnection {
                         final UIDL uidl = change.getChildUIDL(0);
                         String connectorId = uidl.getId();
 
-                        final ComponentConnector paintable = (ComponentConnector) connectorMap
+                        final ComponentConnector legacyConnector = (ComponentConnector) connectorMap
                                 .getConnector(connectorId);
-                        if (paintable != null) {
-                            paintable.updateFromUIDL(uidl,
+                        if (legacyConnector != null
+                                && legacyConnector instanceof Paintable) {
+                            ((Paintable) legacyConnector).updateFromUIDL(uidl,
                                     ApplicationConnection.this);
                         } else {
                             VConsole.error("Received update for "
index 246a132c341358e253ff77f075b71f92a29b0b34..3aab3f8454f69f36f78f92f679dd6c926c27d9e0 100644 (file)
@@ -20,14 +20,8 @@ import com.vaadin.terminal.gwt.client.communication.StateChangeEvent.StateChange
  * @version @VERSION@
  * @since 7.0.0
  */
-public interface ServerConnector extends Connector {
-    /**
-     * TODO
-     * 
-     * @param uidl
-     * @param client
-     */
-    public void updateFromUIDL(UIDL uidl, ApplicationConnection client);
+// TODO Remove "implements Paintable"
+public interface ServerConnector extends Connector, Paintable {
 
     /**
      * Sets a new state for the connector.
index 089245b392a18cc03f29b1b0b1de58b9428d21ef..e9555989e3a2550ad6d22a088d4ba172181b2c0e 100644 (file)
@@ -56,7 +56,6 @@ public class CustomLayoutConnector extends AbstractComponentContainerConnector
                 Widget childWidget = childPaintable.getWidget();
                 try {
                     getWidget().setWidget(childWidget, location);
-                    childPaintable.updateFromUIDL(childUIDL, client);
                 } catch (final IllegalArgumentException e) {
                     // If no location is found, this component is not visible
                 }
index bf2e31d057b1ad9aa2bc6ede1ae585d5062e49a6..20c19d4a231683d09c0d191a6ba40602ade14f90 100644 (file)
@@ -106,7 +106,6 @@ public class FormConnector extends AbstractComponentContainerConnector
                         getWidget().footerContainer);
             }
             getWidget().footer = newFooterWidget;
-            newFooter.updateFromUIDL(uidl.getChildUIDL(1), client);
         } else {
             if (getWidget().footer != null) {
                 getWidget().remove(getWidget().footer);
@@ -130,7 +129,6 @@ public class FormConnector extends AbstractComponentContainerConnector
             getWidget().lo = newLayoutWidget;
             getWidget().add(newLayoutWidget, getWidget().fieldContainer);
         }
-        newLayout.updateFromUIDL(layoutUidl, client);
 
         // also recalculates size of the footer if undefined size form - see
         // #3710
index cfad231424b4c3e79716a66b7c19c23f397011eb..fc63eb4862e96d13dd1144f432e60652bd93af8f 100644 (file)
@@ -186,8 +186,6 @@ public class RootConnector extends AbstractComponentContainerConnector {
             }
         }
 
-        getWidget().layout.updateFromUIDL(childUidl, client);
-
         // Save currently open subwindows to track which will need to be closed
         final HashSet<VWindow> removedSubWindows = new HashSet<VWindow>(
                 getWidget().subWindows);
index c4965220949580902af8b9f955a59970dfae851e..9d71f4645dc0131a5530e0c71f6855e1bace29b6 100644 (file)
@@ -417,7 +417,6 @@ public class VAccordion extends VTabsheetBase {
             } else if (getChildWidget() != newWidget) {
                 replaceWidget(newWidget);
             }
-            newPntbl.updateFromUIDL(contentUidl, client);
             if (contentUidl.getBooleanAttribute("cached")) {
                 /*
                  * The size of a cached, relative sized component must be
index 02d7ab9d5b1d8df4f41c2e26ff64c32888cd0465..b32ea7b88d4f201e793b54abd05de6553770066a 100644 (file)
@@ -112,9 +112,6 @@ public class VCssLayout extends SimplePanel {
                     }
                 }
 
-                if (!r.getBooleanAttribute("cached")) {
-                    child.updateFromUIDL(r, client);
-                }
             }
 
             // loop oldWidgetWrappers that where not re-attached and unregister
index 1d7b053925a71ec88509f20a1108694aa26b4e37..7188869af16a57889602083292bcf9ead7ed7255 100644 (file)
@@ -140,8 +140,6 @@ public class VFormLayout extends SimplePanel {
                         CLASSNAME + "-errorcell");
                 setWidget(i, COLUMN_ERRORFLAG, error);
 
-                childPaintable.updateFromUIDL(childUidl, client);
-
                 String rowstyles = CLASSNAME + "-row";
                 if (i == 0) {
                     rowstyles += " " + CLASSNAME + "-firstrow";
index 24515385115ea507b21446dba48911395d18ccf3..7baf4c101aa0050ebc7740c66b3d3b0df8237e85 100644 (file)
@@ -570,7 +570,6 @@ public class VGridLayout extends ComplexPanel {
                     }
                 }
 
-                childConnector.updateFromUIDL(childUidl, client);
             }
         }
 
index e5fb3d36c0fbb443449e1b83748dc6eba77d30cb..e6ca747b7c0b3982f4dd9bed73ee2780682f528c 100644 (file)
@@ -299,8 +299,6 @@ public class VPopupView extends HTML {
                 popupComponentPaintable = newPopupComponent;
             }
 
-            popupComponentPaintable
-                    .updateFromUIDL(uidl.getChildUIDL(0), client);
         }
 
         public void unregisterPaintables() {
index 3ef5e07f533f2d56a1d01f4c120aa937e94c0450..b372ad7e13b50642c30c9350f97d04e4d20c31f8 100644 (file)
@@ -4364,7 +4364,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
             protected ArrayList<Widget> childWidgets = new ArrayList<Widget>();
             private boolean selected = false;
             protected final int rowKey;
-            private List<UIDL> pendingComponentPaints;
 
             private String[] actionKeys = null;
             private final TableRowElement rowElement;
@@ -4491,7 +4490,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
 
                         addCell(uidl, cellContent.getWidget(), aligns[col++],
                                 style, sorted);
-                        paintComponent(cellContent, (UIDL) cell);
                     }
                 }
             }
@@ -4564,30 +4562,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
                 return index;
             }
 
-            protected void paintComponent(ComponentConnector p, UIDL uidl) {
-                if (isAttached()) {
-                    p.updateFromUIDL(uidl, client);
-                } else {
-                    if (pendingComponentPaints == null) {
-                        pendingComponentPaints = new LinkedList<UIDL>();
-                    }
-                    pendingComponentPaints.add(uidl);
-                }
-            }
-
-            @Override
-            protected void onAttach() {
-                super.onAttach();
-                if (pendingComponentPaints != null) {
-                    for (UIDL uidl : pendingComponentPaints) {
-                        ComponentConnector paintable = (ComponentConnector) ConnectorMap
-                                .get(client).getConnector(uidl.getId());
-                        paintable.updateFromUIDL(uidl, client);
-                    }
-                    pendingComponentPaints.clear();
-                }
-            }
-
             @Override
             protected void onDetach() {
                 super.onDetach();
index ffef5825f4dd7359ce10c14a9b5389fc98008100..027f7975d3d513515eef1afcc2ba655106c35e5e 100644 (file)
@@ -866,7 +866,6 @@ public class VTabsheet extends VTabsheetBase implements Focusable,
                 if (tp.getWidgetIndex(tabContentWidget) < 0) {
                     tp.insert(tabContentWidget, index);
                 }
-                tabContentPaintable.updateFromUIDL(tabContentUIDL, client);
             } else if (tp.getWidgetCount() <= index) {
                 tp.add(new PlaceHolder());
             }
@@ -909,7 +908,6 @@ public class VTabsheet extends VTabsheetBase implements Focusable,
         tp.showWidget(activeTabIndex);
 
         VTabsheet.this.iLayout();
-        content.updateFromUIDL(contentUIDL, client);
         /*
          * The size of a cached, relative sized component must be updated to
          * report correct size to updateOpenTabSize().
index 4b5394fa2a6643883da90c277118be4225354434..6647d89c63a7cb343123eca2a210725b1d9f7c36 100644 (file)
@@ -208,8 +208,6 @@ public class WindowConnector extends AbstractComponentContainerConnector
             getWidget().layout = lo;
         }
 
-        getWidget().layout.updateFromUIDL(childUidl, client);
-
         // we may have actions and notifications
         if (uidl.getChildCount() > 1) {
             final int cnt = uidl.getChildCount();