* communication with its server side counterpart
* {@link AbstractCommunicationManager}.
*
- * Client-side widgets receive updates from the corresponding server-side
- * components as calls 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
- * (see {@link #updateVariable()}).
+ * Client-side connectors receive updates from the corresponding server-side
+ * connector (typically component) as state updates or RPC calls. The connector
+ * has the possibility to communicate back with its server side counter part
+ * through RPC calls.
*
* TODO document better
*
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.terminal.Paintable;
public class ConnectorMap {
* root element for a connector, otherwise no id will be found. Use
* {@link #getConnectorId(ServerConnector)} instead whenever possible.
*
- * @see #getConnectorId(Paintable)
+ * @see #getConnectorId(ServerConnector)
* @param el
* element of the connector whose id is desired
* @return the id of the element's connector, if it's a connector
outWriter.print("\"");
outWriter.print(canonicalName);
outWriter.print("\" : ");
- outWriter.print(getTagForType(class1));
+ outWriter
+ .print(getTagForType((Class<? extends ClientConnector>) class1));
}
}
if (typeMappingsOpen) {
private void legacyPaint(PaintTarget paintTarget,
ArrayList<ClientConnector> dirtyVisibleConnectors)
throws PaintException {
- List<Paintable> paintables = new ArrayList<Paintable>();
+ List<Component> legacyComponents = new ArrayList<Component>();
for (Connector connector : dirtyVisibleConnectors) {
if (connector instanceof Paintable) {
- paintables.add((Paintable) connector);
+ // All legacy Components must be Paintables as Component extends
+ // Paintable in Vaadin 6
+ legacyComponents.add((Component) connector);
}
}
- sortByHierarchy(paintables);
- for (Paintable p : paintables) {
- logger.info("Painting legacy Paintable " + p.getClass().getName()
- + "@" + Integer.toHexString(p.hashCode()));
+ sortByHierarchy(legacyComponents);
+ for (Component c : legacyComponents) {
+ logger.info("Painting legacy Component " + c.getClass().getName()
+ + "@" + Integer.toHexString(c.hashCode()));
paintTarget.startTag("change");
- final String pid = ((Connector) p).getConnectorId();
+ final String pid = c.getConnectorId();
paintTarget.addAttribute("pid", pid);
- p.paint(paintTarget);
+ c.paint(paintTarget);
paintTarget.endTag("change");
}
}
- private void sortByHierarchy(List<Paintable> paintables) {
+ private void sortByHierarchy(List<Component> paintables) {
// Vaadin 6 requires parents to be painted before children as component
// containers rely on that their updateFromUIDL method has been called
// before children start calling e.g. updateCaption
- Collections.sort(paintables, new Comparator<Paintable>() {
- public int compare(Paintable o1, Paintable o2) {
- Component c1 = (Component) o1;
- Component c2 = (Component) o2;
+ Collections.sort(paintables, new Comparator<Component>() {
+ public int compare(Component c1, Component c2) {
int depth1 = 0;
while (c1.getParent() != null) {
depth1++;
}
/**
- * Collects all pending RPC calls from listed {@link Paintable}s and clears
- * their RPC queues.
+ * Collects all pending RPC calls from listed {@link ClientConnector}s and
+ * clears their RPC queues.
*
* @param rpcPendingQueue
- * list of {@link Paintable} of interest
+ * list of {@link ClientConnector} of interest
* @return ordered list of pending RPC calls
*/
private List<ClientMethodInvocation> collectPendingRpcCalls(
}
- private final HashMap<Class<? extends Paintable>, Integer> typeToKey = new HashMap<Class<? extends Paintable>, Integer>();
+ private final HashMap<Class<? extends ClientConnector>, Integer> typeToKey = new HashMap<Class<? extends ClientConnector>, Integer>();
private int nextTypeKey = 0;
private BootstrapHandler bootstrapHandler;
- String getTagForType(Class<? extends Paintable> class1) {
+ String getTagForType(Class<? extends ClientConnector> class1) {
Integer object = typeToKey.get(class1);
if (object == null) {
object = nextTypeKey++;
import com.vaadin.external.json.JSONArray;
import com.vaadin.external.json.JSONException;
import com.vaadin.external.json.JSONObject;
-import com.vaadin.terminal.Paintable;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.communication.JsonEncoder;
* @param value
* JSON array with two elements
* @param application
- * mapper between paintable ID and {@link Paintable} objects
+ * mapper between connector ID and {@link Connector} objects
* @return converted value (does not contain JSON types)
* @throws JSONException
* if the conversion fails
* @param value
* value to convert
* @param application
- * mapper between paintable ID and {@link Paintable} objects
+ * mapper between connector ID and {@link Connector} objects
* @return JSON representation of the value
* @throws JSONException
* if encoding a value fails (e.g. NaN or infinite number)
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import com.vaadin.terminal.Paintable;
+import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.communication.MethodInvocation;
/**
* Server side RPC manager that handles RPC calls coming from the client.
*
- * Each {@link RpcTarget} (typically a {@link Paintable}) should have its own
- * instance of {@link ServerRpcManager} if it wants to receive RPC calls from
- * the client.
+ * Each {@link RpcTarget} (typically a {@link ClientConnector}) should have its
+ * own instance of {@link ServerRpcManager} if it wants to receive RPC calls
+ * from the client.
*
* @since 7.0
*/
* Create a RPC manager for an RPC target.
*
* @param target
- * RPC call target (normally a {@link Paintable})
+ * RPC call target (normally a {@link Connector})
* @param implementation
* RPC interface implementation for the target
* @param rpcInterface
/**
* Returns the RPC target of this RPC manager instance.
*
- * @return RpcTarget, typically a {@link Paintable}
+ * @return RpcTarget, typically a {@link Connector}
*/
public RpcTarget getTarget() {
return target;