]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8434 Renamed *Paintable classes to *Connector and updated ConnectorMap
authorArtur Signell <artur@vaadin.com>
Mon, 27 Feb 2012 14:21:28 +0000 (16:21 +0200)
committerArtur Signell <artur@vaadin.com>
Mon, 27 Feb 2012 14:21:50 +0000 (16:21 +0200)
accordingly

116 files changed:
src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
src/com/vaadin/terminal/gwt/client/ComponentConnector.java [new file with mode: 0644]
src/com/vaadin/terminal/gwt/client/ComponentContainerConnector.java [new file with mode: 0644]
src/com/vaadin/terminal/gwt/client/ComponentLocator.java
src/com/vaadin/terminal/gwt/client/Connector.java [new file with mode: 0644]
src/com/vaadin/terminal/gwt/client/ConnectorMap.java [new file with mode: 0644]
src/com/vaadin/terminal/gwt/client/Console.java
src/com/vaadin/terminal/gwt/client/EventHelper.java
src/com/vaadin/terminal/gwt/client/LayoutManager.java
src/com/vaadin/terminal/gwt/client/NullConsole.java
src/com/vaadin/terminal/gwt/client/UIDL.java
src/com/vaadin/terminal/gwt/client/Util.java
src/com/vaadin/terminal/gwt/client/VCaption.java
src/com/vaadin/terminal/gwt/client/VCaptionWrapper.java
src/com/vaadin/terminal/gwt/client/VConsole.java
src/com/vaadin/terminal/gwt/client/VDebugConsole.java
src/com/vaadin/terminal/gwt/client/VPaintable.java [deleted file]
src/com/vaadin/terminal/gwt/client/VPaintableMap.java [deleted file]
src/com/vaadin/terminal/gwt/client/VPaintableWidget.java [deleted file]
src/com/vaadin/terminal/gwt/client/VPaintableWidgetContainer.java [deleted file]
src/com/vaadin/terminal/gwt/client/VTooltip.java
src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java
src/com/vaadin/terminal/gwt/client/WidgetInstantiator.java
src/com/vaadin/terminal/gwt/client/WidgetMap.java
src/com/vaadin/terminal/gwt/client/WidgetSet.java
src/com/vaadin/terminal/gwt/client/communication/ClientToServerRpc.java
src/com/vaadin/terminal/gwt/client/communication/JsonDecoder.java
src/com/vaadin/terminal/gwt/client/communication/JsonEncoder.java
src/com/vaadin/terminal/gwt/client/communication/SharedState.java
src/com/vaadin/terminal/gwt/client/communication/VaadinSerializer.java
src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java [new file with mode: 0644]
src/com/vaadin/terminal/gwt/client/ui/AbstractComponentContainerConnector.java [new file with mode: 0644]
src/com/vaadin/terminal/gwt/client/ui/ClickEventHandler.java
src/com/vaadin/terminal/gwt/client/ui/LayoutClickEventHandler.java
src/com/vaadin/terminal/gwt/client/ui/ManagedLayout.java
src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java
src/com/vaadin/terminal/gwt/client/ui/Table.java
src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java
src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayoutPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidget.java [deleted file]
src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidgetContainer.java [deleted file]
src/com/vaadin/terminal/gwt/client/ui/VAbstractSplitPanelPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VAccordion.java
src/com/vaadin/terminal/gwt/client/ui/VAccordionPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VButtonPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VCheckBoxPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java
src/com/vaadin/terminal/gwt/client/ui/VCssLayoutPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VCustomComponentPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VCustomLayout.java
src/com/vaadin/terminal/gwt/client/ui/VCustomLayoutPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VDateFieldPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java
src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java
src/com/vaadin/terminal/gwt/client/ui/VEmbeddedPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java
src/com/vaadin/terminal/gwt/client/ui/VFilterSelectPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java
src/com/vaadin/terminal/gwt/client/ui/VFormLayoutPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VFormPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
src/com/vaadin/terminal/gwt/client/ui/VGridLayoutPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VLinkPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VMediaBasePaintable.java
src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java
src/com/vaadin/terminal/gwt/client/ui/VMenuBarPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VNativeButtonPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VNotification.java
src/com/vaadin/terminal/gwt/client/ui/VOptionGroupBasePaintable.java
src/com/vaadin/terminal/gwt/client/ui/VPanel.java
src/com/vaadin/terminal/gwt/client/ui/VPanelPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VPopupView.java
src/com/vaadin/terminal/gwt/client/ui/VPopupViewPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VProgressIndicatorPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
src/com/vaadin/terminal/gwt/client/ui/VScrollTablePaintable.java
src/com/vaadin/terminal/gwt/client/ui/VSliderPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
src/com/vaadin/terminal/gwt/client/ui/VTabsheetBase.java
src/com/vaadin/terminal/gwt/client/ui/VTabsheetBasePaintable.java
src/com/vaadin/terminal/gwt/client/ui/VTabsheetPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VTextFieldPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VTree.java
src/com/vaadin/terminal/gwt/client/ui/VTreePaintable.java
src/com/vaadin/terminal/gwt/client/ui/VUnknownComponentPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VUploadPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VView.java
src/com/vaadin/terminal/gwt/client/ui/VViewPaintable.java
src/com/vaadin/terminal/gwt/client/ui/VWindow.java
src/com/vaadin/terminal/gwt/client/ui/VWindowPaintable.java
src/com/vaadin/terminal/gwt/client/ui/dd/VAbstractDropHandler.java
src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java
src/com/vaadin/terminal/gwt/client/ui/dd/VDragSourceIs.java
src/com/vaadin/terminal/gwt/client/ui/dd/VDropHandler.java
src/com/vaadin/terminal/gwt/client/ui/dd/VHasDropHandler.java
src/com/vaadin/terminal/gwt/client/ui/dd/VIsOverId.java
src/com/vaadin/terminal/gwt/client/ui/dd/VItemIdIs.java
src/com/vaadin/terminal/gwt/client/ui/dd/VSourceIsTarget.java
src/com/vaadin/terminal/gwt/client/ui/dd/VTransferable.java
src/com/vaadin/terminal/gwt/client/ui/label/VLabelPaintable.java
src/com/vaadin/terminal/gwt/client/ui/layout/VPaintableLayoutSlot.java
src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java
src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextAreaPaintable.java
src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
src/com/vaadin/terminal/gwt/widgetsetutils/SerializerGenerator.java
src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java
src/com/vaadin/ui/AbstractComponent.java
src/com/vaadin/ui/AbstractField.java
src/com/vaadin/ui/ClientWidget.java
src/com/vaadin/ui/Select.java
src/com/vaadin/ui/TabSheet.java
tests/testbench/com/vaadin/tests/dd/VMyDragSourcePaintable.java
tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java
tests/testbench/com/vaadin/tests/dd/VMyDropTargetPaintable.java

