accordinglytags/7.0.0.alpha2
@@ -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; |
@@ -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); | |||
} | |||
@@ -14,7 +14,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
* Updates can be sent back to the server using the | |||
* {@link ApplicationConnection#updateVariable()} methods. | |||
*/ | |||
public interface VPaintableWidget extends VPaintable { | |||
public interface ComponentConnector extends Connector { | |||
/* | |||
* (non-Javadoc) | |||
@@ -29,11 +29,11 @@ public interface VPaintableWidget extends VPaintable { | |||
public Widget getWidget(); | |||
/** | |||
* Returns the parent {@link VPaintableWidgetContainer} | |||
* Returns the parent {@link ComponentContainerConnector} | |||
* | |||
* @return | |||
*/ | |||
public VPaintableWidgetContainer getParent(); | |||
public ComponentContainerConnector getParent(); | |||
public LayoutManager getLayoutManager(); | |||
@@ -12,7 +12,7 @@ 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 { | |||
public interface ComponentContainerConnector extends ComponentConnector { | |||
/** | |||
* Update child components caption, description and error message. | |||
@@ -29,19 +29,19 @@ public interface VPaintableWidgetContainer extends VPaintableWidget { | |||
* @param uidl | |||
* UIDL of the child component. | |||
*/ | |||
void updateCaption(VPaintableWidget paintable, UIDL uidl); | |||
void updateCaption(ComponentConnector 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}. | |||
* {@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<VPaintableWidget> getChildren(); | |||
public Collection<ComponentConnector> getChildren(); | |||
} |
@@ -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 |
@@ -14,7 +14,7 @@ import com.vaadin.terminal.gwt.client.communication.SharedState; | |||
* @version @VERSION@ | |||
* @since 7.0.0 | |||
*/ | |||
public interface VPaintable { | |||
public interface Connector { | |||
/** | |||
* TODO | |||
* | |||
@@ -24,14 +24,14 @@ public interface VPaintable { | |||
public void updateFromUIDL(UIDL uidl, ApplicationConnection client); | |||
/** | |||
* Gets the current shared state of the paintable. | |||
* Gets the current shared state of the connector. | |||
* | |||
* @return state | |||
*/ | |||
public SharedState getState(); | |||
/** | |||
* Sets a new state for the paintable. | |||
* Sets a new state for the connector. | |||
* | |||
* @param state | |||
* The new state | |||
@@ -40,29 +40,29 @@ public interface VPaintable { | |||
public void setState(SharedState state); | |||
/** | |||
* Returns the id for this VPaintable. This must always be what has been set | |||
* Returns the id for this connector. This must always be what has been set | |||
* using {@link #setId(String)}. | |||
* | |||
* @return The id for the VPaintable. | |||
* @return The id for the connector. | |||
*/ | |||
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 | |||
* 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 VPaintable id is used to map the server and the client paintables | |||
* together. It is unique in this root and assigned by the framework. | |||
* 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 paintable. | |||
* The id of the connector. | |||
*/ | |||
public void setId(String id); | |||
/** | |||
* Gets ApplicationConnection instance that created this VPaintable. | |||
* Gets ApplicationConnection instance that created this connector. | |||
* | |||
* @return The ApplicationConnection as set by | |||
* {@link #setConnection(ApplicationConnection)} | |||
@@ -71,11 +71,11 @@ public interface VPaintable { | |||
/** | |||
* Sets the reference to ApplicationConnection. This method is called by the | |||
* framework when the VPaintable is created and should never be called | |||
* framework when the connector is created and should never be called | |||
* otherwise. | |||
* | |||
* @param connection | |||
* The ApplicationConnection that created this VPaintable | |||
* The ApplicationConnection that created this connector | |||
*/ | |||
public void setConnection(ApplicationConnection connection); | |||
@@ -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; | |||
} | |||
} |
@@ -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); | |||
@@ -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)) { |
@@ -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(); |
@@ -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) { |
@@ -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)); | |||
} | |||
@@ -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; | |||
} |
@@ -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; | |||
} | |||
@@ -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; | |||
} | |||
} |
@@ -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); | |||
} |
@@ -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(); |
@@ -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; | |||
} | |||
} |
@@ -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) { |
@@ -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(); |
@@ -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(); | |||
} |
@@ -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); | |||
} |
@@ -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); | |||
} | |||
@@ -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); | |||
} | |||
} |
@@ -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 |
@@ -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; |
@@ -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 |
@@ -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); | |||
} |
@@ -14,14 +14,14 @@ 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.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 VAbstractPaintableWidget implements VPaintableWidget { | |||
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 | |||
@@ -52,7 +52,7 @@ public abstract class VAbstractPaintableWidget implements VPaintableWidget { | |||
/** | |||
* Default constructor | |||
*/ | |||
public VAbstractPaintableWidget() { | |||
public AbstractComponentConnector() { | |||
} | |||
/** | |||
@@ -145,9 +145,9 @@ public abstract class VAbstractPaintableWidget implements VPaintableWidget { | |||
return GWT.create(ComponentState.class); | |||
} | |||
public VPaintableWidgetContainer getParent() { | |||
public ComponentContainerConnector getParent() { | |||
// FIXME: Hierarchy should be set by framework instead of looked up here | |||
VPaintableMap paintableMap = VPaintableMap.get(getConnection()); | |||
ConnectorMap paintableMap = ConnectorMap.get(getConnection()); | |||
Widget w = getWidget(); | |||
while (true) { | |||
@@ -155,8 +155,8 @@ public abstract class VAbstractPaintableWidget implements VPaintableWidget { | |||
if (w == null) { | |||
return null; | |||
} | |||
if (paintableMap.isPaintable(w)) { | |||
return (VPaintableWidgetContainer) paintableMap.getPaintable(w); | |||
if (paintableMap.isConnector(w)) { | |||
return (ComponentContainerConnector) paintableMap.getConnector(w); | |||
} | |||
} | |||
} | |||
@@ -175,7 +175,7 @@ public abstract class VAbstractPaintableWidget implements VPaintableWidget { | |||
return; | |||
} | |||
VPaintableMap paintableMap = VPaintableMap.get(getConnection()); | |||
ConnectorMap paintableMap = ConnectorMap.get(getConnection()); | |||
// register the listened events by the server-side to the event-handler | |||
// of the component | |||
paintableMap.registerEventListenersFromUIDL(getId(), uidl); | |||
@@ -265,14 +265,14 @@ public abstract class VAbstractPaintableWidget implements VPaintableWidget { | |||
// Parent should be updated if either dimension changed between relative | |||
// and non-relative | |||
if (w.endsWith("%") != declaredWidth.endsWith("%")) { | |||
VPaintableWidgetContainer parent = getParent(); | |||
ComponentContainerConnector parent = getParent(); | |||
if (parent instanceof ManagedLayout) { | |||
getLayoutManager().setWidthNeedsUpdate((ManagedLayout) parent); | |||
} | |||
} | |||
if (h.endsWith("%") != declaredHeight.endsWith("%")) { | |||
VPaintableWidgetContainer parent = getParent(); | |||
ComponentContainerConnector parent = getParent(); | |||
if (parent instanceof ManagedLayout) { | |||
getLayoutManager().setHeightNeedsUpdate((ManagedLayout) parent); | |||
} |
@@ -9,30 +9,30 @@ 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; | |||
import com.vaadin.terminal.gwt.client.ConnectorMap; | |||
import com.vaadin.terminal.gwt.client.ComponentConnector; | |||
import com.vaadin.terminal.gwt.client.ComponentContainerConnector; | |||
public abstract class VAbstractPaintableWidgetContainer extends | |||
VAbstractPaintableWidget implements VPaintableWidgetContainer { | |||
public abstract class AbstractComponentContainerConnector extends | |||
AbstractComponentConnector implements ComponentContainerConnector { | |||
/** | |||
* Default constructor | |||
*/ | |||
public VAbstractPaintableWidgetContainer() { | |||
public AbstractComponentContainerConnector() { | |||
} | |||
public Collection<VPaintableWidget> getChildren() { | |||
Collection<VPaintableWidget> children = new ArrayList<VPaintableWidget>(); | |||
public Collection<ComponentConnector> getChildren() { | |||
Collection<ComponentConnector> children = new ArrayList<ComponentConnector>(); | |||
addDescendantPaintables(getWidget(), children, | |||
VPaintableMap.get(getConnection())); | |||
ConnectorMap.get(getConnection())); | |||
return children; | |||
} | |||
private static void addDescendantPaintables(Widget widget, | |||
Collection<VPaintableWidget> paintables, VPaintableMap paintableMap) { | |||
Collection<ComponentConnector> paintables, ConnectorMap paintableMap) { | |||
// FIXME: Store hierarchy instead of doing lookup every time | |||
if (widget instanceof HasWidgets) { | |||
@@ -46,8 +46,8 @@ public abstract class VAbstractPaintableWidgetContainer extends | |||
} | |||
private static void addIfPaintable(Widget widget, | |||
Collection<VPaintableWidget> paintables, VPaintableMap paintableMap) { | |||
VPaintableWidget paintable = paintableMap.getPaintable(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); |
@@ -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, |
@@ -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>(); |
@@ -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 { | |||
} |
@@ -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(); | |||
@@ -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; |
@@ -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); | |||
} | |||
@@ -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(); |
@@ -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); | |||
} |
@@ -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; |
@@ -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 */ | |||
} | |||
@@ -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. |
@@ -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() { |
@@ -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); | |||
} |
@@ -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); | |||
} | |||
@@ -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 | |||
} | |||
@@ -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) { |
@@ -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); | |||
} |
@@ -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) { |
@@ -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); | |||
} | |||
@@ -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(); |
@@ -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"; | |||
@@ -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()) { | |||
@@ -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 { | |||
/* |
@@ -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, " "); |
@@ -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); | |||
} | |||
@@ -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 | |||
} |
@@ -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); | |||
} | |||
@@ -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 |
@@ -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() { |
@@ -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); | |||
} | |||
} | |||
@@ -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"; | |||
@@ -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"; | |||
@@ -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 |
@@ -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() { |
@@ -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"; | |||
@@ -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) { |
@@ -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) { |
@@ -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 | |||
} | |||
@@ -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) { |
@@ -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 |
@@ -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) { |
@@ -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(); | |||
} |
@@ -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 | |||
} | |||
@@ -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) { |
@@ -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; | |||
} |
@@ -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 |
@@ -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); | |||
} | |||
} |
@@ -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 */ | |||
} | |||
@@ -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 |
@@ -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( |
@@ -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) { |
@@ -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() { |
@@ -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) { |
@@ -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(); |
@@ -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 | |||
} | |||
@@ -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(); |
@@ -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 | |||
} | |||
@@ -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(); | |||
} |
@@ -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(); | |||
/* |
@@ -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; | |||
} |
@@ -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} |
@@ -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 { |
@@ -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 |
@@ -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"); |
@@ -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; |
@@ -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; | |||
} | |||
@@ -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() { | |||
} | |||
@@ -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; | |||
} | |||
@@ -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)); | |||
} | |||
} | |||