--- /dev/null
+package com.vaadin.terminal.gwt.client;
+
+import com.vaadin.terminal.gwt.client.communication.SharedState;
+
+/**
+ * TODO Add javadoc
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ *
+ */
+public interface Connector {
+ /**
+ * Gets the current shared state of the connector.
+ *
+ * @return state
+ */
+ public SharedState getState();
+
+ /**
+ * Returns the id for this connector. This must always be what has been set
+ * in {@link #doInit(String, ApplicationConnection)} and must never change.
+ *
+ * @return The id for the connector.
+ */
+ public String getConnectorId();
+
+}
* 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 ServerConnector#getId()} instead
+ * @deprecated use {@link ServerConnector#getConnectorId()} instead
*/
@Deprecated
public String getConnectorId(ServerConnector connector) {
if (connector == null) {
return null;
}
- return connector.getId();
+ return connector.getConnectorId();
}
@Deprecated
VConsole.error("WARN: Trying to unregister null connector");
return;
}
- String id = connector.getId();
+ String id = connector.getConnectorId();
Widget widget = null;
if (connector instanceof ComponentConnector) {
widget = ((ComponentConnector) connector).getWidget();
for (ServerConnector connector : getConnectors()) {
if (connector instanceof ComponentConnector) {
ComponentConnector componentConnector = (ComponentConnector) connector;
- if (!unregistryBag.contains(connector.getId())) {
+ if (!unregistryBag.contains(connector.getConnectorId())) {
result.add(componentConnector);
}
}
if (measuredSize.isWidthNeedsUpdate()) {
ownerSize.setWidthNeedsUpdate();
}
- measuredSize.addDependent(owner.getId());
+ measuredSize.addDependent(owner.getConnectorId());
}
private MeasuredSize ensureMeasured(Element element) {
if (measuredSize == null) {
return;
}
- measuredSize.removeDependent(owner.getId());
+ measuredSize.removeDependent(owner.getConnectorId());
if (!needsMeasure(element)) {
nonPaintableElements.remove(element);
setMeasuredSize(element, null);
if (measuredSize.isHeightNeedsUpdate()) {
if (managed) {
- needsHeightUpdate.add(paintable.getId());
+ needsHeightUpdate.add(paintable.getConnectorId());
}
if (!paintable.isRelativeHeight() && managedParent) {
- needsHeightUpdate.add(parent.getId());
+ needsHeightUpdate.add(parent.getConnectorId());
}
}
if (measuredSize.isWidthNeedsUpdate()) {
if (managed) {
- needsWidthUpdate.add(paintable.getId());
+ needsWidthUpdate.add(paintable.getConnectorId());
}
if (!paintable.isRelativeWidth() && managedParent) {
- needsWidthUpdate.add(parent.getId());
+ needsWidthUpdate.add(parent.getConnectorId());
}
}
measuredSize.clearDirtyState();
* @version @VERSION@
* @since 7.0.0
*/
-public interface ServerConnector {
+public interface ServerConnector extends Connector {
/**
* TODO
*
*/
public void updateFromUIDL(UIDL uidl, ApplicationConnection client);
- /**
- * Gets the current shared state of the connector.
- *
- * @return state
- */
- public SharedState getState();
-
/**
* Sets a new state for the connector.
*
@Deprecated
public void setState(SharedState state);
- /**
- * Returns the id for this connector. This must always be what has been set
- * in {@link #doInit(String, ApplicationConnection)} and must never change.
- *
- * @return The id for the connector.
- */
- public String getId();
-
/**
* Gets ApplicationConnection instance that created this connector.
*
ConnectorMap paintableMap = ConnectorMap.get(getConnection());
// register the listened events by the server-side to the event-handler
// of the component
- paintableMap.registerEventListenersFromUIDL(getId(), uidl);
+ paintableMap.registerEventListenersFromUIDL(getConnectorId(), uidl);
// Visibility
setVisible(!uidl.getBooleanAttribute("invisible"), uidl);
w = componentState.getWidth();
} else {
// TODO move logging to VUIDLBrowser and VDebugConsole
- VConsole.log("No state for paintable " + getId()
+ VConsole.log("No state for paintable " + getConnectorId()
+ " in VAbstractPaintableWidget.updateComponentSize()");
}
* GWT.create().
*/
protected <T extends ServerRpc> T initRPC(T clientToServerRpc) {
- ((InitializableClientToServerRpc) clientToServerRpc).initRpc(getId(),
+ ((InitializableClientToServerRpc) clientToServerRpc).initRpc(getConnectorId(),
getConnection());
return clientToServerRpc;
}
*
* @see com.vaadin.terminal.gwt.client.Connector#getId()
*/
- public String getId() {
+ public String getConnectorId() {
return id;
}
}
layout.addOrMove(slot, currentIndex++);
- String pid = child.getId();
+ String pid = child.getConnectorId();
AlignmentInfo alignment;
if (alignments.containsKey(pid)) {
if (childUidl != null) {
if (getWidget().shortcutHandler == null) {
getWidget().shortcutHandler = new ShortcutActionHandler(
- getId(), client);
+ getConnectorId(), client);
getWidget().keyDownRegistration = getWidget()
.addDomHandler(getWidget(), KeyDownEvent.getType());
}
if (childUidl.getTag().equals("actions")) {
if (getWidget().shortcutHandler == null) {
getWidget().shortcutHandler = new ShortcutActionHandler(
- getId(), client);
+ getConnectorId(), client);
}
getWidget().shortcutHandler.updateActionMap(childUidl);
}
ConnectorMap paintableMap = ConnectorMap.get(getConnection());
// register the listened events by the server-side to the event-handler
// of the component
- paintableMap.registerEventListenersFromUIDL(getId(), uidl);
+ paintableMap.registerEventListenersFromUIDL(getConnectorId(), uidl);
getWidget().rendering = true;
- getWidget().id = getId();
+ getWidget().id = getConnectorId();
boolean firstPaint = getWidget().connection == null;
getWidget().connection = client;
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
- getWidget().id = getId();
+ getWidget().id = getConnectorId();
getWidget().client = client;
// Workaround needed for Testing Tools (GWT generates window DOM
// slightly different in different browsers).
- DOM.setElementProperty(getWidget().closeBox, "id", getId()
+ DOM.setElementProperty(getWidget().closeBox, "id", getConnectorId()
+ "_window_close");
if (uidl.hasAttribute("invisible")) {
if (childUidl.getTag().equals("actions")) {
if (getWidget().shortcutHandler == null) {
getWidget().shortcutHandler = new ShortcutActionHandler(
- getId(), client);
+ getConnectorId(), client);
}
getWidget().shortcutHandler.updateActionMap(childUidl);
}