import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.ui.Field;
-import com.vaadin.terminal.gwt.client.ui.VAbstractPaintableWidget;
import com.vaadin.terminal.gwt.client.ui.VContextMenu;
import com.vaadin.terminal.gwt.client.ui.VNotification;
import com.vaadin.terminal.gwt.client.ui.VNotification.HideEvent;
if (!paintableMap.hasPaintable(pid)) {
// Create and register a new paintable if no old was found
VPaintableWidget p = widgetSet.createWidget(uidl, configuration);
- if (p instanceof VAbstractPaintableWidget) {
- ((VAbstractPaintableWidget) p).setConnection(this);
- ((VAbstractPaintableWidget) p).init();
- }
+ p.setConnection(this);
+ p.setId(pid);
+ p.init();
paintableMap.registerPaintable(pid, p);
}
return (VPaintableWidget) paintableMap.getPaintable(pid);
*/
public void updateFromUIDL(UIDL uidl, ApplicationConnection client);
- // /**
- // * 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);
+ /**
+ * 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();
+ public ApplicationConnection getConnection();
/**
* Sets the reference to ApplicationConnection. This method is called by the
* @param connection
* The ApplicationConnection that created this VPaintable
*/
- // public void setConnection(ApplicationConnection connection);
+ public void setConnection(ApplicationConnection connection);
/**
* Tests whether the component is enabled or not. A user can not interact
* @return true if the component is enabled, false otherwise
*/
// public boolean isEnabled();
+
+ /**
+ *
+ * Called once when the connection and id has been set
+ */
+ public void init();
+
}
public void updateFromUIDL(final UIDL uidl, ApplicationConnection client) {
getWidgetForPaintable().rendering = true;
-
+ // As VView is not created in the same way as all other paintables we
+ // have to set the id here
+ setId(uidl.getId());
getWidgetForPaintable().id = uidl.getId();
boolean firstPaint = getWidgetForPaintable().connection == null;
getWidgetForPaintable().connection = client;