index f9be8bf0193c37cf03c7132ee5dfc1fc9fa8bc16..d98e33aca436a8c884d739aff0aaf78f10a7cb0c 100644 (file)
@@ -206,7 +206,7 @@ public class ApplicationConfiguration implements EntryPoint {
 
     private HashMap<String, String> unknownComponents;
 
-    private Class<? extends VPaintableWidget>[] classes = new Class[1024];
+    private Class<? extends ComponentConnector>[] classes = new Class[1024];
 
     private String windowId;
 
@@ -381,7 +381,7 @@ public class ApplicationConfiguration implements EntryPoint {
         return useDebugIdInDom;
     }
 
-    public Class<? extends VPaintableWidget> getWidgetClassByEncodedTag(
+    public Class<? extends ComponentConnector> getWidgetClassByEncodedTag(
             String tag) {
         try {
             int parseInt = Integer.parseInt(tag);
@@ -484,7 +484,7 @@ public class ApplicationConfiguration implements EntryPoint {
         public void run() {
             pending = false;
             if (!isBusy()) {
-                Class<? extends VPaintableWidget> nextType = getNextType();
+                Class<? extends ComponentConnector> nextType = getNextType();
                 if (nextType == null) {
                     // ensured that all widgets are loaded
                     deferredWidgetLoader = null;
@@ -497,8 +497,8 @@ public class ApplicationConfiguration implements EntryPoint {
             }
         }
 
-        private Class<? extends VPaintableWidget> getNextType() {
-            Class<? extends VPaintableWidget>[] deferredLoadedWidgets = widgetSet
+        private Class<? extends ComponentConnector> getNextType() {
+            Class<? extends ComponentConnector>[] deferredLoadedWidgets = widgetSet
                     .getDeferredLoadedWidgets();
             if (deferredLoadedWidgets.length <= nextWidgetIndex) {
                 return null;
index dc65ab0e228d57192c9d9d291d1495ff9b2fc1f1..ccfab49ef893fd8aefd9839943b0e3ef6f522c56 100644 (file)
@@ -56,7 +56,7 @@ import com.vaadin.terminal.gwt.server.AbstractCommunicationManager;
  * 
  * Client-side widgets receive updates from the corresponding server-side
  * components as calls to
- * {@link VPaintableWidget#updateFromUIDL(UIDL, ApplicationConnection)} (not to
+ * {@link ComponentConnector#updateFromUIDL(UIDL, ApplicationConnection)} (not to
  * be confused with the server side interface
  * {@link com.vaadin.terminal.Paintable} ). Any client-side changes (typically
  * resulting from user actions) are sent back to the server as variable changes
@@ -163,9 +163,9 @@ public class ApplicationConnection {
 
     private boolean validatingLayouts = false;
 
-    private Set<VPaintableWidget> zeroWidthComponents = null;
+    private Set<ComponentConnector> zeroWidthComponents = null;
 
-    private Set<VPaintableWidget> zeroHeightComponents = null;
+    private Set<ComponentConnector> zeroHeightComponents = null;
 
     private final LayoutManager layoutManager = new LayoutManager(this);
 
@@ -435,9 +435,9 @@ public class ApplicationConnection {
      * 
      * @param paintable
      */
-    void highlightComponent(VPaintableWidget paintable) {
+    void highlightComponent(ComponentConnector paintable) {
         String params = getRepaintAllParameters() + "&highlightComponent="
-                + paintableMap.getPid(paintable);
+                + connectorMap.getConnectorId(paintable);
         makeUidlRequest("", params, false);
     }
 
@@ -812,8 +812,8 @@ public class ApplicationConnection {
     private void cleanVariableBurst(ArrayList<MethodInvocation> variableBurst) {
         for (int i = 1; i < variableBurst.size(); i++) {
             String id = variableBurst.get(i).getPaintableId();
-            if (!getPaintableMap().hasPaintable(id)
-                    && !getPaintableMap().isDragAndDropPaintable(id)) {
+            if (!getConnectorMap().hasConnector(id)
+                    && !getConnectorMap().isDragAndDropPaintable(id)) {
                 // variable owner does not exist anymore
                 variableBurst.remove(i);
                 VConsole.log("Removed variable from removed component: " + id);
@@ -969,11 +969,11 @@ public class ApplicationConnection {
                     if (meta.containsKey("repaintAll")) {
                         repaintAll = true;
                         view.getWidget().clear();
-                        getPaintableMap().clear();
+                        getConnectorMap().clear();
                         if (meta.containsKey("invalidLayouts")) {
                             validatingLayouts = true;
-                            zeroWidthComponents = new HashSet<VPaintableWidget>();
-                            zeroHeightComponents = new HashSet<VPaintableWidget>();
+                            zeroWidthComponents = new HashSet<ComponentConnector>();
+                            zeroHeightComponents = new HashSet<ComponentConnector>();
                         }
                     }
                     if (meta.containsKey("timedRedirect")) {
@@ -1002,7 +1002,7 @@ public class ApplicationConnection {
                 // Process changes
                 JsArray<ValueMap> changes = json.getJSValueMapArray("changes");
 
-                ArrayList<VPaintableWidget> updatedVPaintableWidgets = new ArrayList<VPaintableWidget>();
+                ArrayList<ComponentConnector> updatedVPaintableWidgets = new ArrayList<ComponentConnector>();
                 componentCaptionSizeChanges.clear();
 
                 Duration updateDuration = new Duration();
@@ -1014,7 +1014,7 @@ public class ApplicationConnection {
                     try {
                         final UIDL change = changes.get(i).cast();
                         final UIDL uidl = change.getChildUIDL(0);
-                        VPaintable paintable = paintableMap.getPaintable(uidl
+                        Connector paintable = connectorMap.getConnector(uidl
                                 .getId());
                         if (null == paintable
                                 && !uidl.getTag().equals(
@@ -1033,15 +1033,15 @@ public class ApplicationConnection {
                 for (int i = 0; i < keyArray.length(); i++) {
                     try {
                         String paintableId = keyArray.get(i);
-                        VPaintable paintable = paintableMap
-                                .getPaintable(paintableId);
+                        Connector paintable = connectorMap
+                                .getConnector(paintableId);
                         if (null != paintable) {
 
                             JSONArray stateDataAndType = new JSONArray(
                                     states.getJavaScriptObject(paintableId));
 
                             Object state = JsonDecoder.convertValue(
-                                    stateDataAndType, paintableMap);
+                                    stateDataAndType, connectorMap);
 
                             paintable.setState((SharedState) state);
                         }
@@ -1056,8 +1056,8 @@ public class ApplicationConnection {
                         final UIDL change = changes.get(i).cast();
                         final UIDL uidl = change.getChildUIDL(0);
                         // TODO optimize
-                        final VPaintableWidget paintable = (VPaintableWidget) paintableMap
-                                .getPaintable(uidl.getId());
+                        final ComponentConnector paintable = (ComponentConnector) connectorMap
+                                .getConnector(uidl.getId());
                         if (paintable != null) {
                             paintable.updateFromUIDL(uidl,
                                     ApplicationConnection.this);
@@ -1071,12 +1071,12 @@ public class ApplicationConnection {
                                         + uidl.getId() + ") rendered.");
                             } else {
                                 String pid = uidl.getId();
-                                if (!paintableMap.hasPaintable(pid)) {
-                                    paintableMap.registerPaintable(pid, view);
+                                if (!connectorMap.hasConnector(pid)) {
+                                    connectorMap.registerConnector(pid, view);
                                 }
                                 // VView does not call updateComponent so we
                                 // register any event listeners here
-                                paintableMap.registerEventListenersFromUIDL(
+                                connectorMap.registerEventListenersFromUIDL(
                                         pid, uidl);
 
                                 // Finally allow VView to update itself
@@ -1147,9 +1147,9 @@ public class ApplicationConnection {
                      * idToPaintableDetail is already cleanded at the start of
                      * the changeset handling, bypass cleanup.
                      */
-                    paintableMap.purgeUnregistryBag(false);
+                    connectorMap.purgeUnregistryBag(false);
                 } else {
-                    paintableMap.purgeUnregistryBag(true);
+                    connectorMap.purgeUnregistryBag(true);
                 }
 
                 // TODO build profiling for widget impl loading time
@@ -1159,7 +1159,7 @@ public class ApplicationConnection {
                 VConsole.log(" Processing time was "
                         + String.valueOf(prosessingTime) + "ms for "
                         + jsonText.length() + " characters of JSON");
-                VConsole.log("Referenced paintables: " + paintableMap.size());
+                VConsole.log("Referenced paintables: " + connectorMap.size());
 
                 endRequest();
 
@@ -1283,7 +1283,7 @@ public class ApplicationConnection {
                 for (int i = 0; i < invocation.getParameters().length; ++i) {
                     // TODO non-static encoder? type registration?
                     paramJson.set(i, JsonEncoder.encode(
-                            invocation.getParameters()[i], getPaintableMap()));
+                            invocation.getParameters()[i], getConnectorMap()));
                 }
                 invocationJson.set(3, paramJson);
                 reqJson.set(reqJson.size(), invocationJson);
@@ -1336,7 +1336,7 @@ public class ApplicationConnection {
      *            true if the update is to be sent as soon as possible
      */
     public void updateVariable(String paintableId, String variableName,
-            VPaintable newValue, boolean immediate) {
+            Connector newValue, boolean immediate) {
         addVariableToQueue(paintableId, variableName, newValue, immediate);
     }
 
@@ -1611,7 +1611,7 @@ public class ApplicationConnection {
         while (childWidgets.hasNext()) {
             final Widget child = childWidgets.next();
 
-            if (getPaintableMap().isPaintable(child)) {
+            if (getConnectorMap().isConnector(child)) {
 
                 if (handleComponentRelativeSize(child)) {
                     /*
@@ -1642,7 +1642,7 @@ public class ApplicationConnection {
      * @param child
      * @return true if the child has a relative size
      */
-    private boolean handleComponentRelativeSize(VPaintableWidget paintable) {
+    private boolean handleComponentRelativeSize(ComponentConnector paintable) {
         return false;
     }
 
@@ -1653,7 +1653,7 @@ public class ApplicationConnection {
      * @return true if the child has a relative size
      */
     public boolean handleComponentRelativeSize(Widget widget) {
-        return handleComponentRelativeSize(paintableMap.getPaintable(widget));
+        return handleComponentRelativeSize(connectorMap.getConnector(widget));
 
     }
 
@@ -1669,20 +1669,20 @@ public class ApplicationConnection {
      *            UIDL to create Paintable from.
      * @return Either existing or new Paintable corresponding to UIDL.
      */
-    public VPaintableWidget getPaintable(UIDL uidl) {
+    public ComponentConnector getPaintable(UIDL uidl) {
         final String pid = uidl.getId();
         // the actual content UIDL may be deferred, but it always contains
         // enough information to create a paintable instance
-        if (!paintableMap.hasPaintable(pid)) {
+        if (!connectorMap.hasConnector(pid)) {
             // Create and register a new paintable if no old was found
-            VPaintableWidget p = widgetSet.createWidget(uidl.getTag(),
+            ComponentConnector p = widgetSet.createWidget(uidl.getTag(),
                     configuration);
             p.setConnection(this);
             p.setId(pid);
             p.init();
-            paintableMap.registerPaintable(pid, p);
+            connectorMap.registerConnector(pid, p);
         }
-        return (VPaintableWidget) paintableMap.getPaintable(pid);
+        return (ComponentConnector) connectorMap.getConnector(pid);
     }
 
     /**
@@ -1775,12 +1775,12 @@ public class ApplicationConnection {
      * Updating TooltipInfo is done in updateComponent method.
      * 
      */
-    public TooltipInfo getTooltipTitleInfo(VPaintableWidget titleOwner,
+    public TooltipInfo getTooltipTitleInfo(ComponentConnector titleOwner,
             Object key) {
         if (null == titleOwner) {
             return null;
         }
-        return paintableMap.getTooltipInfo(titleOwner, key);
+        return connectorMap.getTooltipInfo(titleOwner, key);
     }
 
     private final VTooltip tooltip = new VTooltip(this);
@@ -1795,7 +1795,7 @@ public class ApplicationConnection {
      * @param event
      * @param owner
      */
-    public void handleTooltipEvent(Event event, VPaintableWidget owner) {
+    public void handleTooltipEvent(Event event, ComponentConnector owner) {
         tooltip.handleTooltipEvent(event, owner, null);
 
     }
@@ -1813,7 +1813,7 @@ public class ApplicationConnection {
      *            the key for tooltip if this is "additional" tooltip, null for
      *            components "main tooltip"
      */
-    public void handleTooltipEvent(Event event, VPaintableWidget owner,
+    public void handleTooltipEvent(Event event, ComponentConnector owner,
             Object key) {
         tooltip.handleTooltipEvent(event, owner, key);
 
@@ -1843,7 +1843,7 @@ public class ApplicationConnection {
         }
     };
 
-    private VPaintableMap paintableMap = GWT.create(VPaintableMap.class);
+    private ConnectorMap connectorMap = GWT.create(ConnectorMap.class);
 
     /**
      * Components can call this function to run all layout functions. This is
@@ -1883,7 +1883,7 @@ public class ApplicationConnection {
      * this method.
      * <p>
      * Component must also pipe events to
-     * {@link #handleTooltipEvent(Event, VPaintableWidget, Object)} method.
+     * {@link #handleTooltipEvent(Event, ComponentConnector, Object)} method.
      * <p>
      * This method can also be used to deregister tooltips by using null as
      * tooltip
@@ -1893,16 +1893,16 @@ public class ApplicationConnection {
      * @param key
      *            key assosiated with given tooltip. Can be any object. For
      *            example a related dom element. Same key must be given for
-     *            {@link #handleTooltipEvent(Event, VPaintableWidget, Object)}
+     *            {@link #handleTooltipEvent(Event, ComponentConnector, Object)}
      *            method.
      * 
      * @param tooltip
      *            the TooltipInfo object containing details shown in tooltip,
      *            null if deregistering tooltip
      */
-    public void registerTooltip(VPaintableWidget paintable, Object key,
+    public void registerTooltip(ComponentConnector paintable, Object key,
             TooltipInfo tooltip) {
-        paintableMap.registerTooltip(paintable, key, tooltip);
+        connectorMap.registerTooltip(paintable, key, tooltip);
     }
 
     /**
@@ -1926,9 +1926,9 @@ public class ApplicationConnection {
      * @return true if at least one listener has been registered on server side
      *         for the event identified by eventIdentifier.
      */
-    public boolean hasEventListeners(VPaintableWidget paintable,
+    public boolean hasEventListeners(ComponentConnector paintable,
             String eventIdentifier) {
-        return paintableMap.hasEventListeners(paintable, eventIdentifier);
+        return connectorMap.hasEventListeners(paintable, eventIdentifier);
     }
 
     /**
@@ -1972,13 +1972,13 @@ public class ApplicationConnection {
         return uri;
     }
 
-    VPaintableMap getPaintableMap() {
-        return paintableMap;
+    ConnectorMap getConnectorMap() {
+        return connectorMap;
     }
 
     @Deprecated
-    public void unregisterPaintable(VPaintable p) {
-        paintableMap.unregisterPaintable(p);
+    public void unregisterPaintable(Connector p) {
+        connectorMap.unregisterConnector(p);
     }
 
     public VTooltip getVTooltip() {
@@ -1987,24 +1987,24 @@ public class ApplicationConnection {
 
     @Deprecated
     public void handleTooltipEvent(Event event, Widget owner, Object key) {
-        handleTooltipEvent(event, getPaintableMap().getPaintable(owner), key);
+        handleTooltipEvent(event, getConnectorMap().getConnector(owner), key);
 
     }
 
     @Deprecated
     public void handleTooltipEvent(Event event, Widget owner) {
-        handleTooltipEvent(event, getPaintableMap().getPaintable(owner));
+        handleTooltipEvent(event, getConnectorMap().getConnector(owner));
 
     }
 
     @Deprecated
     public void registerTooltip(Widget owner, Object key, TooltipInfo info) {
-        registerTooltip(getPaintableMap().getPaintable(owner), key, info);
+        registerTooltip(getConnectorMap().getConnector(owner), key, info);
     }
 
     @Deprecated
     public boolean hasEventListeners(Widget widget, String eventIdentifier) {
-        return hasEventListeners(getPaintableMap().getPaintable(widget),
+        return hasEventListeners(getConnectorMap().getConnector(widget),
                 eventIdentifier);
     }
 
diff --git a/src/com/vaadin/terminal/gwt/client/ComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ComponentConnector.java
new file mode 100644 (file)
index 0000000..e639318
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.terminal.gwt.client;
+
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * An interface used by client-side widgets or paintable parts to receive
+ * updates from the corresponding server-side components in the form of
+ * {@link UIDL}.
+ * 
+ * Updates can be sent back to the server using the
+ * {@link ApplicationConnection#updateVariable()} methods.
+ */
+public interface ComponentConnector extends Connector {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.vaadin.terminal.gwt.client.VPaintable#getState()
+     */
+    public ComponentState getState();
+
+    /**
+     * TODO: Rename to getWidget
+     */
+    public Widget getWidget();
+
+    /**
+     * Returns the parent {@link ComponentContainerConnector}
+     * 
+     * @return
+     */
+    public ComponentContainerConnector getParent();
+
+    public LayoutManager getLayoutManager();
+
+    /**
+     * Returns <code>true</code> if the width of this paintable is currently
+     * undefined. If the width is undefined, the actual width of the paintable
+     * is defined by its contents.
+     * 
+     * @return <code>true</code> if the width is undefined, else
+     *         <code>false</code>
+     */
+    public boolean isUndefinedWidth();
+
+    /**
+     * Returns <code>true</code> if the height of this paintable is currently
+     * undefined. If the height is undefined, the actual height of the paintable
+     * is defined by its contents.
+     * 
+     * @return <code>true</code> if the height is undefined, else
+     *         <code>false</code>
+     */
+    public boolean isUndefinedHeight();
+
+    /**
+     * Returns <code>true</code> if the width of this paintable is currently
+     * relative. If the width is relative, the actual width of the paintable is
+     * a percentage of the size allocated to it by its parent.
+     * 
+     * @return <code>true</code> if the width is undefined, else
+     *         <code>false</code>
+     */
+    public boolean isRelativeWidth();
+
+    /**
+     * Returns <code>true</code> if the height of this paintable is currently
+     * relative. If the height is relative, the actual height of the paintable
+     * is a percentage of the size allocated to it by its parent.
+     * 
+     * @return <code>true</code> if the width is undefined, else
+     *         <code>false</code>
+     */
+    public boolean isRelativeHeight();
+
+    /**
+     * Gets the width of this paintable as defined on the server.
+     * 
+     * @return the server side width definition
+     */
+    public String getDeclaredWidth();
+
+    /**
+     * Gets the height of this paintable as defined on the server.
+     * 
+     * @return the server side height definition
+     */
+    public String getDeclaredHeight();
+}
diff --git a/src/com/vaadin/terminal/gwt/client/ComponentContainerConnector.java b/src/com/vaadin/terminal/gwt/client/ComponentContainerConnector.java
new file mode 100644 (file)
index 0000000..c6b1e72
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.terminal.gwt.client;
+
+import java.util.Collection;
+
+import com.google.gwt.user.client.ui.HasWidgets;
+
+/**
+ * An interface used by client-side paintables whose widget is a component
+ * container (implements {@link HasWidgets}).
+ */
+public interface ComponentContainerConnector extends ComponentConnector {
+
+    /**
+     * Update child components caption, description and error message.
+     * 
+     * <p>
+     * Each component is responsible for maintaining its caption, description
+     * and error message. In most cases components doesn't want to do that and
+     * those elements reside outside of the component. Because of this layouts
+     * must provide service for it's childen to show those elements for them.
+     * </p>
+     * 
+     * @param paintable
+     *            Child component for which service is requested.
+     * @param uidl
+     *            UIDL of the child component.
+     */
+    void updateCaption(ComponentConnector paintable, UIDL uidl);
+
+    /**
+     * Returns the children for this paintable.
+     * <p>
+     * The children for this paintable are defined as all
+     * {@link ComponentConnector}s whose parent is this
+     * {@link ComponentContainerConnector}.
+     * </p>
+     * 
+     * @return A collection of children for this paintable. An empty collection
+     *         if there are no children.
+     */
+    public Collection<ComponentConnector> getChildren();
+
+}
index 874e6bb1618c1abc45fb5a11fbe52db99bb244b6..f686b053ba91628593e8bca07fd5c13e4f7931bb 100644 (file)
@@ -80,7 +80,7 @@ public class ComponentLocator {
         Element e = targetElement;
 
         while (true) {
-            pid = VPaintableMap.get(client).getPid(e);
+            pid = ConnectorMap.get(client).getConnectorId(e);
             if (pid != null) {
                 break;
             }
@@ -96,7 +96,7 @@ public class ComponentLocator {
             // If we found a Paintable then we use that as reference. We should
             // find the Paintable for all but very special cases (like
             // overlays).
-            w = ((VPaintableWidget) VPaintableMap.get(client).getPaintable(pid))
+            w = ((ComponentConnector) ConnectorMap.get(client).getConnector(pid))
                     .getWidget();
 
             /*
@@ -367,7 +367,7 @@ public class ComponentLocator {
             return null;
         }
 
-        String pid = VPaintableMap.get(client).getPid(w.getElement());
+        String pid = ConnectorMap.get(client).getConnectorId(w.getElement());
         if (isStaticPid(pid)) {
             return pid;
         }
@@ -440,7 +440,7 @@ public class ComponentLocator {
                 w = client.getView().getWidget();
             } else if (w == null) {
                 // Must be static pid (PID_S*)
-                w = ((VPaintableWidget) VPaintableMap.get(client).getPaintable(
+                w = ((ComponentConnector) ConnectorMap.get(client).getConnector(
                         part)).getWidget();
             } else if (part.startsWith("domChild[")) {
                 // The target widget has been found and the rest identifies the
diff --git a/src/com/vaadin/terminal/gwt/client/Connector.java b/src/com/vaadin/terminal/gwt/client/Connector.java
new file mode 100644 (file)
index 0000000..01a7f3e
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client;
+
+import com.vaadin.terminal.gwt.client.communication.SharedState;
+
+/**
+ * Interface implemented by all client side classes that can be communicate with
+ * the server. Classes implementing this interface are initialized by the
+ * framework when needed and have the ability to communicate with the server.
+ * 
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public interface Connector {
+    /**
+     * TODO
+     * 
+     * @param uidl
+     * @param client
+     */
+    public void updateFromUIDL(UIDL uidl, ApplicationConnection client);
+
+    /**
+     * Gets the current shared state of the connector.
+     * 
+     * @return state
+     */
+    public SharedState getState();
+
+    /**
+     * Sets a new state for the connector.
+     * 
+     * @param state
+     *            The new state
+     * 
+     */
+    public void setState(SharedState state);
+
+    /**
+     * Returns the id for this connector. This must always be what has been set
+     * using {@link #setId(String)}.
+     * 
+     * @return The id for the connector.
+     */
+    public String getId();
+
+    /**
+     * Sets the id for the connector. This method is called once by the
+     * framework when the connector is initialized and should never be called
+     * otherwise.
+     * <p>
+     * The connector id is used to map the server and the client side together.
+     * It is unique in this Root and assigned by the framework.
+     * </p>
+     * 
+     * @param id
+     *            The id of the connector.
+     */
+    public void setId(String id);
+
+    /**
+     * Gets ApplicationConnection instance that created this connector.
+     * 
+     * @return The ApplicationConnection as set by
+     *         {@link #setConnection(ApplicationConnection)}
+     */
+    public ApplicationConnection getConnection();
+
+    /**
+     * Sets the reference to ApplicationConnection. This method is called by the
+     * framework when the connector is created and should never be called
+     * otherwise.
+     * 
+     * @param connection
+     *            The ApplicationConnection that created this connector
+     */
+    public void setConnection(ApplicationConnection connection);
+
+    /**
+     * Tests whether the component is enabled or not. A user can not interact
+     * with disabled components. Disabled components are rendered in a style
+     * that indicates the status, usually in gray color. Children of a disabled
+     * component are also disabled.
+     * 
+     * @return true if the component is enabled, false otherwise
+     */
+    // public boolean isEnabled();
+
+    /**
+     * 
+     * Called once when the connection and id has been set.
+     * 
+     * Note that the shared state is not yet available during init().
+     */
+    public void init();
+
+}
diff --git a/src/com/vaadin/terminal/gwt/client/ConnectorMap.java b/src/com/vaadin/terminal/gwt/client/ConnectorMap.java
new file mode 100644 (file)
index 0000000..5e7d7a2
--- /dev/null
@@ -0,0 +1,397 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.ui.HasWidgets;
+import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.terminal.Paintable;
+import com.vaadin.terminal.gwt.client.RenderInformation.Size;
+
+public class ConnectorMap {
+
+    private Map<String, Connector> idToConnector = new HashMap<String, Connector>();
+
+    public static ConnectorMap get(ApplicationConnection applicationConnection) {
+        return applicationConnection.getConnectorMap();
+    }
+
+    @Deprecated
+    private final ComponentDetailMap idToComponentDetail = ComponentDetailMap
+            .create();
+
+    private Set<String> unregistryBag = new HashSet<String>();
+
+    /**
+     * Returns a {@link Connector} by its id
+     * 
+     * @param id
+     *            The connector id
+     * @return A connector or null if a connector with the given id has not been
+     *         registered
+     */
+    public Connector getConnector(String connectorId) {
+        return idToConnector.get(connectorId);
+    }
+
+    /**
+     * Returns a {@link ComponentConnector} element by its root element
+     * 
+     * @param element
+     *            Root element of the {@link ComponentConnector}
+     * @return A connector or null if a connector with the given id has not been
+     *         registered
+     */
+    public ComponentConnector getConnector(Element element) {
+        return (ComponentConnector) getConnector(getConnectorId(element));
+    }
+
+    /**
+     * FIXME: What does this even do and why?
+     * 
+     * @param pid
+     * @return
+     */
+    public boolean isDragAndDropPaintable(String pid) {
+        return (pid.startsWith("DD"));
+    }
+
+    /**
+     * Checks if a connector with the given id has been registered.
+     * 
+     * @param connectorId
+     *            The id to check for
+     * @return true if a connector has been registered with the given id, false
+     *         otherwise
+     */
+    public boolean hasConnector(String connectorId) {
+        return idToConnector.containsKey(connectorId);
+    }
+
+    /**
+     * Removes all registered connectors
+     */
+    public void clear() {
+        idToConnector.clear();
+        idToComponentDetail.clear();
+    }
+
+    public ComponentConnector getConnector(Widget widget) {
+        return getConnector(widget.getElement());
+    }
+
+    public void registerConnector(String id, Connector connector) {
+        ComponentDetail componentDetail = GWT.create(ComponentDetail.class);
+        idToComponentDetail.put(id, componentDetail);
+        idToConnector.put(id, connector);
+        if (connector instanceof ComponentConnector) {
+            ComponentConnector pw = (ComponentConnector) connector;
+            setConnectorId(pw.getWidget().getElement(), id);
+        }
+    }
+
+    private native void setConnectorId(Element el, String id)
+    /*-{
+        el.tkPid = id;
+    }-*/;
+
+    /**
+     * Gets the id for a specific connector.
+     * <p>
+     * The id is used in the UIDL to identify a specific widget instance,
+     * effectively linking the widget with it's server side Component.
+     * </p>
+     * 
+     * @param connector
+     *            the connector whose id is needed
+     * @return the id for the given connector or null if the connector could not
+     *         be found
+     * @deprecated use {@link Connector#getId()} instead
+     */
+    @Deprecated
+    public String getConnectorId(Connector connector) {
+        if (connector == null) {
+            return null;
+        }
+        return connector.getId();
+    }
+
+    @Deprecated
+    public String getConnectorId(Widget widget) {
+        return getConnectorId(widget.getElement());
+    }
+
+    /**
+     * Gets the connector id using a DOM element - the element should be the
+     * root element for a connector, otherwise no id will be found. Use
+     * {@link #getConnectorId(Connector)} instead whenever possible.
+     * 
+     * @see #getConnectorId(Paintable)
+     * @param el
+     *            element of the connector whose id is desired
+     * @return the id of the element's connector, if it's a connector
+     */
+    native String getConnectorId(Element el)
+    /*-{
+        return el.tkPid;
+    }-*/;
+
+    /**
+     * Gets the main element for the connector with the given id. The reverse of
+     * {@link #getConnectorId(Element)}.
+     * 
+     * @param connectorId
+     *            the id of the widget whose element is desired
+     * @return the element for the connector corresponding to the id
+     */
+    public Element getElement(String connectorId) {
+        Connector p = getConnector(connectorId);
+        if (p instanceof ComponentConnector) {
+            return ((ComponentConnector) p).getWidget().getElement();
+        }
+
+        return null;
+    }
+
+    /**
+     * Unregisters the given connector; always use after removing a connector.
+     * This method does not remove the connector from the DOM, but marks the
+     * connector so that ApplicationConnection may clean up its references to
+     * it. Removing the widget from DOM is component containers responsibility.
+     * 
+     * @param connector
+     *            the connector to remove
+     */
+    public void unregisterConnector(Connector connector) {
+
+        // add to unregistry que
+
+        if (connector == null) {
+            VConsole.error("WARN: Trying to unregister null connector");
+            return;
+        }
+        String id = connector.getId();
+        Widget widget = null;
+        if (connector instanceof ComponentConnector) {
+            widget = ((ComponentConnector) connector).getWidget();
+        }
+
+        if (id == null) {
+            /*
+             * Uncomment the following to debug unregistring components. No
+             * paintables with null id should end here. At least one exception
+             * is our VScrollTableRow, that is hacked to fake it self as a
+             * Paintable to build support for sizing easier.
+             */
+            // if (!(p instanceof VScrollTableRow)) {
+            // VConsole.log("Trying to unregister Paintable not created by Application Connection.");
+            // }
+        } else {
+            unregistryBag.add(id);
+        }
+        if (widget != null && widget instanceof HasWidgets) {
+            unregisterChildConnectors((HasWidgets) widget);
+        }
+
+    }
+
+    public ComponentConnector[] getRegisteredComponentConnectors() {
+        ArrayList<ComponentConnector> result = new ArrayList<ComponentConnector>();
+
+        for (Connector connector : getConnectors()) {
+            if (connector instanceof ComponentConnector) {
+                ComponentConnector componentConnector = (ComponentConnector) connector;
+                if (!unregistryBag.contains(getConnectorId(connector))) {
+                    result.add(componentConnector);
+                }
+            }
+        }
+
+        return result.toArray(new ComponentConnector[result.size()]);
+    }
+
+    void purgeUnregistryBag(boolean unregisterConnectors) {
+        if (unregisterConnectors) {
+            for (String connectorId : unregistryBag) {
+                // TODO purge shared state for pid
+                Connector connector = getConnector(connectorId);
+                if (connector == null) {
+                    /*
+                     * this should never happen, but it does :-( See e.g.
+                     * com.vaadin.tests.components.accordion.RemoveTabs (with
+                     * test script)
+                     */
+                    VConsole.error("Tried to unregister component (id="
+                            + connectorId
+                            + ") that is never registered (or already unregistered)");
+                    continue;
+                }
+                Widget widget = null;
+                if (connector instanceof ComponentConnector) {
+                    widget = ((ComponentConnector) connector).getWidget();
+                }
+
+                // check if can be cleaned
+                if (widget == null || !widget.isAttached()) {
+                    // clean reference to paintable
+                    idToComponentDetail.remove(connectorId);
+                    idToConnector.remove(connectorId);
+                }
+                /*
+                 * else NOP : same component has been reattached to another
+                 * parent or replaced by another component implementation.
+                 */
+            }
+        }
+
+        unregistryBag.clear();
+    }
+
+    /**
+     * Unregisters the child connectors for the given container recursively.
+     * 
+     * Use when after removing a connector that contains other connectors. Does
+     * not unregister the given container itself. Does not actually remove the
+     * widgets from the DOM.
+     * 
+     * @see #unregisterConnector(Connector)
+     * @param container
+     *            The container that contains the connectors that should be
+     *            unregistered
+     */
+    public void unregisterChildConnectors(HasWidgets container) {
+        // FIXME: This should be based on the paintable hierarchy
+        final Iterator<Widget> it = container.iterator();
+        while (it.hasNext()) {
+            final Widget w = it.next();
+            ComponentConnector p = getConnector(w);
+            if (p != null) {
+                // This will unregister the paintable and all its children
+                unregisterConnector(p);
+            } else if (w instanceof HasWidgets) {
+                // For normal widget containers, unregister the children
+                unregisterChildConnectors((HasWidgets) w);
+            }
+        }
+    }
+
+    /**
+     * FIXME: Should not be here
+     * 
+     * @param pid
+     * @param uidl
+     */
+    @Deprecated
+    public void registerEventListenersFromUIDL(String pid, UIDL uidl) {
+        ComponentDetail cd = idToComponentDetail.get(pid);
+        if (cd == null) {
+            throw new IllegalArgumentException("Pid must not be null");
+        }
+
+        cd.registerEventListenersFromUIDL(uidl);
+
+    }
+
+    /**
+     * FIXME: Should not be here
+     * 
+     * @param paintable
+     * @return
+     */
+    @Deprecated
+    public Size getOffsetSize(ComponentConnector paintable) {
+        return getComponentDetail(paintable).getOffsetSize();
+    }
+
+    /**
+     * FIXME: Should not be here
+     * 
+     * @param componentConnector
+     * @return
+     */
+    @Deprecated
+    public void setOffsetSize(ComponentConnector componentConnector,
+            Size newSize) {
+        getComponentDetail(componentConnector).setOffsetSize(newSize);
+    }
+
+    private ComponentDetail getComponentDetail(
+            ComponentConnector componentConnector) {
+        return idToComponentDetail.get(getConnectorId(componentConnector));
+    }
+
+    public int size() {
+        return idToConnector.size();
+    }
+
+    /**
+     * FIXME: Should be moved to VAbstractPaintableWidget
+     * 
+     * @param paintable
+     * @return
+     */
+    @Deprecated
+    public TooltipInfo getTooltipInfo(ComponentConnector paintable, Object key) {
+        return getComponentDetail(paintable).getTooltipInfo(key);
+    }
+
+    @Deprecated
+    public TooltipInfo getWidgetTooltipInfo(Widget widget, Object key) {
+        return getTooltipInfo(getConnector(widget), key);
+    }
+
+    public Collection<? extends Connector> getConnectors() {
+        return Collections.unmodifiableCollection(idToConnector.values());
+    }
+
+    /**
+     * FIXME: Should not be here
+     * 
+     * @param componentConnector
+     * @return
+     */
+    @Deprecated
+    public void registerTooltip(ComponentConnector componentConnector,
+            Object key, TooltipInfo tooltip) {
+        getComponentDetail(componentConnector).putAdditionalTooltip(key,
+                tooltip);
+
+    }
+
+    /**
+     * FIXME: Should not be here
+     * 
+     * @param componentConnector
+     * @return
+     */
+    @Deprecated
+    public boolean hasEventListeners(ComponentConnector componentConnector,
+            String eventIdentifier) {
+        return getComponentDetail(componentConnector).hasEventListeners(
+                eventIdentifier);
+    }
+
+    /**
+     * Tests if the widget is the root widget of a {@link ComponentConnector}.
+     * 
+     * @param widget
+     *            The widget to test
+     * @return true if the widget is the root widget of a
+     *         {@link ComponentConnector}, false otherwise
+     */
+    public boolean isConnector(Widget w) {
+        return getConnectorId(w) != null;
+    }
+
+}
index cf5402a2af8752b9d5016a0e62f1ea9cb1fff1ff..8db145342aec26e0bc59214f19314c4555112178 100644 (file)
@@ -22,8 +22,8 @@ public interface Console {
 
     public abstract void printLayoutProblems(ValueMap meta,
             ApplicationConnection applicationConnection,
-            Set<VPaintableWidget> zeroHeightComponents,
-            Set<VPaintableWidget> zeroWidthComponents);
+            Set<ComponentConnector> zeroHeightComponents,
+            Set<ComponentConnector> zeroWidthComponents);
 
     public abstract void setQuietMode(boolean quietDebugMode);
 
index 10822f48c9d3186651e7d891f64f4e4610728d64..41ca06bb5b75ecba704d4871953f4ada738d5af2 100644 (file)
@@ -40,7 +40,7 @@ import com.google.gwt.event.shared.HandlerRegistration;
  */
 public class EventHelper {
 
-    public static HandlerRegistration updateFocusHandler(VPaintableWidget paintable,
+    public static HandlerRegistration updateFocusHandler(ComponentConnector paintable,
             ApplicationConnection client,
             HandlerRegistration handlerRegistration) {
         if (client.hasEventListeners(paintable, FOCUS)) {
@@ -57,7 +57,7 @@ public class EventHelper {
         return null;
     }
 
-    public static HandlerRegistration updateBlurHandler(VPaintableWidget paintable,
+    public static HandlerRegistration updateBlurHandler(ComponentConnector paintable,
             ApplicationConnection client,
             HandlerRegistration handlerRegistration) {
         if (client.hasEventListeners(paintable, BLUR)) {
index bb869ac2d031260194ed8f13cf1acf9d6cc02919..23c653cd0d96899d83daf3dcc6680ba3addeff1a 100644 (file)
@@ -44,7 +44,7 @@ public class LayoutManager {
         if (measuredSize == null) {
             measuredSize = new MeasuredSize();
 
-            if (VPaintableMap.get(connection).getPaintable(element) == null) {
+            if (ConnectorMap.get(connection).getConnector(element) == null) {
                 nonPaintableElements.add(element);
             }
             setMeasuredSize(element, measuredSize);
@@ -53,7 +53,7 @@ public class LayoutManager {
     }
 
     private boolean needsMeasure(Element e) {
-        if (connection.getPaintableMap().getPid(e) != null) {
+        if (connection.getConnectorMap().getConnectorId(e) != null) {
             return true;
         } else if (getMeasuredSize(e, nullSize).hasDependents()) {
             return true;
@@ -78,7 +78,7 @@ public class LayoutManager {
         return element.vMeasuredSize || defaultSize;
     }-*/;
 
-    private static final MeasuredSize getMeasuredSize(VPaintableWidget paintable) {
+    private static final MeasuredSize getMeasuredSize(ComponentConnector paintable) {
         Element element = paintable.getWidget().getElement();
         MeasuredSize measuredSize = getMeasuredSize(element, null);
         if (measuredSize == null) {
@@ -101,9 +101,9 @@ public class LayoutManager {
     }
 
     public void doLayout() {
-        VPaintableMap paintableMap = connection.getPaintableMap();
-        VPaintableWidget[] paintableWidgets = paintableMap
-                .getRegisteredPaintableWidgets();
+        ConnectorMap paintableMap = connection.getConnectorMap();
+        ComponentConnector[] paintableWidgets = paintableMap
+                .getRegisteredComponentConnectors();
 
         int passes = 0;
         Duration totalDuration = new Duration();
@@ -116,11 +116,11 @@ public class LayoutManager {
             FastStringSet needsHeightUpdate = FastStringSet.create();
             FastStringSet needsWidthUpdate = FastStringSet.create();
 
-            for (VPaintableWidget paintable : paintableWidgets) {
+            for (ComponentConnector paintable : paintableWidgets) {
                 MeasuredSize measuredSize = getMeasuredSize(paintable);
                 boolean managed = isManagedLayout(paintable);
 
-                VPaintableWidgetContainer parent = paintable.getParent();
+                ComponentContainerConnector parent = paintable.getParent();
                 boolean managedParent = parent != null
                         && isManagedLayout(parent);
 
@@ -153,7 +153,7 @@ public class LayoutManager {
             for (int i = 0; i < needsWidthUpdateArray.length(); i++) {
                 String pid = needsWidthUpdateArray.get(i);
 
-                VPaintable paintable = paintableMap.getPaintable(pid);
+                Connector paintable = paintableMap.getConnector(pid);
                 if (paintable instanceof DirectionalManagedLayout) {
                     DirectionalManagedLayout cl = (DirectionalManagedLayout) paintable;
                     cl.layoutHorizontally();
@@ -169,8 +169,8 @@ public class LayoutManager {
             for (int i = 0; i < needsHeightUpdateArray.length(); i++) {
                 String pid = needsHeightUpdateArray.get(i);
 
-                VPaintableWidget paintable = (VPaintableWidget) paintableMap
-                        .getPaintable(pid);
+                ComponentConnector paintable = (ComponentConnector) paintableMap
+                        .getConnector(pid);
                 if (paintable instanceof DirectionalManagedLayout) {
                     DirectionalManagedLayout cl = (DirectionalManagedLayout) paintable;
                     cl.layoutVertically();
@@ -213,7 +213,7 @@ public class LayoutManager {
             }
         }
 
-        for (VPaintableWidget vPaintableWidget : paintableWidgets) {
+        for (ComponentConnector vPaintableWidget : paintableWidgets) {
             if (vPaintableWidget instanceof PostLayoutListener) {
                 ((PostLayoutListener) vPaintableWidget).postLayout();
             }
@@ -223,9 +223,9 @@ public class LayoutManager {
                 + "ms");
     }
 
-    private void measureElements(VPaintableWidget[] paintableWidgets) {
+    private void measureElements(ComponentConnector[] paintableWidgets) {
 
-        for (VPaintableWidget paintableWidget : paintableWidgets) {
+        for (ComponentConnector paintableWidget : paintableWidgets) {
             Element element = paintableWidget.getWidget()
                     .getElement();
             MeasuredSize measuredSize = getMeasuredSize(paintableWidget);
@@ -243,8 +243,8 @@ public class LayoutManager {
             JsArrayString dependents = measuredSize.getDependents();
             for (int i = 0; i < dependents.length(); i++) {
                 String pid = dependents.get(i);
-                VPaintableWidget dependent = (VPaintableWidget) connection
-                        .getPaintableMap().getPaintable(pid);
+                ComponentConnector dependent = (ComponentConnector) connection
+                        .getConnectorMap().getConnector(pid);
                 if (dependent != null) {
                     MeasuredSize dependentSize = getMeasuredSize(dependent);
                     if (measuredSize.isHeightNeedsUpdate()) {
@@ -258,15 +258,15 @@ public class LayoutManager {
         }
     }
 
-    private static boolean isManagedLayout(VPaintableWidget paintable) {
+    private static boolean isManagedLayout(ComponentConnector paintable) {
         return paintable instanceof ManagedLayout;
     }
 
     public void foceLayout() {
-        VPaintableMap paintableMap = connection.getPaintableMap();
-        VPaintableWidget[] paintableWidgets = paintableMap
-                .getRegisteredPaintableWidgets();
-        for (VPaintableWidget vPaintableWidget : paintableWidgets) {
+        ConnectorMap paintableMap = connection.getConnectorMap();
+        ComponentConnector[] paintableWidgets = paintableMap
+                .getRegisteredComponentConnectors();
+        for (ComponentConnector vPaintableWidget : paintableWidgets) {
             MeasuredSize measuredSize = getMeasuredSize(vPaintableWidget);
             measuredSize.setHeightNeedsUpdate();
             measuredSize.setWidthNeedsUpdate();
index 31aa4f74d3c03ec60cc9568eb84c524230ea56ff..1d9de9011875e701046d8dc695b42f0fbff3398d 100644 (file)
@@ -32,8 +32,8 @@ public class NullConsole implements Console {
 
     public void printLayoutProblems(ValueMap meta,
             ApplicationConnection applicationConnection,
-            Set<VPaintableWidget> zeroHeightComponents,
-            Set<VPaintableWidget> zeroWidthComponents) {
+            Set<ComponentConnector> zeroHeightComponents,
+            Set<ComponentConnector> zeroWidthComponents) {
     }
 
     public void log(Throwable e) {
index b828e644ddc9f264088ab0b47febe18a19068680..70ecf016726a6b4089188ac41e155b4cff6864e7 100644 (file)
@@ -16,7 +16,7 @@ import com.vaadin.ui.Component;
 
 /**
  * When a component is updated, it's client side widget's
- * {@link VPaintableWidget#updateFromUIDL(UIDL, ApplicationConnection)
+ * {@link ComponentConnector#updateFromUIDL(UIDL, ApplicationConnection)
  * updateFromUIDL()} will be called with the updated ("changes") UIDL received
  * from the server.
  * <p>
@@ -55,7 +55,7 @@ public final class UIDL extends JavaScriptObject {
      * AbstractComponent.paintContent()}. Note that if the UIDL corresponds to a
      * Paintable, a component identifier will be returned instead - this is used
      * internally and is not needed within
-     * {@link VPaintableWidget#updateFromUIDL(UIDL, ApplicationConnection)
+     * {@link ComponentConnector#updateFromUIDL(UIDL, ApplicationConnection)
      * updateFromUIDL()}.
      * 
      * @return the name for this section
@@ -516,9 +516,9 @@ public final class UIDL extends JavaScriptObject {
      *            the name of the attribute
      * @return the Paintable referenced by the attribute, if it exists
      */
-    public VPaintable getPaintableAttribute(String name,
+    public Connector getPaintableAttribute(String name,
             ApplicationConnection connection) {
-        return VPaintableMap.get(connection).getPaintable(
+        return ConnectorMap.get(connection).getConnector(
                 getStringAttribute(name));
     }
 
@@ -529,9 +529,9 @@ public final class UIDL extends JavaScriptObject {
      *            the name of the variable
      * @return the Paintable referenced by the variable, if it exists
      */
-    public VPaintable getPaintableVariable(String name,
+    public Connector getPaintableVariable(String name,
             ApplicationConnection connection) {
-        return VPaintableMap.get(connection).getPaintable(
+        return ConnectorMap.get(connection).getConnector(
                 getStringVariable(name));
     }
 
index a563a534d521d1cb3685543e66a56bd0c37b4fcd..3c251ae99778a2dbc654ddc26a383c7bd892ed46 100644 (file)
@@ -97,15 +97,15 @@ public class Util {
         List<ApplicationConnection> runningApplications = ApplicationConfiguration
                 .getRunningApplications();
         for (ApplicationConnection applicationConnection : runningApplications) {
-            VPaintableMap paintableMap = applicationConnection
-                    .getPaintableMap();
-            VPaintableWidget paintable = paintableMap.getPaintable(widget);
+            ConnectorMap paintableMap = applicationConnection
+                    .getConnectorMap();
+            ComponentConnector paintable = paintableMap.getConnector(widget);
             if (paintable == null) {
                 continue;
             }
-            String pid = paintableMap.getPid(paintable);
+            String pid = paintableMap.getConnectorId(paintable);
             if (pid != null) {
-                VPaintable otherPaintable = paintableMap.getPaintable(pid);
+                Connector otherPaintable = paintableMap.getConnector(pid);
                 if (otherPaintable == paintable) {
                     return applicationConnection;
                 }
@@ -644,17 +644,17 @@ public class Util {
      * @return The VPaintableWidget which the element is a part of. Null if the
      *         element does not belong to a child.
      */
-    public static VPaintableWidget getPaintableForElement(
+    public static ComponentConnector getPaintableForElement(
             ApplicationConnection client, Widget parent, Element element) {
         Element rootElement = parent.getElement();
         while (element != null && element != rootElement) {
-            VPaintableWidget paintable = VPaintableMap.get(client)
-                    .getPaintable(element);
+            ComponentConnector paintable = ConnectorMap.get(client)
+                    .getConnector(element);
             if (paintable == null) {
                 String ownerPid = VCaption.getCaptionOwnerPid(element);
                 if (ownerPid != null) {
-                    paintable = (VPaintableWidget) VPaintableMap.get(client)
-                            .getPaintable(ownerPid);
+                    paintable = (ComponentConnector) ConnectorMap.get(client)
+                            .getConnector(ownerPid);
                 }
             }
 
@@ -698,14 +698,14 @@ public class Util {
      * @param element
      *            the element to start from
      */
-    public static VPaintableWidget findPaintable(ApplicationConnection client,
+    public static ComponentConnector findPaintable(ApplicationConnection client,
             Element element) {
         Widget widget = Util.findWidget(element, null);
-        VPaintableMap vPaintableMap = VPaintableMap.get(client);
-        while (widget != null && !vPaintableMap.isPaintable(widget)) {
+        ConnectorMap vPaintableMap = ConnectorMap.get(client);
+        while (widget != null && !vPaintableMap.isConnector(widget)) {
             widget = widget.getParent();
         }
-        return vPaintableMap.getPaintable(widget);
+        return vPaintableMap.getConnector(widget);
 
     }
 
@@ -819,8 +819,8 @@ public class Util {
     private static void printPaintablesInvocations(
             ArrayList<MethodInvocation> invocations, String id,
             ApplicationConnection c) {
-        VPaintableWidget paintable = (VPaintableWidget) VPaintableMap.get(c)
-                .getPaintable(id);
+        ComponentConnector paintable = (ComponentConnector) ConnectorMap.get(c)
+                .getConnector(id);
         if (paintable != null) {
             VConsole.log("\t" + id + " (" + paintable.getClass() + ") :");
             for (MethodInvocation invocation : invocations) {
@@ -833,8 +833,8 @@ public class Util {
                     Object value = parameters[1];
                     // TODO paintables inside lists/maps get rendered as
                     // components in the debug console
-                    String formattedValue = value instanceof VPaintable ? c
-                            .getPaintableMap().getPid((VPaintable) value)
+                    String formattedValue = value instanceof Connector ? c
+                            .getConnectorMap().getConnectorId((Connector) value)
                             : String.valueOf(value);
                     formattedParams = parameters[0] + " : " + formattedValue;
                 }
index 11ced8de221240debf0e66aa28db2a83c29e4476..1d293ef5bf9b577349a34aa7921c377b2b0772ba 100644 (file)
@@ -9,14 +9,14 @@ import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.ui.HTML;
 import com.vaadin.terminal.gwt.client.ui.Icon;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.VTabsheetBasePaintable;
 
 public class VCaption extends HTML {
 
     public static final String CLASSNAME = "v-caption";
 
-    private final VPaintableWidget owner;
+    private final ComponentConnector owner;
 
     private Element errorIndicatorElement;
 
@@ -44,7 +44,7 @@ public class VCaption extends HTML {
     }
 
     /**
-     * Creates a caption that is not linked to a {@link VPaintableWidget}.
+     * Creates a caption that is not linked to a {@link ComponentConnector}.
      * 
      * When using this constructor, {@link #getOwner()} returns null.
      * 
@@ -65,20 +65,20 @@ public class VCaption extends HTML {
     }
 
     /**
-     * Creates a caption for a {@link VPaintableWidget}.
+     * Creates a caption for a {@link ComponentConnector}.
      * 
      * @param component
      *            owner of caption, not null
      * @param client
      *            ApplicationConnection
      */
-    public VCaption(VPaintableWidget component, ApplicationConnection client) {
+    public VCaption(ComponentConnector component, ApplicationConnection client) {
         super();
         this.client = client;
         owner = component;
 
         if (client != null && owner != null) {
-            setOwnerPid(getElement(), VPaintableMap.get(client).getPid(owner));
+            setOwnerPid(getElement(), ConnectorMap.get(client).getConnectorId(owner));
         }
 
         setStyleName(CLASSNAME);
@@ -118,12 +118,12 @@ public class VCaption extends HTML {
         setStyleName(style);
 
         boolean hasIcon = uidl
-                .hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON);
+                .hasAttribute(AbstractComponentConnector.ATTRIBUTE_ICON);
         boolean showRequired = uidl
-                .getBooleanAttribute(VAbstractPaintableWidget.ATTRIBUTE_REQUIRED);
+                .getBooleanAttribute(AbstractComponentConnector.ATTRIBUTE_REQUIRED);
         boolean showError = uidl
-                .hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ERROR)
-                && !uidl.getBooleanAttribute(VAbstractPaintableWidget.ATTRIBUTE_HIDEERRORS);
+                .hasAttribute(AbstractComponentConnector.ATTRIBUTE_ERROR)
+                && !uidl.getBooleanAttribute(AbstractComponentConnector.ATTRIBUTE_HIDEERRORS);
 
         if (hasIcon) {
             if (icon == null) {
@@ -138,7 +138,7 @@ public class VCaption extends HTML {
             placedAfterComponent = false;
 
             icon.setUri(uidl
-                    .getStringAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON));
+                    .getStringAttribute(AbstractComponentConnector.ATTRIBUTE_ICON));
 
         } else if (icon != null) {
             // Remove existing
@@ -281,10 +281,10 @@ public class VCaption extends HTML {
             }
         }
         boolean hasIcon = uidl
-                .hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON);
+                .hasAttribute(AbstractComponentConnector.ATTRIBUTE_ICON);
         boolean showError = uidl
-                .hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ERROR)
-                && !uidl.getBooleanAttribute(VAbstractPaintableWidget.ATTRIBUTE_HIDEERRORS);
+                .hasAttribute(AbstractComponentConnector.ATTRIBUTE_ERROR)
+                && !uidl.getBooleanAttribute(AbstractComponentConnector.ATTRIBUTE_HIDEERRORS);
 
         if (hasIcon) {
             if (icon == null) {
@@ -299,7 +299,7 @@ public class VCaption extends HTML {
             placedAfterComponent = false;
 
             icon.setUri(uidl
-                    .getStringAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON));
+                    .getStringAttribute(AbstractComponentConnector.ATTRIBUTE_ICON));
 
         } else if (icon != null) {
             // Remove existing
@@ -408,13 +408,13 @@ public class VCaption extends HTML {
                 return true;
             }
         }
-        if (uidl.hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ERROR)) {
+        if (uidl.hasAttribute(AbstractComponentConnector.ATTRIBUTE_ERROR)) {
             return true;
         }
-        if (uidl.hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON)) {
+        if (uidl.hasAttribute(AbstractComponentConnector.ATTRIBUTE_ICON)) {
             return true;
         }
-        if (uidl.hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_REQUIRED)) {
+        if (uidl.hasAttribute(AbstractComponentConnector.ATTRIBUTE_REQUIRED)) {
             return true;
         }
 
@@ -426,7 +426,7 @@ public class VCaption extends HTML {
      * 
      * @return owner Widget
      */
-    public VPaintableWidget getOwner() {
+    public ComponentConnector getOwner() {
         return owner;
     }
 
index 96920bdc145a4f3edd9ffa9fb122bff70d6ac075..b96f9621d4f7fe321ede69653f19cba518a5ec5e 100644 (file)
@@ -10,7 +10,7 @@ public class VCaptionWrapper extends FlowPanel {
 
     public static final String CLASSNAME = "v-captionwrapper";
     VCaption caption;
-    VPaintableWidget paintable;
+    ComponentConnector paintable;
 
     /**
      * Creates a new caption wrapper panel.
@@ -20,7 +20,7 @@ public class VCaptionWrapper extends FlowPanel {
      * @param client
      *            ApplicationConnection
      */
-    public VCaptionWrapper(VPaintableWidget toBeWrapped,
+    public VCaptionWrapper(ComponentConnector toBeWrapped,
             ApplicationConnection client) {
         caption = new VCaption(toBeWrapped, client);
         add(caption);
@@ -34,7 +34,7 @@ public class VCaptionWrapper extends FlowPanel {
         setVisible(!uidl.getBooleanAttribute("invisible"));
     }
 
-    public VPaintableWidget getPaintable() {
+    public ComponentConnector getPaintable() {
         return paintable;
     }
 }
index 137b6eb2a6b04021bf769ac115ccafe1a35ad915..dee8529a842eb6e57847a9b76fc7408e4916b872 100644 (file)
@@ -82,8 +82,8 @@ public class VConsole {
 
     public static void printLayoutProblems(ValueMap meta,
             ApplicationConnection applicationConnection,
-            Set<VPaintableWidget> zeroHeightComponents,
-            Set<VPaintableWidget> zeroWidthComponents) {
+            Set<ComponentConnector> zeroHeightComponents,
+            Set<ComponentConnector> zeroWidthComponents) {
         impl.printLayoutProblems(meta, applicationConnection,
                 zeroHeightComponents, zeroWidthComponents);
     }
index 685eeaff4e8c9fbe9dd003397313a120bc93dd3d..22f0add2c5283b640e700c2eda5e0bf2eaae018a 100644 (file)
@@ -90,14 +90,14 @@ public class VDebugConsole extends VOverlay implements Console {
 
                 for (ApplicationConnection a : ApplicationConfiguration
                         .getRunningApplications()) {
-                    VPaintableWidget paintable = Util.getPaintableForElement(a,
+                    ComponentConnector paintable = Util.getPaintableForElement(a,
                             a.getView().getWidget(), eventTarget);
                     if (paintable == null) {
                         paintable = Util.getPaintableForElement(a,
                                 RootPanel.get(), eventTarget);
                     }
                     if (paintable != null) {
-                        String pid = VPaintableMap.get(a).getPid(paintable);
+                        String pid = ConnectorMap.get(a).getConnectorId(paintable);
                         VUIDLBrowser.highlight(paintable);
                         label.setText("Currently focused  :"
                                 + paintable.getClass() + " ID:" + pid);
@@ -119,7 +119,7 @@ public class VDebugConsole extends VOverlay implements Console {
                         .getClientY());
                 for (ApplicationConnection a : ApplicationConfiguration
                         .getRunningApplications()) {
-                    VPaintableWidget paintable = Util.getPaintableForElement(a,
+                    ComponentConnector paintable = Util.getPaintableForElement(a,
                             a.getView().getWidget(), eventTarget);
                     if (paintable == null) {
                         paintable = Util.getPaintableForElement(a,
@@ -483,8 +483,8 @@ public class VDebugConsole extends VOverlay implements Console {
      }-*/;
 
     public void printLayoutProblems(ValueMap meta, ApplicationConnection ac,
-            Set<VPaintableWidget> zeroHeightComponents,
-            Set<VPaintableWidget> zeroWidthComponents) {
+            Set<ComponentConnector> zeroHeightComponents,
+            Set<ComponentConnector> zeroWidthComponents) {
         JsArray<ValueMap> valueMapArray = meta
                 .getJSValueMapArray("invalidLayouts");
         int size = valueMapArray.length();
@@ -521,8 +521,8 @@ public class VDebugConsole extends VOverlay implements Console {
     }
 
     private void printClientSideDetectedIssues(
-            Set<VPaintableWidget> zeroHeightComponents, ApplicationConnection ac) {
-        for (final VPaintableWidget paintable : zeroHeightComponents) {
+            Set<ComponentConnector> zeroHeightComponents, ApplicationConnection ac) {
+        for (final ComponentConnector paintable : zeroHeightComponents) {
             final Widget layout = paintable.getParent().getWidget();
 
             VerticalPanel errorDetails = new VerticalPanel();
@@ -547,8 +547,8 @@ public class VDebugConsole extends VOverlay implements Console {
     private void printLayoutError(ValueMap valueMap, SimpleTree root,
             final ApplicationConnection ac) {
         final String pid = valueMap.getString("id");
-        final VPaintableWidget paintable = (VPaintableWidget) VPaintableMap
-                .get(ac).getPaintable(pid);
+        final ComponentConnector paintable = (ComponentConnector) ConnectorMap
+                .get(ac).getConnector(pid);
 
         SimpleTree errorNode = new SimpleTree();
         VerticalPanel errorDetails = new VerticalPanel();
diff --git a/src/com/vaadin/terminal/gwt/client/VPaintable.java b/src/com/vaadin/terminal/gwt/client/VPaintable.java
deleted file mode 100644 (file)
index 9d1dd0f..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client;
-
-import com.vaadin.terminal.gwt.client.communication.SharedState;
-
-/**
- * Interface implemented by all client side classes that can be communicate with
- * the server. Classes implementing this interface are initialized by the
- * framework when needed and have the ability to communicate with the server.
- * 
- * @author Vaadin Ltd
- * @version @VERSION@
- * @since 7.0.0
- */
-public interface VPaintable {
-    /**
-     * TODO
-     * 
-     * @param uidl
-     * @param client
-     */
-    public void updateFromUIDL(UIDL uidl, ApplicationConnection client);
-
-    /**
-     * Gets the current shared state of the paintable.
-     * 
-     * @return state
-     */
-    public SharedState getState();
-
-    /**
-     * Sets a new state for the paintable.
-     * 
-     * @param state
-     *            The new state
-     * 
-     */
-    public void setState(SharedState state);
-
-    /**
-     * Returns the id for this VPaintable. This must always be what has been set
-     * using {@link #setId(String)}.
-     * 
-     * @return The id for the VPaintable.
-     */
-    public String getId();
-
-    /**
-     * Sets the id for the VPaintable. This method is called once by the
-     * framework when the VPaintable is initialized and should never be called
-     * otherwise.
-     * <p>
-     * The VPaintable id is used to map the server and the client paintables
-     * together. It is unique in this root and assigned by the framework.
-     * </p>
-     * 
-     * @param id
-     *            The id of the paintable.
-     */
-    public void setId(String id);
-
-    /**
-     * Gets ApplicationConnection instance that created this VPaintable.
-     * 
-     * @return The ApplicationConnection as set by
-     *         {@link #setConnection(ApplicationConnection)}
-     */
-    public ApplicationConnection getConnection();
-
-    /**
-     * Sets the reference to ApplicationConnection. This method is called by the
-     * framework when the VPaintable is created and should never be called
-     * otherwise.
-     * 
-     * @param connection
-     *            The ApplicationConnection that created this VPaintable
-     */
-    public void setConnection(ApplicationConnection connection);
-
-    /**
-     * Tests whether the component is enabled or not. A user can not interact
-     * with disabled components. Disabled components are rendered in a style
-     * that indicates the status, usually in gray color. Children of a disabled
-     * component are also disabled.
-     * 
-     * @return true if the component is enabled, false otherwise
-     */
-    // public boolean isEnabled();
-
-    /**
-     * 
-     * Called once when the connection and id has been set.
-     * 
-     * Note that the shared state is not yet available during init().
-     */
-    public void init();
-
-}
diff --git a/src/com/vaadin/terminal/gwt/client/VPaintableMap.java b/src/com/vaadin/terminal/gwt/client/VPaintableMap.java
deleted file mode 100644 (file)
index ed8cc12..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.user.client.ui.HasWidgets;
-import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.terminal.Paintable;
-import com.vaadin.terminal.gwt.client.RenderInformation.Size;
-
-public class VPaintableMap {
-
-    private Map<String, VPaintable> idToPaintable = new HashMap<String, VPaintable>();
-
-    public static VPaintableMap get(ApplicationConnection applicationConnection) {
-        return applicationConnection.getPaintableMap();
-    }
-
-    @Deprecated
-    private final ComponentDetailMap idToComponentDetail = ComponentDetailMap
-            .create();
-
-    private Set<String> unregistryBag = new HashSet<String>();
-
-    /**
-     * Returns a Paintable by its paintable id
-     * 
-     * @param id
-     *            The Paintable id
-     */
-    public VPaintable getPaintable(String pid) {
-        return idToPaintable.get(pid);
-    }
-
-    /**
-     * Returns a Paintable element by its root element
-     * 
-     * @param element
-     *            Root element of the paintable
-     */
-    public VPaintableWidget getPaintable(Element element) {
-        return (VPaintableWidget) getPaintable(getPid(element));
-    }
-
-    /**
-     * FIXME: What does this even do and why?
-     * 
-     * @param pid
-     * @return
-     */
-    public boolean isDragAndDropPaintable(String pid) {
-        return (pid.startsWith("DD"));
-    }
-
-    /**
-     * Checks if a paintable with the given paintable id has been registered.
-     * 
-     * @param pid
-     *            The paintable id to check for
-     * @return true if a paintable has been registered with the given paintable
-     *         id, false otherwise
-     */
-    public boolean hasPaintable(String pid) {
-        return idToPaintable.containsKey(pid);
-    }
-
-    /**
-     * Removes all registered paintable ids
-     */
-    public void clear() {
-        idToPaintable.clear();
-        idToComponentDetail.clear();
-    }
-
-    @Deprecated
-    public Widget getWidget(VPaintableWidget paintable) {
-        return paintable.getWidget();
-    }
-
-    @Deprecated
-    public VPaintableWidget getPaintable(Widget widget) {
-        return getPaintable(widget.getElement());
-    }
-
-    public void registerPaintable(String pid, VPaintable paintable) {
-        ComponentDetail componentDetail = GWT.create(ComponentDetail.class);
-        idToComponentDetail.put(pid, componentDetail);
-        idToPaintable.put(pid, paintable);
-        if (paintable instanceof VPaintableWidget) {
-            VPaintableWidget pw = (VPaintableWidget) paintable;
-            setPid(pw.getWidget().getElement(), pid);
-        }
-    }
-
-    private native void setPid(Element el, String pid)
-    /*-{
-        el.tkPid = pid;
-    }-*/;
-
-    /**
-     * Gets the paintableId for a specific paintable.
-     * <p>
-     * The paintableId is used in the UIDL to identify a specific widget
-     * instance, effectively linking the widget with it's server side Component.
-     * </p>
-     * 
-     * @param paintable
-     *            the paintable who's id is needed
-     * @return the id for the given paintable or null if the paintable could not
-     *         be found
-     * @deprecated use {@link VPaintable#getId()} instead
-     */
-    @Deprecated
-    public String getPid(VPaintable paintable) {
-        if (paintable == null) {
-            return null;
-        }
-        return paintable.getId();
-    }
-
-    @Deprecated
-    public String getPid(Widget widget) {
-        return getPid(widget.getElement());
-    }
-
-    /**
-     * Gets the paintableId using a DOM element - the element should be the main
-     * element for a paintable otherwise no id will be found. Use
-     * {@link #getPid(Paintable)} instead whenever possible.
-     * 
-     * @see #getPid(Paintable)
-     * @param el
-     *            element of the paintable whose pid is desired
-     * @return the pid of the element's paintable, if it's a paintable
-     */
-    native String getPid(Element el)
-    /*-{
-        return el.tkPid;
-    }-*/;
-
-    /**
-     * Gets the main element for the paintable with the given id. The revers of
-     * {@link #getPid(Element)}.
-     * 
-     * @param pid
-     *            the pid of the widget whose element is desired
-     * @return the element for the paintable corresponding to the pid
-     */
-    public Element getElement(String pid) {
-        VPaintable p = getPaintable(pid);
-        if (p instanceof VPaintableWidget) {
-            return ((VPaintableWidget) p).getWidget().getElement();
-        }
-
-        return null;
-    }
-
-    /**
-     * Unregisters the given paintable; always use after removing a paintable.
-     * This method does not remove the paintable from the DOM, but marks the
-     * paintable so that ApplicationConnection may clean up its references to
-     * it. Removing the widget from DOM is component containers responsibility.
-     * 
-     * @param p
-     *            the paintable to remove
-     */
-    public void unregisterPaintable(VPaintable p) {
-
-        // add to unregistry que
-
-        if (p == null) {
-            VConsole.error("WARN: Trying to unregister null paintable");
-            return;
-        }
-        String id = getPid(p);
-        Widget widget = null;
-        if (p instanceof VPaintableWidget) {
-            widget = ((VPaintableWidget) p).getWidget();
-        }
-
-        if (id == null) {
-            /*
-             * Uncomment the following to debug unregistring components. No
-             * paintables with null id should end here. At least one exception
-             * is our VScrollTableRow, that is hacked to fake it self as a
-             * Paintable to build support for sizing easier.
-             */
-            // if (!(p instanceof VScrollTableRow)) {
-            // VConsole.log("Trying to unregister Paintable not created by Application Connection.");
-            // }
-        } else {
-            unregistryBag.add(id);
-        }
-        if (widget != null && widget instanceof HasWidgets) {
-            unregisterChildPaintables((HasWidgets) widget);
-        }
-
-    }
-
-    public VPaintableWidget[] getRegisteredPaintableWidgets() {
-        ArrayList<VPaintableWidget> result = new ArrayList<VPaintableWidget>();
-
-        for (VPaintable paintable : getPaintables()) {
-            if (paintable instanceof VPaintableWidget) {
-                VPaintableWidget paintableWidget = (VPaintableWidget) paintable;
-                if (!unregistryBag.contains(getPid(paintable))) {
-                    result.add(paintableWidget);
-                }
-            }
-        }
-
-        return result.toArray(new VPaintableWidget[result.size()]);
-    }
-
-    void purgeUnregistryBag(boolean unregisterPaintables) {
-        if (unregisterPaintables) {
-            for (String pid : unregistryBag) {
-                // TODO purge shared state for pid
-                VPaintable paintable = getPaintable(pid);
-                if (paintable == null) {
-                    /*
-                     * this should never happen, but it does :-( See e.g.
-                     * com.vaadin.tests.components.accordion.RemoveTabs (with
-                     * test script)
-                     */
-                    VConsole.error("Tried to unregister component (id="
-                            + pid
-                            + ") that is never registered (or already unregistered)");
-                    continue;
-                }
-                Widget widget = null;
-                if (paintable instanceof VPaintableWidget) {
-                    widget = ((VPaintableWidget) paintable)
-                            .getWidget();
-                }
-
-                // check if can be cleaned
-                if (widget == null || !widget.isAttached()) {
-                    // clean reference to paintable
-                    idToComponentDetail.remove(pid);
-                    idToPaintable.remove(pid);
-                }
-                /*
-                 * else NOP : same component has been reattached to another
-                 * parent or replaced by another component implementation.
-                 */
-            }
-        }
-
-        unregistryBag.clear();
-    }
-
-    /**
-     * Unregisters a paintable and all it's child paintables recursively. Use
-     * when after removing a paintable that contains other paintables. Does not
-     * unregister the given container itself. Does not actually remove the
-     * paintable from the DOM.
-     * 
-     * @see #unregisterPaintable(Paintable)
-     * @param container
-     */
-    public void unregisterChildPaintables(HasWidgets container) {
-        // FIXME: This should be based on the paintable hierarchy
-        final Iterator<Widget> it = container.iterator();
-        while (it.hasNext()) {
-            final Widget w = it.next();
-            VPaintableWidget p = getPaintable(w);
-            if (p != null) {
-                // This will unregister the paintable and all its children
-                unregisterPaintable(p);
-            } else if (w instanceof HasWidgets) {
-                // For normal widget containers, unregister the children
-                unregisterChildPaintables((HasWidgets) w);
-            }
-        }
-    }
-
-    /**
-     * FIXME: Should not be here
-     * 
-     * @param pid
-     * @param uidl
-     */
-    @Deprecated
-    public void registerEventListenersFromUIDL(String pid, UIDL uidl) {
-        ComponentDetail cd = idToComponentDetail.get(pid);
-        if (cd == null) {
-            throw new IllegalArgumentException("Pid must not be null");
-        }
-
-        cd.registerEventListenersFromUIDL(uidl);
-
-    }
-
-    /**
-     * FIXME: Should not be here
-     * 
-     * @param paintable
-     * @return
-     */
-    @Deprecated
-    public Size getOffsetSize(VPaintableWidget paintable) {
-        return getComponentDetail(paintable).getOffsetSize();
-    }
-
-    /**
-     * FIXME: Should not be here
-     * 
-     * @param paintable
-     * @return
-     */
-    @Deprecated
-    public void setOffsetSize(VPaintableWidget paintable, Size newSize) {
-        getComponentDetail(paintable).setOffsetSize(newSize);
-    }
-
-    private ComponentDetail getComponentDetail(VPaintableWidget paintable) {
-        return idToComponentDetail.get(getPid(paintable));
-    }
-
-    public int size() {
-        return idToPaintable.size();
-    }
-
-    /**
-     * FIXME: Should be moved to VAbstractPaintableWidget
-     * 
-     * @param paintable
-     * @return
-     */
-    @Deprecated
-    public TooltipInfo getTooltipInfo(VPaintableWidget paintable, Object key) {
-        return getComponentDetail(paintable).getTooltipInfo(key);
-    }
-
-    @Deprecated
-    public TooltipInfo getWidgetTooltipInfo(Widget widget, Object key) {
-        return getTooltipInfo(getPaintable(widget), key);
-    }
-
-    public Collection<? extends VPaintable> getPaintables() {
-        return Collections.unmodifiableCollection(idToPaintable.values());
-    }
-
-    /**
-     * FIXME: Should not be here
-     * 
-     * @param paintable
-     * @return
-     */
-    @Deprecated
-    public void registerTooltip(VPaintableWidget paintable, Object key,
-            TooltipInfo tooltip) {
-        getComponentDetail(paintable).putAdditionalTooltip(key, tooltip);
-
-    }
-
-    /**
-     * FIXME: Should not be here
-     * 
-     * @param paintable
-     * @return
-     */
-    @Deprecated
-    public boolean hasEventListeners(VPaintableWidget paintable,
-            String eventIdentifier) {
-        return getComponentDetail(paintable).hasEventListeners(eventIdentifier);
-    }
-
-    /**
-     * Tests if the widget is the root widget of a VPaintableWidget.
-     * 
-     * @param widget
-     *            The widget to test
-     * @return true if the widget is the root widget of a VPaintableWidget,
-     *         false otherwise
-     */
-    public boolean isPaintable(Widget w) {
-        return getPid(w) != null;
-    }
-
-}
diff --git a/src/com/vaadin/terminal/gwt/client/VPaintableWidget.java b/src/com/vaadin/terminal/gwt/client/VPaintableWidget.java
deleted file mode 100644 (file)
index 14f1f18..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.terminal.gwt.client;
-
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * An interface used by client-side widgets or paintable parts to receive
- * updates from the corresponding server-side components in the form of
- * {@link UIDL}.
- * 
- * Updates can be sent back to the server using the
- * {@link ApplicationConnection#updateVariable()} methods.
- */
-public interface VPaintableWidget extends VPaintable {
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.vaadin.terminal.gwt.client.VPaintable#getState()
-     */
-    public ComponentState getState();
-
-    /**
-     * TODO: Rename to getWidget
-     */
-    public Widget getWidget();
-
-    /**
-     * Returns the parent {@link VPaintableWidgetContainer}
-     * 
-     * @return
-     */
-    public VPaintableWidgetContainer getParent();
-
-    public LayoutManager getLayoutManager();
-
-    /**
-     * Returns <code>true</code> if the width of this paintable is currently
-     * undefined. If the width is undefined, the actual width of the paintable
-     * is defined by its contents.
-     * 
-     * @return <code>true</code> if the width is undefined, else
-     *         <code>false</code>
-     */
-    public boolean isUndefinedWidth();
-
-    /**
-     * Returns <code>true</code> if the height of this paintable is currently
-     * undefined. If the height is undefined, the actual height of the paintable
-     * is defined by its contents.
-     * 
-     * @return <code>true</code> if the height is undefined, else
-     *         <code>false</code>
-     */
-    public boolean isUndefinedHeight();
-
-    /**
-     * Returns <code>true</code> if the width of this paintable is currently
-     * relative. If the width is relative, the actual width of the paintable is
-     * a percentage of the size allocated to it by its parent.
-     * 
-     * @return <code>true</code> if the width is undefined, else
-     *         <code>false</code>
-     */
-    public boolean isRelativeWidth();
-
-    /**
-     * Returns <code>true</code> if the height of this paintable is currently
-     * relative. If the height is relative, the actual height of the paintable
-     * is a percentage of the size allocated to it by its parent.
-     * 
-     * @return <code>true</code> if the width is undefined, else
-     *         <code>false</code>
-     */
-    public boolean isRelativeHeight();
-
-    /**
-     * Gets the width of this paintable as defined on the server.
-     * 
-     * @return the server side width definition
-     */
-    public String getDeclaredWidth();
-
-    /**
-     * Gets the height of this paintable as defined on the server.
-     * 
-     * @return the server side height definition
-     */
-    public String getDeclaredHeight();
-}
diff --git a/src/com/vaadin/terminal/gwt/client/VPaintableWidgetContainer.java b/src/com/vaadin/terminal/gwt/client/VPaintableWidgetContainer.java
deleted file mode 100644 (file)
index da48eeb..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.terminal.gwt.client;
-
-import java.util.Collection;
-
-import com.google.gwt.user.client.ui.HasWidgets;
-
-/**
- * An interface used by client-side paintables whose widget is a component
- * container (implements {@link HasWidgets}).
- */
-public interface VPaintableWidgetContainer extends VPaintableWidget {
-
-    /**
-     * Update child components caption, description and error message.
-     * 
-     * <p>
-     * Each component is responsible for maintaining its caption, description
-     * and error message. In most cases components doesn't want to do that and
-     * those elements reside outside of the component. Because of this layouts
-     * must provide service for it's childen to show those elements for them.
-     * </p>
-     * 
-     * @param paintable
-     *            Child component for which service is requested.
-     * @param uidl
-     *            UIDL of the child component.
-     */
-    void updateCaption(VPaintableWidget paintable, UIDL uidl);
-
-    /**
-     * Returns the children for this paintable.
-     * <p>
-     * The children for this paintable are defined as all
-     * {@link VPaintableWidget}s whose parent is this
-     * {@link VPaintableWidgetContainer}.
-     * </p>
-     * 
-     * @return A collection of children for this paintable. An empty collection
-     *         if there are no children.
-     */
-    public Collection<VPaintableWidget> getChildren();
-
-}
index 0709fe531ef8c1276a6d22d7756ff398f66e53b6..c0c61971e281c9fcbe4e676551d7809e87fe8e20 100644 (file)
@@ -27,7 +27,7 @@ public class VTooltip extends VOverlay {
     private static final int QUICK_OPEN_DELAY = 100;
     VErrorMessage em = new VErrorMessage();
     Element description = DOM.createDiv();
-    private VPaintableWidget tooltipOwner;
+    private ComponentConnector tooltipOwner;
 
     private boolean closing = false;
     private boolean opening = false;
@@ -110,7 +110,7 @@ public class VTooltip extends VOverlay {
         }
     }
 
-    public void showTooltip(VPaintableWidget owner, Event event, Object key) {
+    public void showTooltip(ComponentConnector owner, Event event, Object key) {
         if (closing && tooltipOwner == owner && tooltipKey == key) {
             // return to same tooltip, cancel closing
             closeTimer.cancel();
@@ -207,7 +207,7 @@ public class VTooltip extends VOverlay {
 
     }
 
-    public void handleTooltipEvent(Event event, VPaintableWidget owner, Object key) {
+    public void handleTooltipEvent(Event event, ComponentConnector owner, Object key) {
         final int type = DOM.eventGetType(event);
         if ((VTooltip.TOOLTIP_EVENTS & type) == type) {
             if (type == Event.ONMOUSEOVER) {
index 095cb59304cc44cb5b585b03d5ce2d6b34660fb3..7e2df6e74d5678e995b65592b61953c98640b93a 100644 (file)
@@ -99,7 +99,7 @@ public class VUIDLBrowser extends SimpleTree {
 
         private String getNodeName(UIDL uidl, ApplicationConfiguration conf,
                 String name) {
-            Class<? extends VPaintableWidget> widgetClassByDecodedTag = conf
+            Class<? extends ComponentConnector> widgetClassByDecodedTag = conf
                     .getWidgetClassByEncodedTag(name);
             if (widgetClassByDecodedTag == VUnknownComponentPaintable.class) {
                 return conf.getUnknownServerClassNameByEncodedTagName(name)
@@ -128,8 +128,8 @@ public class VUIDLBrowser extends SimpleTree {
             // same
             // host page
             for (ApplicationConnection applicationConnection : runningApplications) {
-                VPaintableWidget paintable = (VPaintableWidget) VPaintableMap
-                        .get(applicationConnection).getPaintable(uidl.getId());
+                ComponentConnector paintable = (ComponentConnector) ConnectorMap
+                        .get(applicationConnection).getConnector(uidl.getId());
                 highlight(paintable);
                 if (event != null && event.getNativeEvent().getShiftKey()) {
                     applicationConnection.highlightComponent(paintable);
@@ -241,7 +241,7 @@ public class VUIDLBrowser extends SimpleTree {
         }
     }
 
-    static void highlight(VPaintableWidget paintable) {
+    static void highlight(ComponentConnector paintable) {
         if (paintable != null) {
             Widget w = paintable.getWidget();
             Style style = highlight.getStyle();
index fef88c38bfcfbb8a64dce9f5ce31ea6fedc4c48d..dd69883d5850c0a5f1b06f936b0c71d7e9f74b3a 100644 (file)
@@ -7,5 +7,5 @@ package com.vaadin.terminal.gwt.client;
  * A helper class used by WidgetMap implementation. Used by the generated code.
  */
 interface WidgetInstantiator {
-    public VPaintableWidget get();
+    public ComponentConnector get();
 }
index 3e02ad23ecd6b514e0ba7850801968bc4cf35b1d..4fcadd6398c5c2a83910a42eb1dee104931cc349 100644 (file)
@@ -10,20 +10,20 @@ abstract class WidgetMap {
     protected static HashMap<Class, WidgetInstantiator> instmap = new HashMap<Class, WidgetInstantiator>();
 
     // FIXME: Should use Paintable and not VPaintableWidget
-    public VPaintableWidget instantiate(
-            Class<? extends VPaintableWidget> classType) {
+    public ComponentConnector instantiate(
+            Class<? extends ComponentConnector> classType) {
         return instmap.get(classType).get();
     }
 
     // FIXME: Should use Paintable and not VPaintableWidget
-    public abstract Class<? extends VPaintableWidget> getImplementationByServerSideClassName(
+    public abstract Class<? extends ComponentConnector> getImplementationByServerSideClassName(
             String fullyqualifiedName);
 
     // FIXME: Should use Paintable and not VPaintableWidget
-    public abstract Class<? extends VPaintableWidget>[] getDeferredLoadedWidgets();
+    public abstract Class<? extends ComponentConnector>[] getDeferredLoadedWidgets();
 
     // FIXME: Should use Paintable and not VPaintableWidget
     public abstract void ensureInstantiator(
-            Class<? extends VPaintableWidget> classType);
+            Class<? extends ComponentConnector> classType);
 
 }
index 7874c9d068190ccf6f0cc0bace21f5454d0afe5d..189487cf5a21e89163b92603610b1eb393731027 100644 (file)
@@ -20,7 +20,7 @@ public class WidgetSet {
     /**
      * Create an uninitialized component that best matches given UIDL. The
      * component must be a {@link Widget} that implements
-     * {@link VPaintableWidget}.
+     * {@link ComponentConnector}.
      * 
      * @param tag
      *            component type tag for the component to create
@@ -30,7 +30,7 @@ public class WidgetSet {
      * @return New uninitialized and unregistered component that can paint given
      *         UIDL.
      */
-    public VPaintableWidget createWidget(String tag,
+    public ComponentConnector createWidget(String tag,
             ApplicationConfiguration conf) {
         /*
          * Yes, this (including the generated code in WidgetMap) may look very
@@ -40,7 +40,7 @@ public class WidgetSet {
          * has no "native" counterpart on client side.
          */
 
-        Class<? extends VPaintableWidget> classType = resolveWidgetType(tag,
+        Class<? extends ComponentConnector> classType = resolveWidgetType(tag,
                 conf);
 
         if (classType == null || classType == VUnknownComponentPaintable.class) {
@@ -59,9 +59,9 @@ public class WidgetSet {
 
     }
 
-    protected Class<? extends VPaintableWidget> resolveWidgetType(String tag,
+    protected Class<? extends ComponentConnector> resolveWidgetType(String tag,
             ApplicationConfiguration conf) {
-        Class<? extends VPaintableWidget> widgetClass = conf
+        Class<? extends ComponentConnector> widgetClass = conf
                 .getWidgetClassByEncodedTag(tag);
 
         return widgetClass;
@@ -77,23 +77,23 @@ public class WidgetSet {
      * @param applicationConfiguration
      * @return
      */
-    public Class<? extends VPaintableWidget> getImplementationByClassName(
+    public Class<? extends ComponentConnector> getImplementationByClassName(
             String fullyqualifiedName) {
         if (fullyqualifiedName == null) {
             return VUnknownComponentPaintable.class;
         }
-        Class<? extends VPaintableWidget> implementationByServerSideClassName = widgetMap
+        Class<? extends ComponentConnector> implementationByServerSideClassName = widgetMap
                 .getImplementationByServerSideClassName(fullyqualifiedName);
 
         return implementationByServerSideClassName;
 
     }
 
-    public Class<? extends VPaintableWidget>[] getDeferredLoadedWidgets() {
+    public Class<? extends ComponentConnector>[] getDeferredLoadedWidgets() {
         return widgetMap.getDeferredLoadedWidgets();
     }
 
-    public void loadImplementation(Class<? extends VPaintableWidget> nextType) {
+    public void loadImplementation(Class<? extends ComponentConnector> nextType) {
         widgetMap.ensureInstantiator(nextType);
     }
 
index aeb66643d923c18ebc342323f0b3253e21b3d2da..a2b023962e519370397479bec9cb3639557820a0 100644 (file)
@@ -29,6 +29,6 @@ public interface ClientToServerRpc extends Serializable {
      * @since 7.0
      */
     public interface InitializableClientToServerRpc extends ClientToServerRpc {
-        public void initRpc(String paintableId, ApplicationConnection client);
+        public void initRpc(String connectorId, ApplicationConnection client);
     }
 }
index bc46104c66a4a9075a89873015b242d8c7974752..b3106dddff7bcdd689ecf58532a4bfab54d8c931 100644 (file)
@@ -14,8 +14,8 @@ import com.google.gwt.core.client.GWT;
 import com.google.gwt.json.client.JSONArray;
 import com.google.gwt.json.client.JSONObject;
 import com.google.gwt.json.client.JSONString;
-import com.vaadin.terminal.gwt.client.VPaintable;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
+import com.vaadin.terminal.gwt.client.Connector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
 
 /**
  * Client side decoder for converting shared state and other values from JSON
@@ -39,17 +39,17 @@ public class JsonDecoder {
      * @param jsonArray
      *            JSON array with two elements
      * @param idMapper
-     *            mapper between paintable ID and {@link VPaintable} objects
+     *            mapper between connector ID and {@link Connector} objects
      * @return converted value (does not contain JSON types)
      */
     public static Object convertValue(JSONArray jsonArray,
-            VPaintableMap idMapper) {
+            ConnectorMap idMapper) {
         String type = ((JSONString) jsonArray.get(0)).stringValue();
         return convertValue(type, jsonArray.get(1), idMapper);
     }
 
     private static Object convertValue(String variableType, Object value,
-            VPaintableMap idMapper) {
+            ConnectorMap idMapper) {
         Object val = null;
         // TODO type checks etc.
         if (JsonEncoder.VTYPE_UNDEFINED.equals(variableType)) {
@@ -79,7 +79,7 @@ public class JsonDecoder {
             val = Boolean.valueOf(String.valueOf(value));
         } else if (JsonEncoder.VTYPE_PAINTABLE.equals(variableType)) {
             // TODO handle properly
-            val = idMapper.getPaintable(String.valueOf(value));
+            val = idMapper.getConnector(String.valueOf(value));
         } else {
             // object, class name as type
             VaadinSerializer serializer = serializerMap
@@ -94,7 +94,7 @@ public class JsonDecoder {
     }
 
     private static Map<String, Object> convertMap(JSONObject jsonMap,
-            VPaintableMap idMapper) {
+            ConnectorMap idMapper) {
         HashMap<String, Object> map = new HashMap<String, Object>();
         Iterator<String> it = jsonMap.keySet().iterator();
         while (it.hasNext()) {
@@ -114,7 +114,7 @@ public class JsonDecoder {
     }
 
     private static Object[] convertArray(JSONArray jsonArray,
-            VPaintableMap idMapper) {
+            ConnectorMap idMapper) {
         List<Object> tokens = new ArrayList<Object>();
         for (int i = 0; i < jsonArray.size(); ++i) {
             // each entry always has two elements: type and value
index d1cb9a3ab99196973abc22858934039bcac840e7..21cb94753a236b5aee1852c213f86a9b1c589ea0 100644 (file)
@@ -12,8 +12,8 @@ import com.google.gwt.json.client.JSONNull;
 import com.google.gwt.json.client.JSONObject;
 import com.google.gwt.json.client.JSONString;
 import com.google.gwt.json.client.JSONValue;
-import com.vaadin.terminal.gwt.client.VPaintable;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
+import com.vaadin.terminal.gwt.client.Connector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
 
 /**
  * Encoder for converting RPC parameters and other values to JSON for transfer
@@ -50,11 +50,11 @@ public class JsonEncoder {
      * 
      * @param value
      *            value to convert
-     * @param paintableMap
-     *            mapper from paintables to paintable IDs
+     * @param connectorMap
+     *            mapper from connectors to connector IDs
      * @return JSON representation of the value
      */
-    public static JSONValue encode(Object value, VPaintableMap paintableMap) {
+    public static JSONValue encode(Object value, ConnectorMap connectorMap) {
         if (null == value) {
             // TODO as undefined type?
             return combineTypeAndValue(VTYPE_UNDEFINED, JSONNull.getInstance());
@@ -76,7 +76,7 @@ public class JsonEncoder {
             JSONArray jsonArray = new JSONArray();
             for (int i = 0; i < array.length; ++i) {
                 // TODO handle object graph loops?
-                jsonArray.set(i, encode(array[i], paintableMap));
+                jsonArray.set(i, encode(array[i], connectorMap));
             }
             return combineTypeAndValue(VTYPE_ARRAY, jsonArray);
         } else if (value instanceof Map) {
@@ -85,13 +85,13 @@ public class JsonEncoder {
             for (String mapKey : map.keySet()) {
                 // TODO handle object graph loops?
                 Object mapValue = map.get(mapKey);
-                jsonMap.put(mapKey, encode(mapValue, paintableMap));
+                jsonMap.put(mapKey, encode(mapValue, connectorMap));
             }
             return combineTypeAndValue(VTYPE_MAP, jsonMap);
-        } else if (value instanceof VPaintable) {
-            VPaintable paintable = (VPaintable) value;
+        } else if (value instanceof Connector) {
+            Connector paintable = (Connector) value;
             return combineTypeAndValue(VTYPE_PAINTABLE, new JSONString(
-                    paintableMap.getPid(paintable)));
+                    connectorMap.getConnectorId(paintable)));
         } else {
             return combineTypeAndValue(getTransportType(value), new JSONString(
                     String.valueOf(value)));
@@ -108,7 +108,7 @@ public class JsonEncoder {
     private static String getTransportType(Object value) {
         if (value instanceof String) {
             return VTYPE_STRING;
-        } else if (value instanceof VPaintable) {
+        } else if (value instanceof Connector) {
             return VTYPE_PAINTABLE;
         } else if (value instanceof Boolean) {
             return VTYPE_BOOLEAN;
index f13041d42afe000c49dbe99245fd944f49f63066..b1c5b20e0df70fe62702be049f537d62dbc976e1 100644 (file)
@@ -6,7 +6,7 @@ package com.vaadin.terminal.gwt.client.communication;
 
 import java.io.Serializable;
 
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 
 /**
  * Interface to be implemented by all shared state classes used to communicate
@@ -33,8 +33,8 @@ import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
  * supported data types.
  * 
  * On the client side, for most widgets,
- * {@link VAbstractPaintableWidget#createState()} and
- * {@link VAbstractPaintableWidget#getState()} methods should be overridden to
+ * {@link AbstractComponentConnector#createState()} and
+ * {@link AbstractComponentConnector#getState()} methods should be overridden to
  * create and use a shared state instance of the correct type.
  * 
  * Subclasses of a paintable using shared state should also provide a subclass
index 02484b1e74dbb8046f5e6df6fd9d913ac29ff7b4..c8cf869e0115fc738d9300e0befacce8308e6db9 100644 (file)
@@ -5,7 +5,7 @@
 package com.vaadin.terminal.gwt.client.communication;
 
 import com.google.gwt.json.client.JSONObject;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
 
 /**
  * Serializer that can deserialize custom objects received from the server.
@@ -28,6 +28,6 @@ public interface VaadinSerializer {
      * @return deserialized object
      */
     // TODO Object -> something
-    Object deserialize(JSONObject jsonValue, VPaintableMap idMapper);
+    Object deserialize(JSONObject jsonValue, ConnectorMap idMapper);
 
 }
diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java
new file mode 100644 (file)
index 0000000..85ef32d
--- /dev/null
@@ -0,0 +1,476 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.FocusWidget;
+import com.google.gwt.user.client.ui.Focusable;
+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.LayoutManager;
+import com.vaadin.terminal.gwt.client.TooltipInfo;
+import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.VConsole;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ComponentContainerConnector;
+import com.vaadin.terminal.gwt.client.communication.ClientToServerRpc;
+import com.vaadin.terminal.gwt.client.communication.ClientToServerRpc.InitializableClientToServerRpc;
+import com.vaadin.terminal.gwt.client.communication.SharedState;
+
+public abstract class AbstractComponentConnector implements ComponentConnector {
+
+    // Generic UIDL parameter names, to be moved to shared state.
+    // Attributes are here mainly if they apply to all paintable widgets or
+    // affect captions - otherwise, they are in the relevant subclasses.
+    // For e.g. item or context specific attributes, subclasses may use separate
+    // constants, which may refer to these.
+    // Not all references to the string literals have been converted to use
+    // these!
+    public static final String ATTRIBUTE_ICON = "icon";
+    public static final String ATTRIBUTE_REQUIRED = "required";
+    public static final String ATTRIBUTE_ERROR = "error";
+    public static final String ATTRIBUTE_HIDEERRORS = "hideErrors";
+
+    private Widget widget;
+    private ApplicationConnection connection;
+    private String id;
+
+    /* State variables */
+    private boolean enabled = true;
+    private boolean visible = true;
+
+    // shared state from the server to the client
+    private ComponentState state;
+
+    private String declaredWidth = "";
+    private String declaredHeight = "";
+
+    /**
+     * Default constructor
+     */
+    public AbstractComponentConnector() {
+    }
+
+    /**
+     * Called after the application connection reference has been set up
+     */
+    public void init() {
+    }
+
+    /**
+     * Creates and returns the widget for this VPaintableWidget. This method
+     * should only be called once when initializing the paintable.
+     * 
+     * @return
+     */
+    protected abstract Widget createWidget();
+
+    /**
+     * Returns the widget associated with this paintable. The widget returned by
+     * this method must not changed during the life time of the paintable.
+     * 
+     * @return The widget associated with this paintable
+     */
+    public Widget getWidget() {
+        if (widget == null) {
+            widget = createWidget();
+        }
+
+        return widget;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.vaadin.terminal.gwt.client.VPaintable#getConnection()
+     */
+    public final ApplicationConnection getConnection() {
+        return connection;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * com.vaadin.terminal.gwt.client.VPaintable#setConnection(com.vaadin.terminal
+     * .gwt.client.ApplicationConnection)
+     */
+    public final void setConnection(ApplicationConnection connection) {
+        this.connection = connection;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    /**
+     * 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.
+     * 
+     * If overriding this method to return a more specific type, also
+     * {@link #createState()} must be overridden.
+     * 
+     * @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 ComponentContainerConnector getParent() {
+        // FIXME: Hierarchy should be set by framework instead of looked up here
+        ConnectorMap paintableMap = ConnectorMap.get(getConnection());
+
+        Widget w = getWidget();
+        while (true) {
+            w = w.getParent();
+            if (w == null) {
+                return null;
+            }
+            if (paintableMap.isConnector(w)) {
+                return (ComponentContainerConnector) paintableMap.getConnector(w);
+            }
+        }
+    }
+
+    protected static boolean isRealUpdate(UIDL uidl) {
+        return !isCachedUpdate(uidl) && !uidl.getBooleanAttribute("invisible")
+                && !uidl.hasAttribute("deferred");
+    }
+
+    protected static boolean isCachedUpdate(UIDL uidl) {
+        return uidl.getBooleanAttribute("cached");
+    }
+
+    public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+        if (isCachedUpdate(uidl)) {
+            return;
+        }
+
+        ConnectorMap paintableMap = ConnectorMap.get(getConnection());
+        // register the listened events by the server-side to the event-handler
+        // of the component
+        paintableMap.registerEventListenersFromUIDL(getId(), uidl);
+
+        // Visibility
+        setVisible(!uidl.getBooleanAttribute("invisible"), uidl);
+
+        if (uidl.getId().startsWith("PID_S")) {
+            DOM.setElementProperty(getWidget().getElement(), "id",
+                    uidl.getId().substring(5));
+        }
+
+        if (!isVisible()) {
+            // component is invisible, delete old size to notify parent, if
+            // later made visible
+            paintableMap.setOffsetSize(this, null);
+            return;
+        }
+
+        if (!isRealUpdate(uidl)) {
+            return;
+        }
+
+        /*
+         * Disabled state may affect (override) tabindex so the order must be
+         * first setting tabindex, then enabled state.
+         */
+        if (uidl.hasAttribute("tabindex")
+                && getWidget() instanceof Focusable) {
+            ((Focusable) getWidget()).setTabIndex(uidl
+                    .getIntAttribute("tabindex"));
+        }
+        setEnabled(!getState().isDisabled());
+
+        // Style names
+        String styleName = getStyleNameFromUIDL(getWidget()
+                .getStylePrimaryName(), uidl, getState(),
+                getWidget() instanceof Field);
+        getWidget().setStyleName(styleName);
+
+        // Update tooltip
+        TooltipInfo tooltipInfo = paintableMap.getTooltipInfo(this, null);
+        if (getState().hasDescription()) {
+            tooltipInfo.setTitle(getState().getDescription());
+        } else {
+            tooltipInfo.setTitle(null);
+        }
+        // add error info to tooltip if present
+        if (uidl.hasAttribute(ATTRIBUTE_ERROR)) {
+            tooltipInfo.setErrorUidl(uidl.getErrors());
+        } else {
+            tooltipInfo.setErrorUidl(null);
+        }
+
+        // Set captions
+        if (delegateCaptionHandling()) {
+            getParent().updateCaption(this, uidl);
+        }
+
+        /*
+         * updateComponentSize need to be after caption update so caption can be
+         * taken into account
+         */
+
+        updateComponentSize();
+    }
+
+    private void updateComponentSize() {
+        SharedState state = getState();
+
+        String w = "";
+        String h = "";
+        if (null != state || !(state instanceof ComponentState)) {
+            ComponentState componentState = (ComponentState) state;
+            // TODO move logging to VUIDLBrowser and VDebugConsole
+            // VConsole.log("Paintable state for "
+            // + getPaintableMap().getPid(paintable) + ": "
+            // + String.valueOf(state.getState()));
+            h = componentState.getHeight();
+            w = componentState.getWidth();
+        } else {
+            // TODO move logging to VUIDLBrowser and VDebugConsole
+            VConsole.log("No state for paintable " + getId()
+                    + " in VAbstractPaintableWidget.updateComponentSize()");
+        }
+
+        // Parent should be updated if either dimension changed between relative
+        // and non-relative
+        if (w.endsWith("%") != declaredWidth.endsWith("%")) {
+            ComponentContainerConnector parent = getParent();
+            if (parent instanceof ManagedLayout) {
+                getLayoutManager().setWidthNeedsUpdate((ManagedLayout) parent);
+            }
+        }
+
+        if (h.endsWith("%") != declaredHeight.endsWith("%")) {
+            ComponentContainerConnector parent = getParent();
+            if (parent instanceof ManagedLayout) {
+                getLayoutManager().setHeightNeedsUpdate((ManagedLayout) parent);
+            }
+        }
+
+        declaredWidth = w;
+        declaredHeight = h;
+
+        // Set defined sizes
+        Widget component = getWidget();
+
+        component.setStyleName("v-undefined-width", isUndefinedWidth());
+        component.setStyleName("v-undefined-height", isUndefinedHeight());
+
+        component.setHeight(h);
+        component.setWidth(w);
+    }
+
+    public boolean isRelativeHeight() {
+        return declaredHeight.endsWith("%");
+    }
+
+    public boolean isRelativeWidth() {
+        return declaredWidth.endsWith("%");
+    }
+
+    public boolean isUndefinedHeight() {
+        return declaredHeight.length() == 0;
+    }
+
+    public boolean isUndefinedWidth() {
+        return declaredWidth.length() == 0;
+    }
+
+    public String getDeclaredHeight() {
+        return declaredHeight;
+    }
+
+    public String getDeclaredWidth() {
+        return declaredWidth;
+    }
+
+    /**
+     * Sets the enabled state of this paintable
+     * 
+     * @param enabled
+     *            true if the paintable is enabled, false otherwise
+     */
+    protected void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+
+        if (getWidget() instanceof FocusWidget) {
+            FocusWidget fw = (FocusWidget) getWidget();
+            fw.setEnabled(enabled);
+        }
+
+    }
+
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    /**
+     * Return true if parent handles caption, false if the paintable handles the
+     * caption itself.
+     * 
+     * 
+     * @deprecated This should always return true and all components should let
+     *             the parent handle the caption and use other attributes for
+     *             internal texts in the component
+     * @return
+     */
+    @Deprecated
+    protected boolean delegateCaptionHandling() {
+        return true;
+    }
+
+    /**
+     * Sets the visible state for this paintable.
+     * 
+     * @param visible
+     *            true if the paintable should be made visible, false otherwise
+     * @param captionUidl
+     *            The UIDL that is passed to the parent and onwards to VCaption
+     *            if the caption needs to be updated as a result of the
+     *            visibility change.
+     */
+    protected void setVisible(boolean visible, UIDL captionUidl) {
+        boolean wasVisible = this.visible;
+        this.visible = visible;
+
+        getWidget().setVisible(visible);
+        if (wasVisible != visible) {
+            // Changed invisibile <-> visible
+            if (wasVisible && delegateCaptionHandling()) {
+                // Must hide caption when component is hidden
+                getParent().updateCaption(this, captionUidl);
+            }
+        }
+    }
+
+    protected boolean isVisible() {
+        return visible;
+    }
+
+    /**
+     * Generates the style name for the widget based on the given primary style
+     * name (typically returned by Widget.getPrimaryStyleName()) and the UIDL
+     * and shared state of the component. An additional "modified" style name
+     * can be added if the field parameter is set to true.
+     * 
+     * @param primaryStyleName
+     * @param uidl
+     * @param state
+     *            component shared state
+     * @param field
+     * @return
+     */
+    protected static String getStyleNameFromUIDL(String primaryStyleName,
+            UIDL uidl, ComponentState state, boolean field) {
+        boolean enabled = !state.isDisabled();
+
+        StringBuffer styleBuf = new StringBuffer();
+        styleBuf.append(primaryStyleName);
+        styleBuf.append(" v-paintable");
+
+        // first disabling and read-only status
+        if (!enabled) {
+            styleBuf.append(" ");
+            styleBuf.append(ApplicationConnection.DISABLED_CLASSNAME);
+        }
+        if (state.isReadOnly()) {
+            styleBuf.append(" ");
+            styleBuf.append("v-readonly");
+        }
+
+        // add additional styles as css classes, prefixed with component default
+        // stylename
+        if (state.hasStyles()) {
+            final String[] styles = state.getStyle().split(" ");
+            for (int i = 0; i < styles.length; i++) {
+                styleBuf.append(" ");
+                styleBuf.append(primaryStyleName);
+                styleBuf.append("-");
+                styleBuf.append(styles[i]);
+                styleBuf.append(" ");
+                styleBuf.append(styles[i]);
+            }
+        }
+
+        // add modified classname to Fields
+        if (field && uidl.hasAttribute("modified")) {
+            styleBuf.append(" ");
+            styleBuf.append(ApplicationConnection.MODIFIED_CLASSNAME);
+        }
+
+        // add error classname to components w/ error
+        if (uidl.hasAttribute(ATTRIBUTE_ERROR)) {
+            styleBuf.append(" ");
+            styleBuf.append(primaryStyleName);
+            styleBuf.append(ApplicationConnection.ERROR_CLASSNAME_EXT);
+        }
+        // add required style to required components
+        if (uidl.hasAttribute(ATTRIBUTE_REQUIRED)) {
+            styleBuf.append(" ");
+            styleBuf.append(primaryStyleName);
+            styleBuf.append(ApplicationConnection.REQUIRED_CLASSNAME_EXT);
+        }
+
+        return styleBuf.toString();
+    }
+
+    /**
+     * Sets the shared state for the paintable widget.
+     * 
+     * @param new shared state (must be compatible with the return value of
+     *        {@link #getState()} - {@link ComponentState} if
+     *        {@link #getState()} is not overridden
+     */
+    public final void setState(SharedState state) {
+        this.state = (ComponentState) state;
+    }
+
+    /**
+     * Initialize the given RPC proxy object so it is connected to this
+     * paintable.
+     * 
+     * @param clientToServerRpc
+     *            The RPC instance to initialize. Must have been created using
+     *            GWT.create().
+     */
+    protected <T extends ClientToServerRpc> T initRPC(T clientToServerRpc) {
+        ((InitializableClientToServerRpc) clientToServerRpc).initRpc(getId(),
+                getConnection());
+        return clientToServerRpc;
+    }
+
+    public LayoutManager getLayoutManager() {
+        return LayoutManager.get(connection);
+    }
+}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentContainerConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentContainerConnector.java
new file mode 100644 (file)
index 0000000..1242f1c
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import com.google.gwt.user.client.ui.HasOneWidget;
+import com.google.gwt.user.client.ui.HasWidgets;
+import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ComponentContainerConnector;
+
+public abstract class AbstractComponentContainerConnector extends
+        AbstractComponentConnector implements ComponentContainerConnector {
+
+    /**
+     * Default constructor
+     */
+    public AbstractComponentContainerConnector() {
+    }
+
+    public Collection<ComponentConnector> getChildren() {
+        Collection<ComponentConnector> children = new ArrayList<ComponentConnector>();
+
+        addDescendantPaintables(getWidget(), children,
+                ConnectorMap.get(getConnection()));
+
+        return children;
+    }
+
+    private static void addDescendantPaintables(Widget widget,
+            Collection<ComponentConnector> paintables, ConnectorMap paintableMap) {
+        // FIXME: Store hierarchy instead of doing lookup every time
+
+        if (widget instanceof HasWidgets) {
+            for (Widget child : (HasWidgets) widget) {
+                addIfPaintable(child, paintables, paintableMap);
+            }
+        } else if (widget instanceof HasOneWidget) {
+            Widget child = ((HasOneWidget) widget).getWidget();
+            addIfPaintable(child, paintables, paintableMap);
+        }
+    }
+
+    private static void addIfPaintable(Widget widget,
+            Collection<ComponentConnector> paintables, ConnectorMap paintableMap) {
+        ComponentConnector paintable = paintableMap.getConnector(widget);
+        if (paintable != null) {
+            // If widget is a paintable, add it to the collection
+            paintables.add(paintable);
+        } else {
+            // Else keep looking for paintables inside the widget
+            addDescendantPaintables(widget, paintables, paintableMap);
+        }
+    }
+
+}
index 34aa3259da1b233a7c2649461c0fcde1abedd741..c941b3c38af24815d76ff7b2890b359c5fc5310d 100644 (file)
@@ -19,8 +19,8 @@ import com.google.gwt.event.shared.HandlerRegistration;
 import com.google.gwt.user.client.Element;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 public abstract class ClickEventHandler implements DoubleClickHandler,
         ContextMenuHandler, MouseUpHandler {
@@ -30,10 +30,10 @@ public abstract class ClickEventHandler implements DoubleClickHandler,
     private HandlerRegistration contextMenuHandlerRegistration;
 
     protected String clickEventIdentifier;
-    protected VPaintableWidget paintable;
+    protected ComponentConnector paintable;
     private ApplicationConnection client;
 
-    public ClickEventHandler(VPaintableWidget paintable,
+    public ClickEventHandler(ComponentConnector paintable,
             String clickEventIdentifier) {
         this.paintable = paintable;
         this.clickEventIdentifier = clickEventIdentifier;
@@ -82,7 +82,7 @@ public abstract class ClickEventHandler implements DoubleClickHandler,
 
     protected void fireClick(NativeEvent event) {
         ApplicationConnection client = getApplicationConnection();
-        String pid = VPaintableMap.get(getApplicationConnection()).getPid(
+        String pid = ConnectorMap.get(getApplicationConnection()).getConnectorId(
                 paintable);
 
         MouseEventDetails mouseDetails = new MouseEventDetails(event,
index 896b992afc52ab75ce1e9a64dd8b1b6733310a26..8dcdcc766b394b656c5909c9f4d46927d13dbdaa 100644 (file)
@@ -10,27 +10,27 @@ import com.google.gwt.dom.client.NativeEvent;
 import com.google.gwt.user.client.Element;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 public abstract class LayoutClickEventHandler extends ClickEventHandler {
 
-    public LayoutClickEventHandler(VPaintableWidget paintable,
+    public LayoutClickEventHandler(ComponentConnector paintable,
             String clickEventIdentifier) {
         super(paintable, clickEventIdentifier);
     }
 
-    protected abstract VPaintableWidget getChildComponent(Element element);
+    protected abstract ComponentConnector getChildComponent(Element element);
 
     @Override
     protected void fireClick(NativeEvent event) {
         ApplicationConnection client = getApplicationConnection();
-        String pid = VPaintableMap.get(getApplicationConnection()).getPid(
+        String pid = ConnectorMap.get(getApplicationConnection()).getConnectorId(
                 paintable);
 
         MouseEventDetails mouseDetails = new MouseEventDetails(event,
                 getRelativeToElement());
-        VPaintableWidget childComponent = getChildComponent((Element) event
+        ComponentConnector childComponent = getChildComponent((Element) event
                 .getEventTarget().cast());
 
         Map<String, Object> parameters = new HashMap<String, Object>();
index 8941b6821ef9bb9da385d095785efbaa850037ef..6d0271ee40c2cfbb2da0dde4d4b1aa42f37e8c07 100644 (file)
@@ -3,8 +3,8 @@
  */
 package com.vaadin.terminal.gwt.client.ui;
 
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public interface ManagedLayout extends VPaintableWidget {
+public interface ManagedLayout extends ComponentConnector {
 
 }
index a90c0c33ff6e3271bed94ef0047e733a8c5c6fa8..d2473cae21586a2c8b4d9b1c558bfa3673a112fa 100644 (file)
@@ -19,7 +19,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.richtextarea.VRichTextArea;
 
 /**
@@ -49,12 +49,12 @@ public class ShortcutActionHandler {
     }
 
     /**
-     * A focusable {@link VPaintableWidget} implementing this interface will be
+     * A focusable {@link ComponentConnector} implementing this interface will be
      * notified before shortcut actions are handled if it will be the target of
      * the action (most commonly means it is the focused component during the
      * keyboard combination is triggered by the user).
      */
-    public interface BeforeShortcutActionListener extends VPaintableWidget {
+    public interface BeforeShortcutActionListener extends ComponentConnector {
         /**
          * This method is called by ShortcutActionHandler before firing the
          * shortcut if the Paintable is currently focused (aka the target of the
@@ -108,7 +108,7 @@ public class ShortcutActionHandler {
         }
     }
 
-    public void handleKeyboardEvent(final Event event, VPaintableWidget target) {
+    public void handleKeyboardEvent(final Event event, ComponentConnector target) {
         final int modifiers = KeyboardListenerCollection
                 .getKeyboardModifiers(event);
         final char keyCode = (char) DOM.eventGetKeyCode(event);
@@ -130,12 +130,12 @@ public class ShortcutActionHandler {
     }
 
     private void fireAction(final Event event, final ShortcutAction a,
-            VPaintableWidget target) {
+            ComponentConnector target) {
         final Element et = DOM.eventGetTarget(event);
         if (target == null) {
             target = Util.findPaintable(client, et);
         }
-        final VPaintableWidget finalTarget = target;
+        final ComponentConnector finalTarget = target;
 
         event.preventDefault();
 
index 018200ab0584ade569b175b024d0d03919d45b51..ed3521335a991b4a4bc24648b2cdc9afc3e3f3e1 100644 (file)
@@ -5,9 +5,9 @@
 package com.vaadin.terminal.gwt.client.ui;
 
 import com.google.gwt.user.client.ui.HasWidgets;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public interface Table extends VPaintableWidget, HasWidgets {
+public interface Table extends ComponentConnector, HasWidgets {
     final int SELECT_MODE_NONE = 0;
     final int SELECT_MODE_SINGLE = 1;
     final int SELECT_MODE_MULTI = 2;
index 91c356197d06ea617fd99fe9c49d45f777201b37..b8774ea9990df82c29e95fbf0051e88439660da8 100644 (file)
@@ -18,8 +18,8 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 public class VAbsoluteLayout extends ComplexPanel {
 
@@ -90,10 +90,10 @@ public class VAbsoluteLayout extends ComplexPanel {
         String bottom;
         private String zIndex;
 
-        private VPaintableWidget paintable;
+        private ComponentConnector paintable;
         private VCaption caption;
 
-        public AbsoluteWrapper(VPaintableWidget paintable) {
+        public AbsoluteWrapper(ComponentConnector paintable) {
             this.paintable = paintable;
             setStyleName(CLASSNAME + "-wrapper");
         }
@@ -120,7 +120,7 @@ public class VAbsoluteLayout extends ComplexPanel {
         @Override
         public void setWidget(Widget w) {
             // this fixes #5457 (Widget implementation can change on-the-fly)
-            paintable = VPaintableMap.get(client).getPaintable(w);
+            paintable = ConnectorMap.get(client).getConnector(w);
             super.setWidget(w);
         }
 
@@ -211,7 +211,7 @@ public class VAbsoluteLayout extends ComplexPanel {
      * @return The Paintable which the element is a part of. Null if the element
      *         belongs to the layout and not to a child.
      */
-    VPaintableWidget getComponent(Element element) {
+    ComponentConnector getComponent(Element element) {
         return Util.getPaintableForElement(client, this, element);
     }
 
index 39620bfe047c1d98fbdb59e0d9ced73280a7a1a3..5b4821519beb556d725578907e37972c2d9489ec 100644 (file)
@@ -18,17 +18,17 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.DirectionalManagedLayout;
 import com.vaadin.terminal.gwt.client.EventId;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.VAbsoluteLayout.AbsoluteWrapper;
 
-public class VAbsoluteLayoutPaintable extends VAbstractPaintableWidgetContainer
+public class VAbsoluteLayoutPaintable extends AbstractComponentContainerConnector
         implements DirectionalManagedLayout {
 
     private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler(
             this, EventId.LAYOUT_CLICK) {
 
         @Override
-        protected VPaintableWidget getChildComponent(Element element) {
+        protected ComponentConnector getChildComponent(Element element) {
             return getWidget().getComponent(element);
         }
 
@@ -72,7 +72,7 @@ public class VAbsoluteLayoutPaintable extends VAbstractPaintableWidgetContainer
         }
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         AbsoluteWrapper parent2 = (AbsoluteWrapper) (component
                 .getWidget()).getParent();
         parent2.updateCaption(uidl);
@@ -90,7 +90,7 @@ public class VAbsoluteLayoutPaintable extends VAbstractPaintableWidgetContainer
 
     public void layoutVertically() {
         VAbsoluteLayout layout = getWidget();
-        for (VPaintableWidget paintable : getChildren()) {
+        for (ComponentConnector paintable : getChildren()) {
             Widget widget = paintable.getWidget();
             AbsoluteWrapper wrapper = (AbsoluteWrapper) widget.getParent();
             Style wrapperStyle = wrapper.getElement().getStyle();
@@ -121,7 +121,7 @@ public class VAbsoluteLayoutPaintable extends VAbstractPaintableWidgetContainer
 
     public void layoutHorizontally() {
         VAbsoluteLayout layout = getWidget();
-        for (VPaintableWidget paintable : getChildren()) {
+        for (ComponentConnector paintable : getChildren()) {
             Widget widget = paintable.getWidget();
             AbsoluteWrapper wrapper = (AbsoluteWrapper) widget.getParent();
             Style wrapperStyle = wrapper.getElement().getStyle();
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidget.java b/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidget.java
deleted file mode 100644 (file)
index 9d4d7e7..0000000
+++ /dev/null
@@ -1,476 +0,0 @@
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.FocusWidget;
-import com.google.gwt.user.client.ui.Focusable;
-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.LayoutManager;
-import com.vaadin.terminal.gwt.client.TooltipInfo;
-import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
-import com.vaadin.terminal.gwt.client.VPaintableWidgetContainer;
-import com.vaadin.terminal.gwt.client.communication.ClientToServerRpc;
-import com.vaadin.terminal.gwt.client.communication.ClientToServerRpc.InitializableClientToServerRpc;
-import com.vaadin.terminal.gwt.client.communication.SharedState;
-
-public abstract class VAbstractPaintableWidget implements VPaintableWidget {
-
-    // Generic UIDL parameter names, to be moved to shared state.
-    // Attributes are here mainly if they apply to all paintable widgets or
-    // affect captions - otherwise, they are in the relevant subclasses.
-    // For e.g. item or context specific attributes, subclasses may use separate
-    // constants, which may refer to these.
-    // Not all references to the string literals have been converted to use
-    // these!
-    public static final String ATTRIBUTE_ICON = "icon";
-    public static final String ATTRIBUTE_REQUIRED = "required";
-    public static final String ATTRIBUTE_ERROR = "error";
-    public static final String ATTRIBUTE_HIDEERRORS = "hideErrors";
-
-    private Widget widget;
-    private ApplicationConnection connection;
-    private String id;
-
-    /* State variables */
-    private boolean enabled = true;
-    private boolean visible = true;
-
-    // shared state from the server to the client
-    private ComponentState state;
-
-    private String declaredWidth = "";
-    private String declaredHeight = "";
-
-    /**
-     * Default constructor
-     */
-    public VAbstractPaintableWidget() {
-    }
-
-    /**
-     * Called after the application connection reference has been set up
-     */
-    public void init() {
-    }
-
-    /**
-     * Creates and returns the widget for this VPaintableWidget. This method
-     * should only be called once when initializing the paintable.
-     * 
-     * @return
-     */
-    protected abstract Widget createWidget();
-
-    /**
-     * Returns the widget associated with this paintable. The widget returned by
-     * this method must not changed during the life time of the paintable.
-     * 
-     * @return The widget associated with this paintable
-     */
-    public Widget getWidget() {
-        if (widget == null) {
-            widget = createWidget();
-        }
-
-        return widget;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.vaadin.terminal.gwt.client.VPaintable#getConnection()
-     */
-    public final ApplicationConnection getConnection() {
-        return connection;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * com.vaadin.terminal.gwt.client.VPaintable#setConnection(com.vaadin.terminal
-     * .gwt.client.ApplicationConnection)
-     */
-    public final void setConnection(ApplicationConnection connection) {
-        this.connection = connection;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    /**
-     * 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.
-     * 
-     * If overriding this method to return a more specific type, also
-     * {@link #createState()} must be overridden.
-     * 
-     * @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 VPaintableWidgetContainer getParent() {
-        // FIXME: Hierarchy should be set by framework instead of looked up here
-        VPaintableMap paintableMap = VPaintableMap.get(getConnection());
-
-        Widget w = getWidget();
-        while (true) {
-            w = w.getParent();
-            if (w == null) {
-                return null;
-            }
-            if (paintableMap.isPaintable(w)) {
-                return (VPaintableWidgetContainer) paintableMap.getPaintable(w);
-            }
-        }
-    }
-
-    protected static boolean isRealUpdate(UIDL uidl) {
-        return !isCachedUpdate(uidl) && !uidl.getBooleanAttribute("invisible")
-                && !uidl.hasAttribute("deferred");
-    }
-
-    protected static boolean isCachedUpdate(UIDL uidl) {
-        return uidl.getBooleanAttribute("cached");
-    }
-
-    public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
-        if (isCachedUpdate(uidl)) {
-            return;
-        }
-
-        VPaintableMap paintableMap = VPaintableMap.get(getConnection());
-        // register the listened events by the server-side to the event-handler
-        // of the component
-        paintableMap.registerEventListenersFromUIDL(getId(), uidl);
-
-        // Visibility
-        setVisible(!uidl.getBooleanAttribute("invisible"), uidl);
-
-        if (uidl.getId().startsWith("PID_S")) {
-            DOM.setElementProperty(getWidget().getElement(), "id",
-                    uidl.getId().substring(5));
-        }
-
-        if (!isVisible()) {
-            // component is invisible, delete old size to notify parent, if
-            // later made visible
-            paintableMap.setOffsetSize(this, null);
-            return;
-        }
-
-        if (!isRealUpdate(uidl)) {
-            return;
-        }
-
-        /*
-         * Disabled state may affect (override) tabindex so the order must be
-         * first setting tabindex, then enabled state.
-         */
-        if (uidl.hasAttribute("tabindex")
-                && getWidget() instanceof Focusable) {
-            ((Focusable) getWidget()).setTabIndex(uidl
-                    .getIntAttribute("tabindex"));
-        }
-        setEnabled(!getState().isDisabled());
-
-        // Style names
-        String styleName = getStyleNameFromUIDL(getWidget()
-                .getStylePrimaryName(), uidl, getState(),
-                getWidget() instanceof Field);
-        getWidget().setStyleName(styleName);
-
-        // Update tooltip
-        TooltipInfo tooltipInfo = paintableMap.getTooltipInfo(this, null);
-        if (getState().hasDescription()) {
-            tooltipInfo.setTitle(getState().getDescription());
-        } else {
-            tooltipInfo.setTitle(null);
-        }
-        // add error info to tooltip if present
-        if (uidl.hasAttribute(ATTRIBUTE_ERROR)) {
-            tooltipInfo.setErrorUidl(uidl.getErrors());
-        } else {
-            tooltipInfo.setErrorUidl(null);
-        }
-
-        // Set captions
-        if (delegateCaptionHandling()) {
-            getParent().updateCaption(this, uidl);
-        }
-
-        /*
-         * updateComponentSize need to be after caption update so caption can be
-         * taken into account
-         */
-
-        updateComponentSize();
-    }
-
-    private void updateComponentSize() {
-        SharedState state = getState();
-
-        String w = "";
-        String h = "";
-        if (null != state || !(state instanceof ComponentState)) {
-            ComponentState componentState = (ComponentState) state;
-            // TODO move logging to VUIDLBrowser and VDebugConsole
-            // VConsole.log("Paintable state for "
-            // + getPaintableMap().getPid(paintable) + ": "
-            // + String.valueOf(state.getState()));
-            h = componentState.getHeight();
-            w = componentState.getWidth();
-        } else {
-            // TODO move logging to VUIDLBrowser and VDebugConsole
-            VConsole.log("No state for paintable " + getId()
-                    + " in VAbstractPaintableWidget.updateComponentSize()");
-        }
-
-        // Parent should be updated if either dimension changed between relative
-        // and non-relative
-        if (w.endsWith("%") != declaredWidth.endsWith("%")) {
-            VPaintableWidgetContainer parent = getParent();
-            if (parent instanceof ManagedLayout) {
-                getLayoutManager().setWidthNeedsUpdate((ManagedLayout) parent);
-            }
-        }
-
-        if (h.endsWith("%") != declaredHeight.endsWith("%")) {
-            VPaintableWidgetContainer parent = getParent();
-            if (parent instanceof ManagedLayout) {
-                getLayoutManager().setHeightNeedsUpdate((ManagedLayout) parent);
-            }
-        }
-
-        declaredWidth = w;
-        declaredHeight = h;
-
-        // Set defined sizes
-        Widget component = getWidget();
-
-        component.setStyleName("v-undefined-width", isUndefinedWidth());
-        component.setStyleName("v-undefined-height", isUndefinedHeight());
-
-        component.setHeight(h);
-        component.setWidth(w);
-    }
-
-    public boolean isRelativeHeight() {
-        return declaredHeight.endsWith("%");
-    }
-
-    public boolean isRelativeWidth() {
-        return declaredWidth.endsWith("%");
-    }
-
-    public boolean isUndefinedHeight() {
-        return declaredHeight.length() == 0;
-    }
-
-    public boolean isUndefinedWidth() {
-        return declaredWidth.length() == 0;
-    }
-
-    public String getDeclaredHeight() {
-        return declaredHeight;
-    }
-
-    public String getDeclaredWidth() {
-        return declaredWidth;
-    }
-
-    /**
-     * Sets the enabled state of this paintable
-     * 
-     * @param enabled
-     *            true if the paintable is enabled, false otherwise
-     */
-    protected void setEnabled(boolean enabled) {
-        this.enabled = enabled;
-
-        if (getWidget() instanceof FocusWidget) {
-            FocusWidget fw = (FocusWidget) getWidget();
-            fw.setEnabled(enabled);
-        }
-
-    }
-
-    public boolean isEnabled() {
-        return enabled;
-    }
-
-    /**
-     * Return true if parent handles caption, false if the paintable handles the
-     * caption itself.
-     * 
-     * 
-     * @deprecated This should always return true and all components should let
-     *             the parent handle the caption and use other attributes for
-     *             internal texts in the component
-     * @return
-     */
-    @Deprecated
-    protected boolean delegateCaptionHandling() {
-        return true;
-    }
-
-    /**
-     * Sets the visible state for this paintable.
-     * 
-     * @param visible
-     *            true if the paintable should be made visible, false otherwise
-     * @param captionUidl
-     *            The UIDL that is passed to the parent and onwards to VCaption
-     *            if the caption needs to be updated as a result of the
-     *            visibility change.
-     */
-    protected void setVisible(boolean visible, UIDL captionUidl) {
-        boolean wasVisible = this.visible;
-        this.visible = visible;
-
-        getWidget().setVisible(visible);
-        if (wasVisible != visible) {
-            // Changed invisibile <-> visible
-            if (wasVisible && delegateCaptionHandling()) {
-                // Must hide caption when component is hidden
-                getParent().updateCaption(this, captionUidl);
-            }
-        }
-    }
-
-    protected boolean isVisible() {
-        return visible;
-    }
-
-    /**
-     * Generates the style name for the widget based on the given primary style
-     * name (typically returned by Widget.getPrimaryStyleName()) and the UIDL
-     * and shared state of the component. An additional "modified" style name
-     * can be added if the field parameter is set to true.
-     * 
-     * @param primaryStyleName
-     * @param uidl
-     * @param state
-     *            component shared state
-     * @param field
-     * @return
-     */
-    protected static String getStyleNameFromUIDL(String primaryStyleName,
-            UIDL uidl, ComponentState state, boolean field) {
-        boolean enabled = !state.isDisabled();
-
-        StringBuffer styleBuf = new StringBuffer();
-        styleBuf.append(primaryStyleName);
-        styleBuf.append(" v-paintable");
-
-        // first disabling and read-only status
-        if (!enabled) {
-            styleBuf.append(" ");
-            styleBuf.append(ApplicationConnection.DISABLED_CLASSNAME);
-        }
-        if (state.isReadOnly()) {
-            styleBuf.append(" ");
-            styleBuf.append("v-readonly");
-        }
-
-        // add additional styles as css classes, prefixed with component default
-        // stylename
-        if (state.hasStyles()) {
-            final String[] styles = state.getStyle().split(" ");
-            for (int i = 0; i < styles.length; i++) {
-                styleBuf.append(" ");
-                styleBuf.append(primaryStyleName);
-                styleBuf.append("-");
-                styleBuf.append(styles[i]);
-                styleBuf.append(" ");
-                styleBuf.append(styles[i]);
-            }
-        }
-
-        // add modified classname to Fields
-        if (field && uidl.hasAttribute("modified")) {
-            styleBuf.append(" ");
-            styleBuf.append(ApplicationConnection.MODIFIED_CLASSNAME);
-        }
-
-        // add error classname to components w/ error
-        if (uidl.hasAttribute(ATTRIBUTE_ERROR)) {
-            styleBuf.append(" ");
-            styleBuf.append(primaryStyleName);
-            styleBuf.append(ApplicationConnection.ERROR_CLASSNAME_EXT);
-        }
-        // add required style to required components
-        if (uidl.hasAttribute(ATTRIBUTE_REQUIRED)) {
-            styleBuf.append(" ");
-            styleBuf.append(primaryStyleName);
-            styleBuf.append(ApplicationConnection.REQUIRED_CLASSNAME_EXT);
-        }
-
-        return styleBuf.toString();
-    }
-
-    /**
-     * Sets the shared state for the paintable widget.
-     * 
-     * @param new shared state (must be compatible with the return value of
-     *        {@link #getState()} - {@link ComponentState} if
-     *        {@link #getState()} is not overridden
-     */
-    public final void setState(SharedState state) {
-        this.state = (ComponentState) state;
-    }
-
-    /**
-     * Initialize the given RPC proxy object so it is connected to this
-     * paintable.
-     * 
-     * @param clientToServerRpc
-     *            The RPC instance to initialize. Must have been created using
-     *            GWT.create().
-     */
-    protected <T extends ClientToServerRpc> T initRPC(T clientToServerRpc) {
-        ((InitializableClientToServerRpc) clientToServerRpc).initRpc(getId(),
-                getConnection());
-        return clientToServerRpc;
-    }
-
-    public LayoutManager getLayoutManager() {
-        return LayoutManager.get(connection);
-    }
-}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidgetContainer.java b/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidgetContainer.java
deleted file mode 100644 (file)
index 5af8cad..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import com.google.gwt.user.client.ui.HasOneWidget;
-import com.google.gwt.user.client.ui.HasWidgets;
-import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
-import com.vaadin.terminal.gwt.client.VPaintableWidgetContainer;
-
-public abstract class VAbstractPaintableWidgetContainer extends
-        VAbstractPaintableWidget implements VPaintableWidgetContainer {
-
-    /**
-     * Default constructor
-     */
-    public VAbstractPaintableWidgetContainer() {
-    }
-
-    public Collection<VPaintableWidget> getChildren() {
-        Collection<VPaintableWidget> children = new ArrayList<VPaintableWidget>();
-
-        addDescendantPaintables(getWidget(), children,
-                VPaintableMap.get(getConnection()));
-
-        return children;
-    }
-
-    private static void addDescendantPaintables(Widget widget,
-            Collection<VPaintableWidget> paintables, VPaintableMap paintableMap) {
-        // FIXME: Store hierarchy instead of doing lookup every time
-
-        if (widget instanceof HasWidgets) {
-            for (Widget child : (HasWidgets) widget) {
-                addIfPaintable(child, paintables, paintableMap);
-            }
-        } else if (widget instanceof HasOneWidget) {
-            Widget child = ((HasOneWidget) widget).getWidget();
-            addIfPaintable(child, paintables, paintableMap);
-        }
-    }
-
-    private static void addIfPaintable(Widget widget,
-            Collection<VPaintableWidget> paintables, VPaintableMap paintableMap) {
-        VPaintableWidget paintable = paintableMap.getPaintable(widget);
-        if (paintable != null) {
-            // If widget is a paintable, add it to the collection
-            paintables.add(paintable);
-        } else {
-            // Else keep looking for paintables inside the widget
-            addDescendantPaintables(widget, paintables, paintableMap);
-        }
-    }
-
-}
index dddd57588d47b6b00937f48ce43aa4beaaf232a7..08fc6ac26cd66512fb648d1db22546dae2cc5208 100644 (file)
@@ -12,15 +12,15 @@ import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 public abstract class VAbstractSplitPanelPaintable extends
-        VAbstractPaintableWidgetContainer implements SimpleManagedLayout {
+        AbstractComponentContainerConnector implements SimpleManagedLayout {
 
     public static final String SPLITTER_CLICK_EVENT_IDENTIFIER = "sp_click";
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         // TODO Implement caption handling
     }
 
@@ -94,24 +94,24 @@ public abstract class VAbstractSplitPanelPaintable extends
 
         getWidget().position = uidl.getStringAttribute("position");
 
-        final VPaintableWidget newFirstChildPaintable = client
+        final ComponentConnector newFirstChildPaintable = client
                 .getPaintable(uidl.getChildUIDL(0));
-        final VPaintableWidget newSecondChildPaintable = client
+        final ComponentConnector newSecondChildPaintable = client
                 .getPaintable(uidl.getChildUIDL(1));
         Widget newFirstChild = newFirstChildPaintable.getWidget();
         Widget newSecondChild = newSecondChildPaintable.getWidget();
 
         if (getWidget().firstChild != newFirstChild) {
             if (getWidget().firstChild != null) {
-                client.unregisterPaintable(VPaintableMap.get(client)
-                        .getPaintable(getWidget().firstChild));
+                client.unregisterPaintable(ConnectorMap.get(client)
+                        .getConnector(getWidget().firstChild));
             }
             getWidget().setFirstWidget(newFirstChild);
         }
         if (getWidget().secondChild != newSecondChild) {
             if (getWidget().secondChild != null) {
-                client.unregisterPaintable(VPaintableMap.get(client)
-                        .getPaintable(getWidget().secondChild));
+                client.unregisterPaintable(ConnectorMap.get(client)
+                        .getConnector(getWidget().secondChild));
             }
             getWidget().setSecondWidget(newSecondChild);
         }
index a7720ec6d27418de15a52ccbc1d9e06441e2bf5c..d2b601f42a29e821dda410905e580b81d6bce289 100644 (file)
@@ -19,8 +19,8 @@ import com.vaadin.terminal.gwt.client.RenderInformation;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 public class VAccordion extends VTabsheetBase {
 
@@ -86,7 +86,7 @@ public class VAccordion extends VTabsheetBase {
     private StackItem moveStackItemIfNeeded(StackItem item, int newIndex,
             UIDL tabUidl) {
         UIDL tabContentUIDL = null;
-        VPaintableWidget tabContent = null;
+        ComponentConnector tabContent = null;
         if (tabUidl.getChildCount() > 0) {
             tabContentUIDL = tabUidl.getChildUIDL(0);
             tabContent = client.getPaintable(tabContentUIDL);
@@ -374,9 +374,9 @@ public class VAccordion extends VTabsheetBase {
         public void replaceWidget(Widget newWidget) {
             if (getWidgetCount() > 1) {
                 Widget oldWidget = getWidget(1);
-                VPaintableWidget oldPaintable = VPaintableMap.get(client)
-                        .getPaintable(oldWidget);
-                VPaintableMap.get(client).unregisterPaintable(oldPaintable);
+                ComponentConnector oldPaintable = ConnectorMap.get(client)
+                        .getConnector(oldWidget);
+                ConnectorMap.get(client).unregisterConnector(oldPaintable);
                 widgets.remove(oldWidget);
                 remove(1);
             }
@@ -411,7 +411,7 @@ public class VAccordion extends VTabsheetBase {
         }
 
         public void setContent(UIDL contentUidl) {
-            final VPaintableWidget newPntbl = client.getPaintable(contentUidl);
+            final ComponentConnector newPntbl = client.getPaintable(contentUidl);
             Widget newWidget = newPntbl.getWidget();
             if (getChildWidget() == null) {
                 add(newWidget, content);
@@ -450,7 +450,7 @@ public class VAccordion extends VTabsheetBase {
             return DOM.getFirstChild(content).getOffsetWidth();
         }
 
-        public boolean contains(VPaintableWidget p) {
+        public boolean contains(ComponentConnector p) {
             return (getChildWidget() == p.getWidget());
         }
 
@@ -466,13 +466,13 @@ public class VAccordion extends VTabsheetBase {
     }
 
     boolean isDynamicWidth() {
-        VPaintableWidget paintable = VPaintableMap.get(client).getPaintable(
+        ComponentConnector paintable = ConnectorMap.get(client).getConnector(
                 this);
         return paintable.isUndefinedWidth();
     }
 
     boolean isDynamicHeight() {
-        VPaintableWidget paintable = VPaintableMap.get(client).getPaintable(
+        ComponentConnector paintable = ConnectorMap.get(client).getConnector(
                 this);
         return paintable.isUndefinedHeight();
     }
@@ -495,10 +495,10 @@ public class VAccordion extends VTabsheetBase {
     }
 
     @Override
-    protected VPaintableWidget getTab(int index) {
+    protected ComponentConnector getTab(int index) {
         if (index < getWidgetCount()) {
             Widget w = getStackItem(index);
-            return VPaintableMap.get(client).getPaintable(w);
+            return ConnectorMap.get(client).getConnector(w);
         }
 
         return null;
index 1dd8bab0407f14f25ded81ba4750f224d5ac277b..ad4360642a1109494192315807f279c7f5918a14 100644 (file)
@@ -9,7 +9,7 @@ import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.VAccordion.StackItem;
 
 public class VAccordionPaintable extends VTabsheetBasePaintable implements
@@ -62,7 +62,7 @@ public class VAccordionPaintable extends VTabsheetBasePaintable implements
         return GWT.create(VAccordion.class);
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         /* Accordion does not render its children's captions */
     }
 
index e849089acc8ba46a2ce9150cf992112830e9b29a..5924d3f5893a61885f871ef6f3d956d995612027 100644 (file)
@@ -13,7 +13,7 @@ import com.vaadin.terminal.gwt.client.EventHelper;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.communication.ClientToServerRpc;
 
-public class VButtonPaintable extends VAbstractPaintableWidget {
+public class VButtonPaintable extends AbstractComponentConnector {
 
     /**
      * RPC interface for calls from client to server.
index 26b18a769522597bbddd6e6a2874ab5f3adf30ed..72107ab6584e23532c5d44ca1176b30be6d09e65 100644 (file)
@@ -12,7 +12,7 @@ import com.vaadin.terminal.gwt.client.EventHelper;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.VTooltip;
 
-public class VCheckBoxPaintable extends VAbstractPaintableWidget {
+public class VCheckBoxPaintable extends AbstractComponentConnector {
 
     @Override
     protected boolean delegateCaptionHandling() {
index d949fc3e406a2c48c25ec28dccedb541f43c63c4..f2693b8f25e46ced4f18c8f1033febb6e5990af4 100644 (file)
@@ -22,8 +22,8 @@ import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaption;
 import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ValueMap;
 
 public class VCssLayout extends SimplePanel {
@@ -78,7 +78,7 @@ public class VCssLayout extends SimplePanel {
             for (final Iterator<Object> i = uidl.getChildIterator(); i
                     .hasNext();) {
                 final UIDL r = (UIDL) i.next();
-                final VPaintableWidget child = client.getPaintable(r);
+                final ComponentConnector child = client.getPaintable(r);
                 final Widget widget = child.getWidget();
                 if (widget.getParent() == this) {
                     oldWidgets.remove(widget);
@@ -121,10 +121,10 @@ public class VCssLayout extends SimplePanel {
             // them
             for (Widget w : oldWidgets) {
                 remove(w);
-                VPaintableMap paintableMap = VPaintableMap.get(client);
-                if (paintableMap.isPaintable(w)) {
-                    final VPaintableWidget p = VPaintableMap.get(client)
-                            .getPaintable(w);
+                ConnectorMap paintableMap = ConnectorMap.get(client);
+                if (paintableMap.isConnector(w)) {
+                    final ComponentConnector p = ConnectorMap.get(client)
+                            .getConnector(w);
                     client.unregisterPaintable(p);
                 }
                 VCaption vCaption = widgetToCaption.remove(w);
@@ -144,7 +144,7 @@ public class VCssLayout extends SimplePanel {
             insert(child, index);
         }
 
-        public void updateCaption(VPaintableWidget paintable, UIDL uidl) {
+        public void updateCaption(ComponentConnector paintable, UIDL uidl) {
             Widget widget = paintable.getWidget();
             VCaption caption = widgetToCaption.get(widget);
             if (VCaption.isNeeded(uidl, paintable.getState())) {
@@ -164,7 +164,7 @@ public class VCssLayout extends SimplePanel {
             }
         }
 
-        VPaintableWidget getComponent(Element element) {
+        ComponentConnector getComponent(Element element) {
             return Util
                     .getPaintableForElement(client, VCssLayout.this, element);
         }
index f6a3ca6cd19c340eec4226356d765e57b4ed7856..5f074326fa26a5eddcf742a41b82d15d45b39790 100644 (file)
@@ -12,15 +12,15 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.EventId;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public class VCssLayoutPaintable extends VAbstractPaintableWidgetContainer {
+public class VCssLayoutPaintable extends AbstractComponentContainerConnector {
 
     private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler(
             this, EventId.LAYOUT_CLICK) {
 
         @Override
-        protected VPaintableWidget getChildComponent(Element element) {
+        protected ComponentConnector getChildComponent(Element element) {
             return getWidget().panel.getComponent(element);
         }
 
@@ -56,7 +56,7 @@ public class VCssLayoutPaintable extends VAbstractPaintableWidgetContainer {
         return GWT.create(VCssLayout.class);
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         getWidget().panel.updateCaption(component, uidl);
     }
 
index 64c38b7077524b23238962b36ded59c8eeb12834..345a0591496b0390a5e12a7277f68c20f6b6309d 100644 (file)
@@ -7,11 +7,11 @@ import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 public class VCustomComponentPaintable extends
-        VAbstractPaintableWidgetContainer {
+        AbstractComponentContainerConnector {
 
     @Override
     public void updateFromUIDL(UIDL uidl, final ApplicationConnection client) {
@@ -21,12 +21,12 @@ public class VCustomComponentPaintable extends
         }
         final UIDL child = uidl.getChildUIDL(0);
         if (child != null) {
-            final VPaintableWidget paintable = client.getPaintable(child);
+            final ComponentConnector paintable = client.getPaintable(child);
             Widget widget = paintable.getWidget();
             if (widget != getWidget().getWidget()) {
                 if (getWidget().getWidget() != null) {
-                    client.unregisterPaintable(VPaintableMap.get(client)
-                            .getPaintable(getWidget().getWidget()));
+                    client.unregisterPaintable(ConnectorMap.get(client)
+                            .getConnector(getWidget().getWidget()));
                     getWidget().clear();
                 }
                 getWidget().setWidget(widget);
@@ -45,7 +45,7 @@ public class VCustomComponentPaintable extends
         return (VCustomComponent) super.getWidget();
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         // NOP, custom component dont render composition roots caption
     }
 
index aed215995e354a71554365fb4d6d4c4e489e4583..5db07a1a549310739a0160e6d354d4b58b87de23 100644 (file)
@@ -20,8 +20,8 @@ import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaption;
 import com.vaadin.terminal.gwt.client.VCaptionWrapper;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 /**
  * Custom Layout implements complex layout defined with HTML template.
@@ -40,7 +40,7 @@ public class VCustomLayout extends ComplexPanel {
     final HashMap<String, Widget> locationToWidget = new HashMap<String, Widget>();
 
     /** Widget to captionwrapper map */
-    private final HashMap<VPaintableWidget, VCaptionWrapper> paintableToCaptionWrapper = new HashMap<VPaintableWidget, VCaptionWrapper>();
+    private final HashMap<ComponentConnector, VCaptionWrapper> paintableToCaptionWrapper = new HashMap<ComponentConnector, VCaptionWrapper>();
 
     /** Name of the currently rendered style */
     String currentTemplateName;
@@ -300,7 +300,7 @@ public class VCustomLayout extends ComplexPanel {
     }
 
     /** Update caption for given widget */
-    public void updateCaption(VPaintableWidget paintable, UIDL uidl) {
+    public void updateCaption(ComponentConnector paintable, UIDL uidl) {
         VCaptionWrapper wrapper = paintableToCaptionWrapper.get(paintable);
         Widget widget = paintable.getWidget();
         if (VCaption.isNeeded(uidl, paintable.getState())) {
@@ -339,7 +339,7 @@ public class VCustomLayout extends ComplexPanel {
     /** Removes given widget from the layout */
     @Override
     public boolean remove(Widget w) {
-        VPaintableWidget paintable = VPaintableMap.get(client).getPaintable(w);
+        ComponentConnector paintable = ConnectorMap.get(client).getConnector(w);
         client.unregisterPaintable(paintable);
         final String location = getLocation(w);
         if (location != null) {
index c726bcc7d9444e06fc12e976a6cab315a5d60ad4..ab409afda2a10a82a6a5bf96c69d8d84b7b60312 100644 (file)
@@ -12,9 +12,9 @@ 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.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public class VCustomLayoutPaintable extends VAbstractPaintableWidgetContainer
+public class VCustomLayoutPaintable extends AbstractComponentContainerConnector
         implements SimpleManagedLayout {
 
     /** Update the layout from UIDL */
@@ -49,7 +49,7 @@ public class VCustomLayoutPaintable extends VAbstractPaintableWidgetContainer
             if (uidlForChild.getTag().equals("location")) {
                 final String location = uidlForChild.getStringAttribute("name");
                 UIDL childUIDL = uidlForChild.getChildUIDL(0);
-                final VPaintableWidget childPaintable = client
+                final ComponentConnector childPaintable = client
                         .getPaintable(childUIDL);
                 Widget childWidget = childPaintable.getWidget();
                 try {
@@ -85,7 +85,7 @@ public class VCustomLayoutPaintable extends VAbstractPaintableWidgetContainer
         return GWT.create(VCustomLayout.class);
     }
 
-    public void updateCaption(VPaintableWidget paintable, UIDL uidl) {
+    public void updateCaption(ComponentConnector paintable, UIDL uidl) {
         getWidget().updateCaption(paintable, uidl);
 
     }
index a77f13b079e9e565f80f0e953c1c09faec9e9872..bf747ad579bc327a939341e894b9511044d42316 100644 (file)
@@ -12,7 +12,7 @@ import com.vaadin.terminal.gwt.client.LocaleNotLoadedException;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.VConsole;
 
-public class VDateFieldPaintable extends VAbstractPaintableWidget {
+public class VDateFieldPaintable extends AbstractComponentConnector {
 
     @Override
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
index dae190a670a14cabd0442e4cf19bd8a048635592..813ef886367d1b841404dcf249e7aca794961223 100644 (file)
@@ -28,9 +28,9 @@ import com.vaadin.terminal.gwt.client.RenderInformation;
 import com.vaadin.terminal.gwt.client.RenderInformation.Size;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.VPaintable;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.Connector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.VTooltip;
 import com.vaadin.terminal.gwt.client.ValueMap;
 import com.vaadin.terminal.gwt.client.ui.dd.DDUtil;
@@ -108,10 +108,10 @@ public class VDragAndDropWrapper extends VCustomComponent implements
     private boolean startDrag(NativeEvent event) {
         if (dragStartMode == WRAPPER || dragStartMode == COMPONENT) {
             VTransferable transferable = new VTransferable();
-            transferable.setDragSource(VPaintableMap.get(client).getPaintable(
+            transferable.setDragSource(ConnectorMap.get(client).getConnector(
                     VDragAndDropWrapper.this));
 
-            VPaintableWidget paintable = Util.findPaintable(client,
+            ComponentConnector paintable = Util.findPaintable(client,
                     (Element) event.getEventTarget().cast());
             Widget widget = paintable.getWidget();
             transferable.setData("component", paintable);
@@ -242,8 +242,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements
             }
             if (VDragAndDropManager.get().getCurrentDropHandler() != getDropHandler()) {
                 VTransferable transferable = new VTransferable();
-                transferable.setDragSource(VPaintableMap.get(client)
-                        .getPaintable(this));
+                transferable.setDragSource(ConnectorMap.get(client)
+                        .getConnector(this));
 
                 vaadinDragEvent = VDragAndDropManager.get().startDrag(
                         transferable, event, false);
@@ -420,7 +420,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements
     }
 
     private String getPid() {
-        return VPaintableMap.get(client).getPid((VPaintable) this);
+        return ConnectorMap.get(client).getConnectorId((Connector) this);
     }
 
     public VDropHandler getDropHandler() {
@@ -499,8 +499,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements
         }
 
         @Override
-        public VPaintableWidget getPaintable() {
-            return VPaintableMap.get(client).getPaintable(
+        public ComponentConnector getPaintable() {
+            return ConnectorMap.get(client).getConnector(
                     VDragAndDropWrapper.this);
         }
 
index 95ffb8076b36a5345770a5d2f7ea9df22b3623a8..3233614076e7d12ba77a69c9c452c410d84ddadb 100644 (file)
@@ -17,8 +17,8 @@ import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 public class VEmbedded extends HTML {
     public static String CLASSNAME = "v-embedded";
@@ -84,7 +84,7 @@ public class VEmbedded extends HTML {
             html.append("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ");
         }
 
-        VPaintableWidget paintable = VPaintableMap.get(client).getPaintable(
+        ComponentConnector paintable = ConnectorMap.get(client).getConnector(
                 this);
         String height = paintable.getDeclaredHeight();
         String width = paintable.getDeclaredWidth();
index 201b6e0d0bd4ab9cb9d848830f5366d615fe5ab2..822800aed965c7885c72df5729a92fcc31e03042 100644 (file)
@@ -24,7 +24,7 @@ import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.VConsole;
 import com.vaadin.terminal.gwt.client.VTooltip;
 
-public class VEmbeddedPaintable extends VAbstractPaintableWidget {
+public class VEmbeddedPaintable extends AbstractComponentConnector {
 
     public static final String CLICK_EVENT_IDENTIFIER = "click";
 
index d9c7cadcd988c9484fbdbfcae81f24247ec8ba09..466e2fa10e31480d45318f9293160137bed9f99e 100644 (file)
@@ -52,8 +52,8 @@ import com.vaadin.terminal.gwt.client.Focusable;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.VTooltip;
 
 /**
@@ -1567,7 +1567,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
      * Should be called when the width changes or when the icon changes.
      */
     protected void updateRootWidth() {
-        VPaintableWidget paintable = VPaintableMap.get(client).getPaintable(
+        ComponentConnector paintable = ConnectorMap.get(client).getConnector(
                 this);
         if (paintable.isUndefinedWidth()) {
 
index 9804ecb6dba669228d6eceb28e92eb3313c08758..b164081a2e524073954f993b4a187647a4c559a1 100644 (file)
@@ -12,7 +12,7 @@ import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.ui.VFilterSelect.FilterSelectSuggestion;
 
-public class VFilterSelectPaintable extends VAbstractPaintableWidget implements
+public class VFilterSelectPaintable extends AbstractComponentConnector implements
         SimpleManagedLayout {
 
     /*
index bb11363b0a0717d4e75cc7dc32ec8a31fffb26cc..be625713ef976d59c843df4ed488f0845a09e443 100644 (file)
@@ -24,8 +24,8 @@ import com.vaadin.terminal.gwt.client.ComponentState;
 import com.vaadin.terminal.gwt.client.Focusable;
 import com.vaadin.terminal.gwt.client.StyleConstants;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.VTooltip;
 
 /**
@@ -104,7 +104,7 @@ public class VFormLayout extends SimplePanel {
             for (final Iterator<?> it = uidl.getChildIterator(); it.hasNext(); i++) {
                 prepareCell(i, 1);
                 final UIDL childUidl = (UIDL) it.next();
-                final VPaintableWidget childPaintable = client
+                final ComponentConnector childPaintable = client
                         .getPaintable(childUidl);
                 Widget childWidget = childPaintable.getWidget();
                 Caption caption = widgetToCaption.get(childWidget);
@@ -124,8 +124,8 @@ public class VFormLayout extends SimplePanel {
                 if (oldWidget == null) {
                     setWidget(i, COLUMN_WIDGET, childWidget);
                 } else if (oldWidget != childWidget) {
-                    final VPaintableWidget oldPaintable = VPaintableMap.get(
-                            client).getPaintable(oldWidget);
+                    final ComponentConnector oldPaintable = ConnectorMap.get(
+                            client).getConnector(oldWidget);
                     client.unregisterPaintable(oldPaintable);
                     setWidget(i, COLUMN_WIDGET, childWidget);
                 }
@@ -162,8 +162,8 @@ public class VFormLayout extends SimplePanel {
 
             while (getRowCount() > i) {
                 Widget w = getWidget(i, COLUMN_WIDGET);
-                final VPaintableWidget p = VPaintableMap.get(client)
-                        .getPaintable(w);
+                final ComponentConnector p = ConnectorMap.get(client)
+                        .getConnector(w);
                 client.unregisterPaintable(p);
                 widgetToCaption.remove(w);
                 removeRow(i);
@@ -178,7 +178,7 @@ public class VFormLayout extends SimplePanel {
             }
         }
 
-        public void updateCaption(VPaintableWidget paintable, UIDL uidl) {
+        public void updateCaption(ComponentConnector paintable, UIDL uidl) {
             final Caption c = widgetToCaption.get(paintable
                     .getWidget());
             if (c != null) {
@@ -217,7 +217,7 @@ public class VFormLayout extends SimplePanel {
 
         public static final String CLASSNAME = "v-caption";
 
-        private final VPaintableWidget owner;
+        private final ComponentConnector owner;
 
         private Element requiredFieldIndicator;
 
@@ -234,7 +234,7 @@ public class VFormLayout extends SimplePanel {
          *            return null
          * @param client
          */
-        public Caption(VPaintableWidget component, ApplicationConnection client) {
+        public Caption(ComponentConnector component, ApplicationConnection client) {
             super();
             this.client = client;
             owner = component;
@@ -268,14 +268,14 @@ public class VFormLayout extends SimplePanel {
 
             boolean isEmpty = true;
 
-            if (uidl.hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON)) {
+            if (uidl.hasAttribute(AbstractComponentConnector.ATTRIBUTE_ICON)) {
                 if (icon == null) {
                     icon = new Icon(client);
 
                     DOM.insertChild(getElement(), icon.getElement(), 0);
                 }
                 icon.setUri(uidl
-                        .getStringAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON));
+                        .getStringAttribute(AbstractComponentConnector.ATTRIBUTE_ICON));
                 isEmpty = false;
             } else {
                 if (icon != null) {
@@ -308,7 +308,7 @@ public class VFormLayout extends SimplePanel {
                 removeStyleDependentName("hasdescription");
             }
 
-            if (uidl.getBooleanAttribute(VAbstractPaintableWidget.ATTRIBUTE_REQUIRED)) {
+            if (uidl.getBooleanAttribute(AbstractComponentConnector.ATTRIBUTE_REQUIRED)) {
                 if (requiredFieldIndicator == null) {
                     requiredFieldIndicator = DOM.createSpan();
                     DOM.setInnerText(requiredFieldIndicator, "*");
@@ -345,7 +345,7 @@ public class VFormLayout extends SimplePanel {
          * 
          * @return owner Widget
          */
-        public VPaintableWidget getOwner() {
+        public ComponentConnector getOwner() {
             return owner;
         }
 
@@ -362,17 +362,17 @@ public class VFormLayout extends SimplePanel {
         private static final String CLASSNAME = VFormLayout.CLASSNAME
                 + "-error-indicator";
         Element errorIndicatorElement;
-        private VPaintableWidget owner;
+        private ComponentConnector owner;
 
         public ErrorFlag() {
             setStyleName(CLASSNAME);
             sinkEvents(VTooltip.TOOLTIP_EVENTS);
         }
 
-        public void updateFromUIDL(UIDL uidl, VPaintableWidget component) {
+        public void updateFromUIDL(UIDL uidl, ComponentConnector component) {
             owner = component;
             if (uidl.hasAttribute("error")
-                    && !uidl.getBooleanAttribute(VAbstractPaintableWidget.ATTRIBUTE_HIDEERRORS)) {
+                    && !uidl.getBooleanAttribute(AbstractComponentConnector.ATTRIBUTE_HIDEERRORS)) {
                 if (errorIndicatorElement == null) {
                     errorIndicatorElement = DOM.createDiv();
                     DOM.setInnerHTML(errorIndicatorElement, "&nbsp;");
index c044c7abac9532a4df29be821cd1334581c028e4..5991163ef0b4234d281a90c1c530f9c32c322486 100644 (file)
@@ -7,9 +7,9 @@ import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public class VFormLayoutPaintable extends VAbstractPaintableWidgetContainer {
+public class VFormLayoutPaintable extends AbstractComponentContainerConnector {
     @Override
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
         getWidget().client = client;
@@ -22,7 +22,7 @@ public class VFormLayoutPaintable extends VAbstractPaintableWidgetContainer {
         getWidget().table.updateFromUIDL(uidl, client);
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         getWidget().table.updateCaption(component, uidl);
     }
 
index 00859367575de06a0397427b93dea7100e40449c..2d0b5cea25eee71b902ff0a511951eda94853a74 100644 (file)
@@ -9,10 +9,10 @@ import com.google.gwt.event.dom.client.KeyDownEvent;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public class VFormPaintable extends VAbstractPaintableWidgetContainer implements
+public class VFormPaintable extends AbstractComponentContainerConnector implements
         SimpleManagedLayout {
 
     @Override
@@ -94,7 +94,7 @@ public class VFormPaintable extends VAbstractPaintableWidgetContainer implements
         if (uidl.getChildCount() > 1
                 && !uidl.getChildUIDL(1).getTag().equals("actions")) {
             // render footer
-            VPaintableWidget newFooter = client.getPaintable(uidl
+            ComponentConnector newFooter = client.getPaintable(uidl
                     .getChildUIDL(1));
             Widget newFooterWidget = newFooter.getWidget();
             if (getWidget().footer == null) {
@@ -103,8 +103,8 @@ public class VFormPaintable extends VAbstractPaintableWidgetContainer implements
                 getWidget().footer = newFooterWidget;
             } else if (newFooter != getWidget().footer) {
                 getWidget().remove(getWidget().footer);
-                client.unregisterPaintable(VPaintableMap.get(getConnection())
-                        .getPaintable(getWidget().footer));
+                client.unregisterPaintable(ConnectorMap.get(getConnection())
+                        .getConnector(getWidget().footer));
                 getWidget().add(newFooter.getWidget(),
                         getWidget().footerContainer);
             }
@@ -113,13 +113,13 @@ public class VFormPaintable extends VAbstractPaintableWidgetContainer implements
         } else {
             if (getWidget().footer != null) {
                 getWidget().remove(getWidget().footer);
-                client.unregisterPaintable(VPaintableMap.get(getConnection())
-                        .getPaintable(getWidget().footer));
+                client.unregisterPaintable(ConnectorMap.get(getConnection())
+                        .getConnector(getWidget().footer));
             }
         }
 
         final UIDL layoutUidl = uidl.getChildUIDL(0);
-        VPaintableWidget newLayout = client.getPaintable(layoutUidl);
+        ComponentConnector newLayout = client.getPaintable(layoutUidl);
         Widget newLayoutWidget = newLayout.getWidget();
         if (getWidget().lo == null) {
             // Layout not rendered before
@@ -128,8 +128,8 @@ public class VFormPaintable extends VAbstractPaintableWidgetContainer implements
                     getWidget().fieldContainer);
         } else if (getWidget().lo != newLayoutWidget) {
             // Layout has changed
-            client.unregisterPaintable(VPaintableMap.get(getConnection())
-                    .getPaintable(getWidget().lo));
+            client.unregisterPaintable(ConnectorMap.get(getConnection())
+                    .getConnector(getWidget().lo));
             getWidget().remove(getWidget().lo);
             getWidget().lo = newLayoutWidget;
             getWidget().add(newLayoutWidget,
@@ -162,7 +162,7 @@ public class VFormPaintable extends VAbstractPaintableWidgetContainer implements
         }
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         // NOP form don't render caption for neither field layout nor footer
         // layout
     }
index 7c1f13e977f8820a821a50fbb70b57450fd6e472..2b466aec77d616682eb8f3f13a4ed63b5c964147 100644 (file)
@@ -21,8 +21,8 @@ import com.vaadin.terminal.gwt.client.LayoutManager;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
 import com.vaadin.terminal.gwt.client.ui.layout.VPaintableLayoutSlot;
 
@@ -59,8 +59,8 @@ public class VGridLayout extends ComplexPanel {
         setStyleName(CLASSNAME);
     }
 
-    private VPaintableWidget getPaintable() {
-        return VPaintableMap.get(client).getPaintable(this);
+    private ComponentConnector getPaintable() {
+        return ConnectorMap.get(client).getConnector(this);
     }
 
     /**
@@ -551,7 +551,7 @@ public class VGridLayout extends ComplexPanel {
                                                        // about childUidl
             hasContent = childUidl != null;
             if (hasContent) {
-                VPaintableWidget paintable = client.getPaintable(childUidl);
+                ComponentConnector paintable = client.getPaintable(childUidl);
 
                 if (slot == null || slot.getPaintable() != paintable) {
                     slot = new VPaintableLayoutSlot(CLASSNAME, paintable);
@@ -599,7 +599,7 @@ public class VGridLayout extends ComplexPanel {
      * @return The Paintable which the element is a part of. Null if the element
      *         belongs to the layout and not to a child.
      */
-    VPaintableWidget getComponent(Element element) {
+    ComponentConnector getComponent(Element element) {
         return Util.getPaintableForElement(client, this, element);
     }
 
index 2de1b64b28a392af6fbce4c16ad31ad529409b70..ee02bf5e944dedc94d18244fcf01db2003e161d0 100644 (file)
@@ -17,18 +17,18 @@ import com.vaadin.terminal.gwt.client.DirectionalManagedLayout;
 import com.vaadin.terminal.gwt.client.EventId;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.VGridLayout.Cell;
 import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
 
-public class VGridLayoutPaintable extends VAbstractPaintableWidgetContainer
+public class VGridLayoutPaintable extends AbstractComponentContainerConnector
         implements DirectionalManagedLayout {
     private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler(
             this, EventId.LAYOUT_CLICK) {
 
         @Override
-        protected VPaintableWidget getChildComponent(Element element) {
+        protected ComponentConnector getChildComponent(Element element) {
             return getWidget().getComponent(element);
         }
 
@@ -110,8 +110,8 @@ public class VGridLayoutPaintable extends VAbstractPaintableWidgetContainer
 
             if (w.getParent() == layout) {
                 w.removeFromParent();
-                VPaintableMap paintableMap = VPaintableMap.get(client);
-                paintableMap.unregisterPaintable(paintableMap.getPaintable(w));
+                ConnectorMap paintableMap = ConnectorMap.get(client);
+                paintableMap.unregisterConnector(paintableMap.getConnector(w));
             }
             cell.slot.getWrapperElement().removeFromParent();
         }
@@ -124,7 +124,7 @@ public class VGridLayoutPaintable extends VAbstractPaintableWidgetContainer
         getLayoutManager().setNeedsUpdate(this);
     }
 
-    public void updateCaption(VPaintableWidget paintable, UIDL uidl) {
+    public void updateCaption(ComponentConnector paintable, UIDL uidl) {
         VGridLayout layout = getWidget();
         if (VCaption.isNeeded(uidl, paintable.getState())) {
             Cell cell = layout.widgetToCell.get(paintable
index 4e9611f7f16c5af31a0c9628108a58fa97a42aad..79ea8013763fb4ac948393c6f68e03ae6780c4ff 100644 (file)
@@ -10,7 +10,7 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 
-public class VLinkPaintable extends VAbstractPaintableWidget {
+public class VLinkPaintable extends AbstractComponentConnector {
 
     @Override
     protected boolean delegateCaptionHandling() {
index 3dcf090531d8fe7f1f0cd7b0dba134e7c2b6cd43..3d3bc60d2ba2858887da00bbe91c24cb1f7be103 100644 (file)
@@ -15,14 +15,14 @@ import com.vaadin.terminal.gwt.client.DirectionalManagedLayout;
 import com.vaadin.terminal.gwt.client.LayoutManager;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ValueMap;
 import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
 import com.vaadin.terminal.gwt.client.ui.layout.VPaintableLayoutSlot;
 
 public abstract class VMeasuringOrderedLayoutPaintable extends
-        VAbstractPaintableWidgetContainer implements DirectionalManagedLayout {
+        AbstractComponentContainerConnector implements DirectionalManagedLayout {
 
     @Override
     public void init() {
@@ -30,7 +30,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
                 getWidget().spacingMeasureElement);
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         VMeasuringOrderedLayout layout = getWidget();
         if (VCaption.isNeeded(uidl, component.getState())) {
             VLayoutSlot layoutSlot = layout.getSlotForChild(component
@@ -61,7 +61,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
             return;
         }
 
-        HashSet<VPaintableWidget> previousChildren = new HashSet<VPaintableWidget>(
+        HashSet<ComponentConnector> previousChildren = new HashSet<ComponentConnector>(
                 getChildren());
 
         VMeasuringOrderedLayout layout = getWidget();
@@ -73,7 +73,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
         // TODO Support reordering elements!
         for (final Iterator<Object> it = uidl.getChildIterator(); it.hasNext();) {
             final UIDL childUIDL = (UIDL) it.next();
-            final VPaintableWidget child = client.getPaintable(childUIDL);
+            final ComponentConnector child = client.getPaintable(childUIDL);
             Widget widget = child.getWidget();
 
             VLayoutSlot slot = layout.getSlotForChild(widget);
@@ -109,7 +109,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
             previousChildren.remove(child);
         }
 
-        for (VPaintableWidget child : previousChildren) {
+        for (ComponentConnector child : previousChildren) {
             Widget widget = child.getWidget();
 
             // Don't remove and unregister if it has been moved to a different
@@ -118,8 +118,8 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
             if (widget.getParent() == getWidget()) {
                 layout.removeSlot(layout.getSlotForChild(widget));
 
-                VPaintableMap vPaintableMap = VPaintableMap.get(client);
-                vPaintableMap.unregisterPaintable(child);
+                ConnectorMap vPaintableMap = ConnectorMap.get(client);
+                vPaintableMap.unregisterConnector(child);
             }
         }
 
index afac19ff2d839b442e46ac6e14de0d848dd685d7..22e14b8b7fc58b6b7a15f49b6d609eb753784d8f 100644 (file)
@@ -7,7 +7,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 
-public abstract class VMediaBasePaintable extends VAbstractPaintableWidget {
+public abstract class VMediaBasePaintable extends AbstractComponentConnector {
 
     public static final String TAG_SOURCE = "src";
 
index b49bac3338dd0c2bdfe0373212da1cb617cddb64..e1682b72d32612a40e8684ae1b5f11db134ed418 100644 (file)
@@ -65,7 +65,7 @@ public class VMenuBar extends SimpleFocusablePanel implements
 
     public static final String ATTRIBUTE_CHECKED = "checked";
     public static final String ATTRIBUTE_ITEM_DESCRIPTION = "description";
-    public static final String ATTRIBUTE_ITEM_ICON = VAbstractPaintableWidget.ATTRIBUTE_ICON;
+    public static final String ATTRIBUTE_ITEM_ICON = AbstractComponentConnector.ATTRIBUTE_ICON;
     public static final String ATTRIBUTE_ITEM_DISABLED = "disabled";
     public static final String ATTRIBUTE_ITEM_STYLE = "style";
 
index 0b1f384f1f2fc5fc6ba4726483f4ce67931f1504..6606493a86b6a62334c4fcb4198d4d5c48381e5c 100644 (file)
@@ -14,7 +14,7 @@ import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.ui.VMenuBar.CustomMenuItem;
 
-public class VMenuBarPaintable extends VAbstractPaintableWidget implements
+public class VMenuBarPaintable extends AbstractComponentConnector implements
         SimpleManagedLayout {
     /**
      * This method must be implemented to update the client-side component from
index fa26258cf3709fd01c5c61174be5e8eb37a895d2..33afcf38f8db0c0fddaa70a406f816cb513cbabf 100644 (file)
@@ -12,7 +12,7 @@ import com.vaadin.terminal.gwt.client.EventHelper;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.ui.VButtonPaintable.ButtonClientToServerRpc;
 
-public class VNativeButtonPaintable extends VAbstractPaintableWidget {
+public class VNativeButtonPaintable extends AbstractComponentConnector {
 
     @Override
     public void init() {
index 124c9a51c7074386472d16251b49da033c26a6da..2cbd562d43142ac6ce0d027a1ec2b3a5206a8b46 100644 (file)
@@ -59,7 +59,7 @@ public class VNotification extends VOverlay {
     public static final String ATTRIBUTE_NOTIFICATION_STYLE = "style";
     public static final String ATTRIBUTE_NOTIFICATION_CAPTION = "caption";
     public static final String ATTRIBUTE_NOTIFICATION_MESSAGE = "message";
-    public static final String ATTRIBUTE_NOTIFICATION_ICON = VAbstractPaintableWidget.ATTRIBUTE_ICON;
+    public static final String ATTRIBUTE_NOTIFICATION_ICON = AbstractComponentConnector.ATTRIBUTE_ICON;
     public static final String ATTRIBUTE_NOTIFICATION_POSITION = "position";
     public static final String ATTRIBUTE_NOTIFICATION_DELAY = "delay";
 
index f48d698d6dc29fcbda21fe18ddbf169b76477a09..d730d50365341d3e1fb91816cc12d43b07bddec9 100644 (file)
@@ -8,7 +8,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 
 public abstract class VOptionGroupBasePaintable extends
-        VAbstractPaintableWidget {
+        AbstractComponentConnector {
 
     @Override
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
index 543973220cf5e57705332a0f9fa441b2deee6822..d4a1670911e3624d78f35b40599646492c0bbb94 100644 (file)
@@ -15,7 +15,7 @@ import com.google.gwt.user.client.ui.SimplePanel;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.Focusable;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
 
 public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner,
@@ -39,7 +39,7 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner,
 
     private Element errorIndicatorElement;
 
-    VPaintableWidget layout;
+    ComponentConnector layout;
 
     ShortcutActionHandler shortcutHandler;
 
@@ -136,8 +136,8 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner,
 
     void setIconUri(UIDL uidl, ApplicationConnection client) {
         final String iconUri = uidl
-                .hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON) ? uidl
-                .getStringAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON)
+                .hasAttribute(AbstractComponentConnector.ATTRIBUTE_ICON) ? uidl
+                .getStringAttribute(AbstractComponentConnector.ATTRIBUTE_ICON)
                 : null;
         if (iconUri == null) {
             if (icon != null) {
index 66d7c1920e8ea08df8c0c9840a8fd907b7ce6e20..0cf7d7fef863059a4b952e9578ca4b7f1001f8ee 100644 (file)
@@ -13,9 +13,9 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.LayoutManager;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public class VPanelPaintable extends VAbstractPaintableWidgetContainer
+public class VPanelPaintable extends AbstractComponentContainerConnector
         implements SimpleManagedLayout, PostLayoutListener {
 
     public static final String CLICK_EVENT_IDENTIFIER = "click";
@@ -113,7 +113,7 @@ public class VPanelPaintable extends VAbstractPaintableWidgetContainer
 
         // Render content
         final UIDL layoutUidl = uidl.getChildUIDL(0);
-        final VPaintableWidget newLayout = client.getPaintable(layoutUidl);
+        final ComponentConnector newLayout = client.getPaintable(layoutUidl);
         if (newLayout != getWidget().layout) {
             if (getWidget().layout != null) {
                 client.unregisterPaintable(getWidget().layout);
@@ -161,7 +161,7 @@ public class VPanelPaintable extends VAbstractPaintableWidgetContainer
         }
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         // NOP: layouts caption, errors etc not rendered in Panel
     }
 
index c99af21679f21ef9104477ee5b9253e3b73efc40..ef5584861d4338299768e443f724856c25dc6316 100644 (file)
@@ -30,7 +30,7 @@ import com.vaadin.terminal.gwt.client.RenderSpace;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaptionWrapper;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.VTooltip;
 import com.vaadin.terminal.gwt.client.ui.richtextarea.VRichTextArea;
 
@@ -174,7 +174,7 @@ public class VPopupView extends HTML implements Container, Iterable<Widget> {
      */
     protected class CustomPopup extends VOverlay {
 
-        private VPaintableWidget popupComponentPaintable = null;
+        private ComponentConnector popupComponentPaintable = null;
         Widget popupComponentWidget = null;
         VCaptionWrapper captionWrapper = null;
 
@@ -290,7 +290,7 @@ public class VPopupView extends HTML implements Container, Iterable<Widget> {
 
         public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
 
-            VPaintableWidget newPopupComponent = client.getPaintable(uidl
+            ComponentConnector newPopupComponent = client.getPaintable(uidl
                     .getChildUIDL(0));
 
             if (newPopupComponent != popupComponentPaintable) {
index daef250d5e0c3e050346cd9151c7d6a5b8171da7..0950d3180666467a5ae80c4fd52ee6a55ec8d0c7 100644 (file)
@@ -9,9 +9,9 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.VCaption;
 import com.vaadin.terminal.gwt.client.VCaptionWrapper;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public class VPopupViewPaintable extends VAbstractPaintableWidgetContainer {
+public class VPopupViewPaintable extends AbstractComponentContainerConnector {
 
     @Override
     protected boolean delegateCaptionHandling() {
@@ -21,7 +21,7 @@ public class VPopupViewPaintable extends VAbstractPaintableWidgetContainer {
     /**
      * 
      * 
-     * @see com.vaadin.terminal.gwt.client.VPaintableWidget#updateFromUIDL(com.vaadin.terminal.gwt.client.UIDL,
+     * @see com.vaadin.terminal.gwt.client.ComponentConnector#updateFromUIDL(com.vaadin.terminal.gwt.client.UIDL,
      *      com.vaadin.terminal.gwt.client.ApplicationConnection)
      */
     @Override
@@ -79,7 +79,7 @@ public class VPopupViewPaintable extends VAbstractPaintableWidgetContainer {
         }
     }// updateFromUIDL
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         if (VCaption.isNeeded(uidl, component.getState())) {
             if (getWidget().popup.captionWrapper != null) {
                 getWidget().popup.captionWrapper
index a18bc7defb30a8667e5b44a98ef001dc10828a06..93fe8504307c8aa81c7bcd25eb18fc5d37902d96 100644 (file)
@@ -10,7 +10,7 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 
-public class VProgressIndicatorPaintable extends VAbstractPaintableWidget {
+public class VProgressIndicatorPaintable extends AbstractComponentConnector {
 
     @Override
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
index edd00a214050c86de68160e131da92ed8407438b..3eff5b38293f34f76a3893d72987b450ffa47945 100644 (file)
@@ -66,8 +66,8 @@ import com.vaadin.terminal.gwt.client.TooltipInfo;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.VTooltip;
 import com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
 import com.vaadin.terminal.gwt.client.ui.dd.DDUtil;
@@ -1112,8 +1112,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
     void purgeUnregistryBag() {
         for (Iterator<Panel> iterator = lazyUnregistryBag.iterator(); iterator
                 .hasNext();) {
-            VPaintableMap.get(client)
-                    .unregisterChildPaintables(iterator.next());
+            ConnectorMap.get(client)
+                    .unregisterChildConnectors(iterator.next());
         }
         lazyUnregistryBag.clear();
     }
@@ -4474,7 +4474,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
                         addCell(uidl, cell.toString(), aligns[col++], style,
                                 isRenderHtmlInCells(), sorted, description);
                     } else {
-                        final VPaintableWidget cellContent = client
+                        final ComponentConnector cellContent = client
                                 .getPaintable((UIDL) cell);
 
                         addCell(uidl, cellContent.getWidget(),
@@ -4552,7 +4552,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
                 return index;
             }
 
-            protected void paintComponent(VPaintableWidget p, UIDL uidl) {
+            protected void paintComponent(ComponentConnector p, UIDL uidl) {
                 if (isAttached()) {
                     p.updateFromUIDL(uidl, client);
                 } else {
@@ -4568,8 +4568,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
                 super.onAttach();
                 if (pendingComponentPaints != null) {
                     for (UIDL uidl : pendingComponentPaints) {
-                        VPaintableWidget paintable = (VPaintableWidget) VPaintableMap
-                                .get(client).getPaintable(uidl.getId());
+                        ComponentConnector paintable = (ComponentConnector) ConnectorMap
+                                .get(client).getConnector(uidl.getId());
                         paintable.updateFromUIDL(uidl, client);
                     }
                     pendingComponentPaints.clear();
@@ -4758,7 +4758,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
 
                     if (!containsWidget) {
                         // Only text nodes has tooltips
-                        if (VPaintableMap.get(client).getWidgetTooltipInfo(
+                        if (ConnectorMap.get(client).getWidgetTooltipInfo(
                                 VScrollTable.this, target) != null) {
                             // Cell has description, use it
                             client.handleTooltipEvent(event,
@@ -5081,8 +5081,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
                     Element targetTdOrTr) {
                 mDown = true;
                 VTransferable transferable = new VTransferable();
-                transferable.setDragSource(VPaintableMap.get(client)
-                        .getPaintable(VScrollTable.this));
+                transferable.setDragSource(ConnectorMap.get(client)
+                        .getConnector(VScrollTable.this));
                 transferable.setData("itemId", "" + rowKey);
                 NodeList<TableCellElement> cells = rowElement.getCells();
                 for (int i = 0; i < cells.getLength(); i++) {
@@ -6093,8 +6093,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
         }
 
         @Override
-        public VPaintableWidget getPaintable() {
-            return VPaintableMap.get(client).getPaintable(VScrollTable.this);
+        public ComponentConnector getPaintable() {
+            return ConnectorMap.get(client).getConnector(VScrollTable.this);
         }
 
         public ApplicationConnection getApplicationConnection() {
@@ -6650,13 +6650,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
     }
 
     private boolean isDynamicWidth() {
-        VPaintableWidget paintable = VPaintableMap.get(client).getPaintable(
+        ComponentConnector paintable = ConnectorMap.get(client).getConnector(
                 this);
         return paintable.isUndefinedWidth();
     }
 
     private boolean isDynamicHeight() {
-        VPaintableWidget paintable = VPaintableMap.get(client).getPaintable(
+        ComponentConnector paintable = ConnectorMap.get(client).getConnector(
                 this);
         return paintable.isUndefinedHeight();
     }
index d3fc46c8ed47a005891fdd32b47bdafc7be902b8..80df4e41b007f40135ed118bcb7bbec2a3bf9737 100644 (file)
@@ -13,9 +13,9 @@ import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.DirectionalManagedLayout;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public class VScrollTablePaintable extends VAbstractPaintableWidgetContainer
+public class VScrollTablePaintable extends AbstractComponentContainerConnector
         implements DirectionalManagedLayout {
 
     /*
@@ -256,7 +256,7 @@ public class VScrollTablePaintable extends VAbstractPaintableWidgetContainer
         return (VScrollTable) super.getWidget();
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         // NOP, not rendered
     }
 
index 539e272582227f02c3ec242dc756668e317ef58d..96df1a81a5029a627827ec316da29d714543ff3b 100644 (file)
@@ -10,7 +10,7 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 
-public class VSliderPaintable extends VAbstractPaintableWidget {
+public class VSliderPaintable extends AbstractComponentConnector {
 
     @Override
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
index b740f82cc8bddf59345cf9fa3afc78fcf436b377..fcca633cef2008a926ccec5e1c69417b8a681d30 100644 (file)
@@ -27,8 +27,8 @@ import com.vaadin.terminal.gwt.client.TooltipInfo;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.label.VLabel;
 
 public class VTabsheet extends VTabsheetBase {
@@ -197,12 +197,12 @@ public class VTabsheet extends VTabsheetBase {
         @Override
         public boolean updateCaption(UIDL uidl) {
             if (uidl.hasAttribute(VTabsheetBasePaintable.ATTRIBUTE_TAB_DESCRIPTION)
-                    || uidl.hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ERROR)) {
+                    || uidl.hasAttribute(AbstractComponentConnector.ATTRIBUTE_ERROR)) {
                 TooltipInfo tooltipInfo = new TooltipInfo();
                 tooltipInfo
                         .setTitle(uidl
                                 .getStringAttribute(VTabsheetBasePaintable.ATTRIBUTE_TAB_DESCRIPTION));
-                if (uidl.hasAttribute(VAbstractPaintableWidget.ATTRIBUTE_ERROR)) {
+                if (uidl.hasAttribute(AbstractComponentConnector.ATTRIBUTE_ERROR)) {
                     tooltipInfo.setErrorUidl(uidl.getErrors());
                 }
                 client.registerTooltip(getTabsheet(), getElement(),
@@ -547,13 +547,13 @@ public class VTabsheet extends VTabsheetBase {
     }
 
     boolean isDynamicWidth() {
-        VPaintableWidget paintable = VPaintableMap.get(client).getPaintable(
+        ComponentConnector paintable = ConnectorMap.get(client).getConnector(
                 this);
         return paintable.isUndefinedWidth();
     }
 
     boolean isDynamicHeight() {
-        VPaintableWidget paintable = VPaintableMap.get(client).getPaintable(
+        ComponentConnector paintable = ConnectorMap.get(client).getConnector(
                 this);
         return paintable.isUndefinedHeight();
     }
@@ -757,7 +757,7 @@ public class VTabsheet extends VTabsheetBase {
         tab.recalculateCaptionWidth();
 
         UIDL tabContentUIDL = null;
-        VPaintableWidget tabContentPaintable = null;
+        ComponentConnector tabContentPaintable = null;
         Widget tabContentWidget = null;
         if (tabUidl.getChildCount() > 0) {
             tabContentUIDL = tabUidl.getChildUIDL(0);
@@ -824,15 +824,15 @@ public class VTabsheet extends VTabsheetBase {
     }
 
     private void renderContent(final UIDL contentUIDL) {
-        final VPaintableWidget content = client.getPaintable(contentUIDL);
+        final ComponentConnector content = client.getPaintable(contentUIDL);
         if (tp.getWidgetCount() > activeTabIndex) {
             Widget old = tp.getWidget(activeTabIndex);
             if (old != content) {
                 tp.remove(activeTabIndex);
-                VPaintableMap paintableMap = VPaintableMap.get(client);
-                if (paintableMap.isPaintable(old)) {
-                    paintableMap.unregisterPaintable(paintableMap
-                            .getPaintable(old));
+                ConnectorMap paintableMap = ConnectorMap.get(client);
+                if (paintableMap.isConnector(old)) {
+                    paintableMap.unregisterConnector(paintableMap
+                            .getConnector(old));
                 }
                 tp.insert(content.getWidget(), activeTabIndex);
             }
@@ -918,8 +918,8 @@ public class VTabsheet extends VTabsheetBase {
      */
     private void updateTabScroller() {
         if (!isDynamicWidth()) {
-            VPaintableWidget paintable = VPaintableMap.get(client)
-                    .getPaintable(this);
+            ComponentConnector paintable = ConnectorMap.get(client)
+                    .getConnector(this);
             DOM.setStyleAttribute(tabs, "width", paintable.getDeclaredWidth());
         }
 
@@ -1016,10 +1016,10 @@ public class VTabsheet extends VTabsheetBase {
     }
 
     @Override
-    protected VPaintableWidget getTab(int index) {
+    protected ComponentConnector getTab(int index) {
         if (tp.getWidgetCount() > index) {
             Widget widget = tp.getWidget(index);
-            return VPaintableMap.get(client).getPaintable(widget);
+            return ConnectorMap.get(client).getConnector(widget);
         }
         return null;
     }
index 8552f45bd95d3b3cba1cc340394c3213ba09e82b..f1002165bfc5a63529027ea6456baf59c6ef4b9d 100644 (file)
@@ -13,7 +13,7 @@ import com.google.gwt.user.client.ui.ComplexPanel;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 abstract class VTabsheetBase extends ComplexPanel {
 
@@ -69,7 +69,7 @@ abstract class VTabsheetBase extends ComplexPanel {
      * Implement in extending classes. This method should return the Paintable
      * corresponding to the given index.
      */
-    protected abstract VPaintableWidget getTab(int index);
+    protected abstract ComponentConnector getTab(int index);
 
     /**
      * Implement in extending classes. This method should remove the rendered
index 0e29d653b646cab2d24a459adf57dd5670649a66..389b347e3758faad8cc5171717dae125b02f6cf3 100644 (file)
@@ -9,11 +9,11 @@ import java.util.Iterator;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 public abstract class VTabsheetBasePaintable extends
-        VAbstractPaintableWidgetContainer {
+        AbstractComponentContainerConnector {
 
     public static final String ATTRIBUTE_TAB_DISABLED = "disabled";
     public static final String ATTRIBUTE_TAB_DESCRIPTION = "description";
@@ -73,7 +73,7 @@ public abstract class VTabsheetBasePaintable extends
         }
 
         for (int i = 0; i < getWidget().getTabCount(); i++) {
-            VPaintableWidget p = getWidget().getTab(i);
+            ComponentConnector p = getWidget().getTab(i);
             // During the initial rendering the paintable might be null (this is
             // weird...)
             if (p != null) {
@@ -85,12 +85,12 @@ public abstract class VTabsheetBasePaintable extends
         for (Iterator<Widget> iterator = oldWidgets.iterator(); iterator
                 .hasNext();) {
             Widget oldWidget = iterator.next();
-            VPaintableWidget oldPaintable = VPaintableMap.get(client)
-                    .getPaintable(oldWidget);
+            ComponentConnector oldPaintable = ConnectorMap.get(client)
+                    .getConnector(oldWidget);
             if (oldWidget.isAttached()) {
                 oldWidget.removeFromParent();
             }
-            VPaintableMap.get(client).unregisterPaintable(oldPaintable);
+            ConnectorMap.get(client).unregisterConnector(oldPaintable);
         }
 
     }
index 6bedcc704d3aa209af82d07c3f4af024f1f11f33..c4b3a6065fdb813b3a38ad2ac5a5e0baf9716e5b 100644 (file)
@@ -8,7 +8,7 @@ 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.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 public class VTabsheetPaintable extends VTabsheetBasePaintable implements
         SimpleManagedLayout {
@@ -73,7 +73,7 @@ public class VTabsheetPaintable extends VTabsheetBasePaintable implements
         return (VTabsheet) super.getWidget();
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         /* Tabsheet does not render its children's captions */
     }
 
index b44168eb426fd42d7e09f5abe941f3b7c7b05603..a2908c4ab2e8af45cff4aa4977d44b1a938d459b 100644 (file)
@@ -13,7 +13,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
 
-public class VTextFieldPaintable extends VAbstractPaintableWidget implements
+public class VTextFieldPaintable extends AbstractComponentConnector implements
         BeforeShortcutActionListener {
 
     @Override
index d0cc52cffba09cc553ec8856849cb616197c8bd7..7e2720c8ccf569e91bc95d003a5644d92ecae877 100644 (file)
@@ -42,8 +42,8 @@ import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.MouseEventDetails;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.VTooltip;
 import com.vaadin.terminal.gwt.client.ui.dd.DDUtil;
 import com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler;
@@ -358,8 +358,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler,
                 }
 
                 @Override
-                public VPaintableWidget getPaintable() {
-                    return VPaintableMap.get(client).getPaintable(VTree.this);
+                public ComponentConnector getPaintable() {
+                    return ConnectorMap.get(client).getConnector(VTree.this);
                 }
 
                 public ApplicationConnection getApplicationConnection() {
@@ -710,7 +710,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler,
                     if (mouseDownEvent != null) {
                         // start actual drag on slight move when mouse is down
                         VTransferable t = new VTransferable();
-                        t.setDragSource(VPaintableMap.get(client).getPaintable(
+                        t.setDragSource(ConnectorMap.get(client).getConnector(
                                 VTree.this));
                         t.setData("itemId", key);
                         VDragEvent drag = VDragAndDropManager.get().startDrag(
index 1754192501c7705dbc644c7b299eb9e17022dfa1..4cbcc666b681818576171382e46357af6bf28dbf 100644 (file)
@@ -12,14 +12,14 @@ import com.vaadin.terminal.gwt.client.TooltipInfo;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.ui.VTree.TreeNode;
 
-public class VTreePaintable extends VAbstractPaintableWidget {
+public class VTreePaintable extends AbstractComponentConnector {
 
     public static final String ATTRIBUTE_NODE_STYLE = "style";
     public static final String ATTRIBUTE_NODE_CAPTION = "caption";
-    public static final String ATTRIBUTE_NODE_ICON = VAbstractPaintableWidget.ATTRIBUTE_ICON;
+    public static final String ATTRIBUTE_NODE_ICON = AbstractComponentConnector.ATTRIBUTE_ICON;
 
     public static final String ATTRIBUTE_ACTION_CAPTION = "caption";
-    public static final String ATTRIBUTE_ACTION_ICON = VAbstractPaintableWidget.ATTRIBUTE_ICON;
+    public static final String ATTRIBUTE_ACTION_ICON = AbstractComponentConnector.ATTRIBUTE_ICON;
 
     @Override
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
index 0861d60d9e63377416d6be607bfe22da26103940..289e4c7668f163851561267c3c88b10e5199ff33 100644 (file)
@@ -10,7 +10,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.VUIDLBrowser;
 
-public class VUnknownComponentPaintable extends VAbstractPaintableWidget {
+public class VUnknownComponentPaintable extends AbstractComponentConnector {
 
     @Override
     protected boolean delegateCaptionHandling() {
index 8ca385cbb799e72af3511b5b5d65b2424e9bb0a0..92ab5b071a20b9f7c0bcae5f93fa3d70222b5a4b 100644 (file)
@@ -9,7 +9,7 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 
-public class VUploadPaintable extends VAbstractPaintableWidget {
+public class VUploadPaintable extends AbstractComponentConnector {
 
     @Override
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
index 05c070f631c4874da58e564028685b43c7ea1fd2..b9ece35179ea3b5cb1d07ffe4118688e887e23f2 100644 (file)
@@ -27,7 +27,7 @@ import com.vaadin.terminal.gwt.client.Focusable;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
 
 /**
@@ -44,7 +44,7 @@ public class VView extends SimplePanel implements ResizeHandler,
 
     String theme;
 
-    VPaintableWidget layout;
+    ComponentConnector layout;
 
     final LinkedHashSet<VWindow> subWindows = new LinkedHashSet<VWindow>();
 
@@ -225,7 +225,7 @@ public class VView extends SimplePanel implements ResizeHandler,
         if (uidl.hasAttribute("scrollTo")) {
             Scheduler.get().scheduleDeferred(new Command() {
                 public void execute() {
-                    final VPaintableWidget paintable = (VPaintableWidget) uidl
+                    final ComponentConnector paintable = (ComponentConnector) uidl
                             .getPaintableAttribute("scrollTo", connection);
                     paintable.getWidget().getElement()
                             .scrollIntoView();
index 750bba77d30e2e32e6af8ef6ff3e23e520bd8e01..d26c5b71f5cc86d32154a8b3dd62fc875f9ae888 100644 (file)
@@ -24,10 +24,10 @@ import com.vaadin.terminal.gwt.client.Focusable;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
-public class VViewPaintable extends VAbstractPaintableWidgetContainer {
+public class VViewPaintable extends AbstractComponentContainerConnector {
 
     private static final String CLICK_EVENT_IDENTIFIER = VPanelPaintable.CLICK_EVENT_IDENTIFIER;
 
@@ -126,7 +126,7 @@ public class VViewPaintable extends VAbstractPaintableWidgetContainer {
 
         // Draw this application level window
         UIDL childUidl = uidl.getChildUIDL(childIndex);
-        final VPaintableWidget lo = client.getPaintable(childUidl);
+        final ComponentConnector lo = client.getPaintable(childUidl);
 
         if (getWidget().layout != null) {
             if (getWidget().layout != lo) {
@@ -184,8 +184,8 @@ public class VViewPaintable extends VAbstractPaintableWidgetContainer {
         for (final Iterator<VWindow> rem = removedSubWindows.iterator(); rem
                 .hasNext();) {
             final VWindow w = rem.next();
-            client.unregisterPaintable(VPaintableMap.get(getConnection())
-                    .getPaintable(w));
+            client.unregisterPaintable(ConnectorMap.get(getConnection())
+                    .getConnector(w));
             getWidget().subWindows.remove(w);
             w.hide();
         }
@@ -194,7 +194,7 @@ public class VViewPaintable extends VAbstractPaintableWidgetContainer {
             // set focused component when render phase is finished
             Scheduler.get().scheduleDeferred(new Command() {
                 public void execute() {
-                    VPaintableWidget paintable = (VPaintableWidget) uidl
+                    ComponentConnector paintable = (ComponentConnector) uidl
                             .getPaintableAttribute("focused", getConnection());
 
                     final Widget toBeFocused = paintable
@@ -315,7 +315,7 @@ public class VViewPaintable extends VAbstractPaintableWidgetContainer {
         }
     };
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         // NOP The main view never draws caption for its layout
     }
 
index 31bb8943e941af596fd1a174c4e6276545308251..48bcd4452b8c953d32804b107dd08975fe8b1569 100644 (file)
@@ -32,7 +32,7 @@ import com.vaadin.terminal.gwt.client.Console;
 import com.vaadin.terminal.gwt.client.EventId;
 import com.vaadin.terminal.gwt.client.Focusable;
 import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
 
 /**
@@ -78,7 +78,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
 
     public static final int Z_INDEX = 10000;
 
-    VPaintableWidget layout;
+    ComponentConnector layout;
 
     Element contents;
 
@@ -931,7 +931,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
                 while (w != null) {
                     if (w instanceof Console) {
                         return true; // allow debug-window clicks
-                    } else if (w instanceof VPaintableWidget) {
+                    } else if (w instanceof ComponentConnector) {
                         return false;
                     }
                     w = w.getParent();
index 4d3d62afe240a54de58a35fcd2ae95be434416fd..b27114aef81fb70c534b591999b4c01a5434b9cb 100644 (file)
@@ -15,10 +15,10 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
 
-public class VWindowPaintable extends VAbstractPaintableWidgetContainer
+public class VWindowPaintable extends AbstractComponentContainerConnector
         implements BeforeShortcutActionListener, SimpleManagedLayout,
         PostLayoutListener {
 
@@ -79,7 +79,7 @@ public class VWindowPaintable extends VAbstractPaintableWidgetContainer
             getWidget()
                     .setCaption(
                             getState().getCaption(),
-                            uidl.getStringAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON));
+                            uidl.getStringAttribute(AbstractComponentConnector.ATTRIBUTE_ICON));
         }
 
         getWidget().visibilityChangesDisabled = true;
@@ -131,7 +131,7 @@ public class VWindowPaintable extends VAbstractPaintableWidgetContainer
             childUidl = uidl.getChildUIDL(childIndex++);
         }
 
-        final VPaintableWidget lo = client.getPaintable(childUidl);
+        final ComponentConnector lo = client.getPaintable(childUidl);
         if (getWidget().layout != null) {
             if (getWidget().layout != lo) {
                 // remove old
@@ -285,7 +285,7 @@ public class VWindowPaintable extends VAbstractPaintableWidgetContainer
         }
     }
 
-    public void updateCaption(VPaintableWidget component, UIDL uidl) {
+    public void updateCaption(ComponentConnector component, UIDL uidl) {
         // NOP, window has own caption, layout captio not rendered
     }
 
index 4d752d4527d1bf29d1fc73c4abd33c4f7922e596..6b7e986f3a07c1be007d2ab9de3cfd576f48fc66 100644 (file)
@@ -9,7 +9,7 @@ import com.google.gwt.user.client.Command;
 import com.vaadin.event.Transferable;
 import com.vaadin.event.dd.DropTarget;
 import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.UIDL;
 
 public abstract class VAbstractDropHandler implements VDropHandler {
@@ -129,6 +129,6 @@ public abstract class VAbstractDropHandler implements VDropHandler {
      * side counterpart of the Paintable is expected to implement
      * {@link DropTarget} interface.
      */
-    public abstract VPaintableWidget getPaintable();
+    public abstract ComponentConnector getPaintable();
 
 }
index 4664c595447dea181f7f685ae1c87e712c8ba9dc..8ee1a721d134e0cf11d2b772a1ff72ca51cb1269 100644 (file)
@@ -26,7 +26,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.MouseEventDetails;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ValueMap;
 
 /**
@@ -333,7 +333,7 @@ public class VDragAndDropManager {
             }
 
             private void addActiveDragSourceStyleName() {
-                VPaintableWidget dragSource = currentDrag.getTransferable()
+                ComponentConnector dragSource = currentDrag.getTransferable()
                         .getDragSource();
                 dragSource.getWidget().addStyleName(
                         ACTIVE_DRAG_SOURCE_STYLENAME);
@@ -499,7 +499,7 @@ public class VDragAndDropManager {
                      * handled. E.g. hidden on start, removed in drophandler ->
                      * would flicker in case removed eagerly.
                      */
-                    final VPaintableWidget dragSource = currentDrag
+                    final ComponentConnector dragSource = currentDrag
                             .getTransferable().getDragSource();
                     final ApplicationConnection client = currentDropHandler
                             .getApplicationConnection();
@@ -543,7 +543,7 @@ public class VDragAndDropManager {
 
     }
 
-    private void removeActiveDragSourceStyleName(VPaintableWidget dragSource) {
+    private void removeActiveDragSourceStyleName(ComponentConnector dragSource) {
         dragSource.getWidget().removeStyleName(
                 ACTIVE_DRAG_SOURCE_STYLENAME);
     }
@@ -579,7 +579,7 @@ public class VDragAndDropManager {
         if (currentDropHandler == null) {
             return;
         }
-        VPaintableWidget paintable = currentDropHandler.getPaintable();
+        ComponentConnector paintable = currentDropHandler.getPaintable();
         ApplicationConnection client = currentDropHandler
                 .getApplicationConnection();
         /*
index 2be75ae3d9dedb82f59bca82ef90bce49f2b5377..22b8054c77c16e20d1aae7b493280577bba578cb 100644 (file)
@@ -3,9 +3,9 @@
  */
 package com.vaadin.terminal.gwt.client.ui.dd;
 
-import com.vaadin.terminal.gwt.client.VPaintableMap;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 /**
  * TODO Javadoc!
@@ -17,16 +17,16 @@ final public class VDragSourceIs extends VAcceptCriterion {
     @Override
     protected boolean accept(VDragEvent drag, UIDL configuration) {
         try {
-            VPaintableWidget component = drag.getTransferable().getDragSource();
+            ComponentConnector component = drag.getTransferable().getDragSource();
             int c = configuration.getIntAttribute("c");
             for (int i = 0; i < c; i++) {
                 String requiredPid = configuration
                         .getStringAttribute("component" + i);
                 VDropHandler currentDropHandler = VDragAndDropManager.get()
                         .getCurrentDropHandler();
-                VPaintableWidget paintable = (VPaintableWidget) VPaintableMap
+                ComponentConnector paintable = (ComponentConnector) ConnectorMap
                         .get(currentDropHandler.getApplicationConnection())
-                        .getPaintable(requiredPid);
+                        .getConnector(requiredPid);
                 if (paintable == component) {
                     return true;
                 }
index d84dea4833a9930a5267605ab569669645ced422..8fc3e4faf1727856bb747107e8a2717903f8ebd6 100644 (file)
@@ -4,7 +4,7 @@
 package com.vaadin.terminal.gwt.client.ui.dd;
 
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 /**
  * Vaadin Widgets that want to receive something via drag and drop implement
@@ -61,7 +61,7 @@ public interface VDropHandler {
     /**
      * Returns the Paintable into which this DragHandler is associated
      */
-    public VPaintableWidget getPaintable();
+    public ComponentConnector getPaintable();
 
     /**
      * Returns the application connection to which this {@link VDropHandler}
index 48f748a4f350747046ac7f20335cebf38d078eb6..6d6f7c776d09cb56c86e582fa065836a881c84b6 100644 (file)
@@ -3,13 +3,13 @@
  */
 package com.vaadin.terminal.gwt.client.ui.dd;
 
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 /**
  * Used to detect Widget from widget tree that has {@link #getDropHandler()}
  * 
  * Decide whether to get rid of this class. If so, {@link VAbstractDropHandler}
- * must extend {@link VPaintableWidget}.
+ * must extend {@link ComponentConnector}.
  * 
  */
 public interface VHasDropHandler {
index 3ea7d1a482596c6e2b5e73112ac9cc96001b6fcd..3a52daf63d5e5e74e165ecc9c56e2b9188f18180 100644 (file)
@@ -6,9 +6,9 @@
  */
 package com.vaadin.terminal.gwt.client.ui.dd;
 
-import com.vaadin.terminal.gwt.client.VPaintableMap;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 final public class VIsOverId extends VAcceptCriterion {
 
@@ -19,11 +19,11 @@ final public class VIsOverId extends VAcceptCriterion {
             String pid = configuration.getStringAttribute("s");
             VDropHandler currentDropHandler = VDragAndDropManager.get()
                     .getCurrentDropHandler();
-            VPaintableWidget paintable = currentDropHandler.getPaintable();
-            VPaintableMap paintableMap = VPaintableMap.get(currentDropHandler
+            ComponentConnector paintable = currentDropHandler.getPaintable();
+            ConnectorMap paintableMap = ConnectorMap.get(currentDropHandler
                     .getApplicationConnection());
 
-            String pid2 = paintableMap.getPid(paintable);
+            String pid2 = paintableMap.getConnectorId(paintable);
             if (pid2.equals(pid)) {
                 Object searchedId = drag.getDropDetails().get("itemIdOver");
                 String[] stringArrayAttribute = configuration
index 16de428d9c6680708c2545f04636358c8ccdf07b..adf1859013bea4628833db474187e440b10c05a8 100644 (file)
@@ -6,9 +6,9 @@
  */
 package com.vaadin.terminal.gwt.client.ui.dd;
 
-import com.vaadin.terminal.gwt.client.VPaintableMap;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 final public class VItemIdIs extends VAcceptCriterion {
 
@@ -16,12 +16,12 @@ final public class VItemIdIs extends VAcceptCriterion {
     protected boolean accept(VDragEvent drag, UIDL configuration) {
         try {
             String pid = configuration.getStringAttribute("s");
-            VPaintableWidget dragSource = drag.getTransferable()
+            ComponentConnector dragSource = drag.getTransferable()
                     .getDragSource();
             VDropHandler currentDropHandler = VDragAndDropManager.get()
                     .getCurrentDropHandler();
-            String pid2 = VPaintableMap.get(
-                    currentDropHandler.getApplicationConnection()).getPid(
+            String pid2 = ConnectorMap.get(
+                    currentDropHandler.getApplicationConnection()).getConnectorId(
                     dragSource);
             if (pid2.equals(pid)) {
                 Object searchedId = drag.getTransferable().getData("itemId");
index 55c11105469317947719b17beab514d4906c1a40..0882d1431d2ca74269454f8acce49b6a0caad996 100644 (file)
@@ -6,15 +6,15 @@
  */
 package com.vaadin.terminal.gwt.client.ui.dd;
 
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.UIDL;
 
 final public class VSourceIsTarget extends VAcceptCriterion {
 
     @Override
     protected boolean accept(VDragEvent drag, UIDL configuration) {
-        VPaintableWidget dragSource = drag.getTransferable().getDragSource();
-        VPaintableWidget paintable = VDragAndDropManager.get().getCurrentDropHandler()
+        ComponentConnector dragSource = drag.getTransferable().getDragSource();
+        ComponentConnector paintable = VDragAndDropManager.get().getCurrentDropHandler()
                 .getPaintable();
 
         return paintable == dragSource;
index f81567f90655b813b06daff3153ba80daba0dbac..f87da378d7714ad7e11c726bd87a8f07035d12f1 100644 (file)
@@ -8,7 +8,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import com.vaadin.event.dd.DragSource;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 
 /**
  * Client side counterpart for Transferable in com.vaadin.event.Transferable
@@ -16,7 +16,7 @@ import com.vaadin.terminal.gwt.client.VPaintableWidget;
  */
 public class VTransferable {
 
-    private VPaintableWidget component;
+    private ComponentConnector component;
 
     private final Map<String, Object> variables = new HashMap<String, Object>();
 
@@ -26,7 +26,7 @@ public class VTransferable {
      * 
      * @return the component
      */
-    public VPaintableWidget getDragSource() {
+    public ComponentConnector getDragSource() {
         return component;
     }
 
@@ -41,7 +41,7 @@ public class VTransferable {
      * @param component
      *            the component to set
      */
-    public void setDragSource(VPaintableWidget component) {
+    public void setDragSource(ComponentConnector component) {
         this.component = component;
     }
 
index c61a8ef838ac58b445650f2c840bfcaba1cce875..5b7ce96cab021fe517520e1e58a2b5088a86c53b 100644 (file)
@@ -10,9 +10,9 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 
-public class VLabelPaintable extends VAbstractPaintableWidget {
+public class VLabelPaintable extends AbstractComponentConnector {
     public VLabelPaintable() {
     }
 
index 8e7d1310f38b00f0be077e9236c74de14bad09d5..4d1b607460d9d812a33cd66cb7be9b9c97a43e8d 100644 (file)
@@ -5,21 +5,21 @@ package com.vaadin.terminal.gwt.client.ui.layout;
 
 import com.vaadin.terminal.gwt.client.LayoutManager;
 import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.ManagedLayout;
 
 public class VPaintableLayoutSlot extends VLayoutSlot {
 
-    final VPaintableWidget paintable;
+    final ComponentConnector paintable;
     private LayoutManager layoutManager;
 
-    public VPaintableLayoutSlot(String baseClassName, VPaintableWidget paintable) {
+    public VPaintableLayoutSlot(String baseClassName, ComponentConnector paintable) {
         super(baseClassName, paintable.getWidget());
         this.paintable = paintable;
         layoutManager = paintable.getLayoutManager();
     }
 
-    public VPaintableWidget getPaintable() {
+    public ComponentConnector getPaintable() {
         return paintable;
     }
 
index c1678369b33bc4b096c1749ea5fac7161d9509cd..56f3ca42f98e3c87f1009163d1aafd1dafae6311 100644 (file)
@@ -27,7 +27,7 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
 import com.vaadin.terminal.gwt.client.ui.Field;
 import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler;
 import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
@@ -302,7 +302,7 @@ public class VRichTextArea extends Composite implements Field, ChangeHandler,
             shortcutHandler
                     .handleKeyboardEvent(com.google.gwt.user.client.Event
                             .as(event.getNativeEvent()),
-                            VPaintableMap.get(client).getPaintable(this));
+                            ConnectorMap.get(client).getConnector(this));
         }
     }
 
index b374ce9884fbdc86339dc158ae7099372bec1fb9..c4ef733662c4bffdabb62e787db5617b8b14e3d2 100644 (file)
@@ -9,9 +9,9 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 
-public class VRichTextAreaPaintable extends VAbstractPaintableWidget implements
+public class VRichTextAreaPaintable extends AbstractComponentConnector implements
         BeforeShortcutActionListener {
 
     @Override
index 51d8e9478a7311896a9bc7855e58eefd1b9adeab..9ce2dfd6be214e9bd819f0a655ee13aeffda084c 100644 (file)
@@ -78,7 +78,7 @@ import com.vaadin.ui.Root;
  * A server side component sends its state to the client in a paint request (see
  * {@link Paintable} and {@link PaintTarget} on the server side). The client
  * widget receives these paint requests as calls to
- * {@link com.vaadin.terminal.gwt.client.VPaintableWidget#updateFromUIDL()}. The
+ * {@link com.vaadin.terminal.gwt.client.ComponentConnector#updateFromUIDL()}. The
  * client component communicates back to the server by sending a list of
  * variable changes (see {@link ApplicationConnection#updateVariable()} and
  * {@link VariableOwner#changeVariables(Object, Map)}).
index 3c52bd6a54c5ea1bcebc86948b8d9f16f107fa54..d7af52b10d671238bdeec689af1565a94fb13499 100644 (file)
@@ -22,7 +22,7 @@ import com.google.gwt.json.client.JSONArray;
 import com.google.gwt.json.client.JSONObject;
 import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
 import com.google.gwt.user.rebind.SourceWriter;
-import com.vaadin.terminal.gwt.client.VPaintableMap;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
 import com.vaadin.terminal.gwt.client.communication.JsonDecoder;
 import com.vaadin.terminal.gwt.client.communication.VaadinSerializer;
 
@@ -108,7 +108,7 @@ public class SerializerGenerator extends Generator {
 
         sourceWriter.println("public " + beanTypeName + " deserialize("
                 + JSONObject.class.getName() + " jsonValue, "
-                + VPaintableMap.class.getName() + " idMapper) {");
+                + ConnectorMap.class.getName() + " idMapper) {");
         sourceWriter.indent();
 
         // VButtonState state = GWT.create(VButtonState.class);
index 2150748b546b72c97cdb8585f8257eec8d3148e7..0ae8e47df3a3431393323ef5109e5d8e7e26c966 100644 (file)
@@ -23,7 +23,7 @@ import com.google.gwt.core.ext.typeinfo.TypeOracle;
 import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
 import com.google.gwt.user.rebind.SourceWriter;
 import com.vaadin.terminal.Paintable;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.VViewPaintable;
 import com.vaadin.ui.ClientWidget;
 import com.vaadin.ui.ClientWidget.LoadStyle;
@@ -71,7 +71,7 @@ import com.vaadin.ui.Root;
  */
 public class WidgetMapGenerator extends Generator {
 
-    private static String paintableClassName = VPaintableWidget.class.getName();
+    private static String paintableClassName = ComponentConnector.class.getName();
 
     private String packageName;
     private String className;
@@ -165,7 +165,7 @@ public class WidgetMapGenerator extends Generator {
                 .iterator(); iterator.hasNext();) {
             Class<? extends Paintable> class1 = iterator.next();
 
-            Class<? extends com.vaadin.terminal.gwt.client.VPaintableWidget> clientClass = getClientClass(class1);
+            Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> clientClass = getClientClass(class1);
             if (typeOracle.findType(clientClass.getName()) == null) {
                 // GWT widget not inherited
                 logger.log(Type.WARN, "Widget class " + clientClass.getName()
@@ -251,10 +251,10 @@ public class WidgetMapGenerator extends Generator {
 
         ArrayList<Class<? extends Paintable>> lazyLoadedWidgets = new ArrayList<Class<? extends Paintable>>();
 
-        HashSet<Class<? extends com.vaadin.terminal.gwt.client.VPaintableWidget>> widgetsWithInstantiator = new HashSet<Class<? extends com.vaadin.terminal.gwt.client.VPaintableWidget>>();
+        HashSet<Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector>> widgetsWithInstantiator = new HashSet<Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector>>();
 
         for (Class<? extends Paintable> class1 : paintablesHavingWidgetAnnotation) {
-            Class<? extends com.vaadin.terminal.gwt.client.VPaintableWidget> clientClass = getClientClass(class1);
+            Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> clientClass = getClientClass(class1);
             if (widgetsWithInstantiator.contains(clientClass)) {
                 continue;
             }
@@ -317,7 +317,7 @@ public class WidgetMapGenerator extends Generator {
             }
             first = false;
             ClientWidget annotation = class2.getAnnotation(ClientWidget.class);
-            Class<? extends com.vaadin.terminal.gwt.client.VPaintableWidget> value = annotation
+            Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> value = annotation
                     .value();
             sourceWriter.print(value.getName() + ".class");
         }
@@ -364,7 +364,7 @@ public class WidgetMapGenerator extends Generator {
                 .println("fullyQualifiedName = fullyQualifiedName.intern();");
 
         for (Class<? extends Paintable> class1 : paintablesHavingWidgetAnnotation) {
-            Class<? extends com.vaadin.terminal.gwt.client.VPaintableWidget> clientClass = getClientClass(class1);
+            Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> clientClass = getClientClass(class1);
             sourceWriter.print("if ( fullyQualifiedName == \"");
             sourceWriter.print(class1.getName());
             sourceWriter.print("\" ) { ensureInstantiator("
@@ -380,9 +380,9 @@ public class WidgetMapGenerator extends Generator {
 
     }
 
-    private static Class<? extends com.vaadin.terminal.gwt.client.VPaintableWidget> getClientClass(
+    private static Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> getClientClass(
             Class<? extends Paintable> class1) {
-        Class<? extends com.vaadin.terminal.gwt.client.VPaintableWidget> clientClass;
+        Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> clientClass;
         if (Root.class == class1) {
             clientClass = VViewPaintable.class;
         } else {
index 533546c5575fd1ead5c16301178110214b1216ca..757eedfe2a7bdc119b524e90ea3768226afa39c4 100644 (file)
@@ -31,7 +31,7 @@ import com.vaadin.terminal.PaintTarget.PaintStatus;
 import com.vaadin.terminal.Resource;
 import com.vaadin.terminal.Terminal;
 import com.vaadin.terminal.gwt.client.ComponentState;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 import com.vaadin.terminal.gwt.server.ComponentSizeValidator;
 import com.vaadin.terminal.gwt.server.RpcManager;
 import com.vaadin.terminal.gwt.server.RpcTarget;
@@ -775,7 +775,7 @@ public abstract class AbstractComponent implements Component, MethodEventSource
                 // related code has been updated
                 if (getIcon() != null) {
                     target.addAttribute(
-                            VAbstractPaintableWidget.ATTRIBUTE_ICON, getIcon());
+                            AbstractComponentConnector.ATTRIBUTE_ICON, getIcon());
                 }
 
                 if (eventIdentifiers != null) {
index f949bc3da86805948ba8293d288a310001f2ef52..d06c4ce28e6fb5a2df4614450d3517fb018ea718 100644 (file)
@@ -30,7 +30,7 @@ import com.vaadin.terminal.CompositeErrorMessage;
 import com.vaadin.terminal.ErrorMessage;
 import com.vaadin.terminal.PaintException;
 import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 
 /**
  * <p>
@@ -173,13 +173,13 @@ public abstract class AbstractField<T> extends AbstractComponent implements
 
         // Adds the required attribute
         if (!isReadOnly() && isRequired()) {
-            target.addAttribute(VAbstractPaintableWidget.ATTRIBUTE_REQUIRED,
+            target.addAttribute(AbstractComponentConnector.ATTRIBUTE_REQUIRED,
                     true);
         }
 
         // Hide the error indicator if needed
         if (shouldHideErrors()) {
-            target.addAttribute(VAbstractPaintableWidget.ATTRIBUTE_HIDEERRORS,
+            target.addAttribute(AbstractComponentConnector.ATTRIBUTE_HIDEERRORS,
                     true);
         }
     }
index d944e8b3c83277746121b89847b13e19ca260a0a..93f17f38b8f237f8faf7ecf6e6cfada601b22929 100644 (file)
@@ -11,7 +11,7 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.widgetsetutils.CustomWidgetMapGenerator;
 import com.vaadin.terminal.gwt.widgetsetutils.EagerWidgetMapGenerator;
 import com.vaadin.terminal.gwt.widgetsetutils.LazyWidgetMapGenerator;
@@ -36,7 +36,7 @@ public @interface ClientWidget {
     /**
      * @return the client side counterpart for the annotated component
      */
-    Class<? extends VPaintableWidget> value();
+    Class<? extends ComponentConnector> value();
 
     /**
      * Depending on the used WidgetMap generator, these optional hints may be
index 0ee1f899d66b8ac5955dda6214a16d65f0fafb4c..5519750e89dae4c7f4173779e72ba74da59d6f5d 100644 (file)
@@ -23,7 +23,7 @@ import com.vaadin.event.FieldEvents.FocusListener;
 import com.vaadin.terminal.PaintException;
 import com.vaadin.terminal.PaintTarget;
 import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.VFilterSelectPaintable;
 
 /**
@@ -150,7 +150,7 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering,
 
         // Adds the required attribute
         if (!isReadOnly() && isRequired()) {
-            target.addAttribute(VAbstractPaintableWidget.ATTRIBUTE_REQUIRED,
+            target.addAttribute(AbstractComponentConnector.ATTRIBUTE_REQUIRED,
                     true);
         }
 
@@ -276,7 +276,7 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering,
 
         // Hide the error indicator if needed
         if (shouldHideErrors()) {
-            target.addAttribute(VAbstractPaintableWidget.ATTRIBUTE_HIDEERRORS,
+            target.addAttribute(AbstractComponentConnector.ATTRIBUTE_HIDEERRORS,
                     true);
         }
     }
index d150f9bee4efffe91fb27cf6a074d071fa70982f..398ded3212e9bfe3003c3a6db4ec7f9f92633034 100644 (file)
@@ -19,7 +19,7 @@ import com.vaadin.terminal.KeyMapper;
 import com.vaadin.terminal.PaintException;
 import com.vaadin.terminal.PaintTarget;
 import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.VTabsheet;
 import com.vaadin.terminal.gwt.client.ui.VTabsheetBasePaintable;
 import com.vaadin.terminal.gwt.client.ui.VTabsheetPaintable;
@@ -394,7 +394,7 @@ public class TabSheet extends AbstractComponentContainer {
             // VCaption.updateCaption(uidl)
             final Resource icon = tab.getIcon();
             if (icon != null) {
-                target.addAttribute(VAbstractPaintableWidget.ATTRIBUTE_ICON,
+                target.addAttribute(AbstractComponentConnector.ATTRIBUTE_ICON,
                         icon);
             }
             final String caption = tab.getCaption();
index b6aeb55874933e315b7448df38df688edfc8aa82..b17c2230f6ac5391b7145eb334f473daac3e395a 100644 (file)
@@ -7,9 +7,9 @@ import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 
-public class VMyDragSourcePaintable extends VAbstractPaintableWidget {
+public class VMyDragSourcePaintable extends AbstractComponentConnector {
 
     @Override
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
index 81bbb09a5c663afdba554e5edd2dab6e1cf06d91..d83e52a2e09e789700b3725cbf6456def972e3c1 100644 (file)
@@ -2,7 +2,7 @@ package com.vaadin.tests.dd;
 
 import com.google.gwt.user.client.ui.Composite;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.VPaintableWidget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
 import com.vaadin.terminal.gwt.client.ui.dd.VDragEvent;
 import com.vaadin.terminal.gwt.client.ui.dd.VDropHandler;
 import com.vaadin.terminal.gwt.client.ui.dd.VHasDropHandler;
@@ -34,7 +34,7 @@ public class VMyDropTarget extends Composite implements VHasDropHandler,
         return this;
     }
 
-    public VPaintableWidget getPaintable() {
+    public ComponentConnector getPaintable() {
         // TODO Auto-generated method stub
         return null;
     }
index 425a892ef39735699588372adcc0b3dc55d69932..03ba0e4cb1d1dede0159062709964d25f23f0046 100644 (file)
@@ -7,9 +7,9 @@ import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
 
-public class VMyDropTargetPaintable extends VAbstractPaintableWidget {
+public class VMyDropTargetPaintable extends AbstractComponentConnector {
 
     @Override
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {