Change-Id: I9f7714cc8a723550e521b1cd0fb70499f3f12138tags/7.0.0.beta9
if (!c.getParent().getChildren().contains(c)) { | if (!c.getParent().getChildren().contains(c)) { | ||||
VConsole.error("ERROR: Connector is connected to a parent but the parent does not contain the connector"); | VConsole.error("ERROR: Connector is connected to a parent but the parent does not contain the connector"); | ||||
} | } | ||||
} else if ((c instanceof UIConnector && c == getRootConnector())) { | |||||
} else if (c == getUIConnector()) { | |||||
// UIConnector for this connection, leave as-is | // UIConnector for this connection, leave as-is | ||||
} else if (c instanceof WindowConnector | } else if (c instanceof WindowConnector | ||||
&& getRootConnector().hasSubWindow( | |||||
&& getUIConnector().hasSubWindow( | |||||
(WindowConnector) c)) { | (WindowConnector) c)) { | ||||
// Sub window attached to this UIConnector, leave | // Sub window attached to this UIConnector, leave | ||||
// as-is | // as-is | ||||
* | * | ||||
* @return the main view | * @return the main view | ||||
*/ | */ | ||||
public UIConnector getRootConnector() { | |||||
public UIConnector getUIConnector() { | |||||
return uIConnector; | return uIConnector; | ||||
} | } | ||||
} else if (w instanceof VWindow) { | } else if (w instanceof VWindow) { | ||||
Connector windowConnector = ConnectorMap.get(client) | Connector windowConnector = ConnectorMap.get(client) | ||||
.getConnector(w); | .getConnector(w); | ||||
List<WindowConnector> subWindowList = client.getRootConnector() | |||||
List<WindowConnector> subWindowList = client.getUIConnector() | |||||
.getSubWindows(); | .getSubWindows(); | ||||
int indexOfSubWindow = subWindowList.indexOf(windowConnector); | int indexOfSubWindow = subWindowList.indexOf(windowConnector); | ||||
return PARENTCHILD_SEPARATOR + "VWindow[" + indexOfSubWindow + "]"; | return PARENTCHILD_SEPARATOR + "VWindow[" + indexOfSubWindow + "]"; | ||||
if (part.equals(ROOT_ID)) { | if (part.equals(ROOT_ID)) { | ||||
w = RootPanel.get(); | w = RootPanel.get(); | ||||
} else if (part.equals("")) { | } else if (part.equals("")) { | ||||
w = client.getRootConnector().getWidget(); | |||||
w = client.getUIConnector().getWidget(); | |||||
} else if (w == null) { | } else if (w == null) { | ||||
String id = part; | String id = part; | ||||
// Must be old static pid (PID_S*) | // Must be old static pid (PID_S*) | ||||
if (connector == null) { | if (connector == null) { | ||||
// Lookup by component id | // Lookup by component id | ||||
// TODO Optimize this | // TODO Optimize this | ||||
connector = findConnectorById(client.getRootConnector(), | |||||
connector = findConnectorById(client.getUIConnector(), | |||||
id.substring(5)); | id.substring(5)); | ||||
} | } | ||||
* compatibility | * compatibility | ||||
*/ | */ | ||||
if (widgetClassName.equals("VWindow")) { | if (widgetClassName.equals("VWindow")) { | ||||
List<WindowConnector> windows = client.getRootConnector() | |||||
List<WindowConnector> windows = client.getUIConnector() | |||||
.getSubWindows(); | .getSubWindows(); | ||||
List<VWindow> windowWidgets = new ArrayList<VWindow>( | List<VWindow> windowWidgets = new ArrayList<VWindow>( | ||||
windows.size()); | windows.size()); |
if (passes > 100) { | if (passes > 100) { | ||||
VConsole.log(LOOP_ABORT_MESSAGE); | VConsole.log(LOOP_ABORT_MESSAGE); | ||||
VNotification.createNotification(VNotification.DELAY_FOREVER, | VNotification.createNotification(VNotification.DELAY_FOREVER, | ||||
connection.getRootConnector().getWidget()).show( | |||||
connection.getUIConnector().getWidget()).show( | |||||
LOOP_ABORT_MESSAGE, VNotification.CENTERED, "error"); | LOOP_ABORT_MESSAGE, VNotification.CENTERED, "error"); | ||||
break; | break; | ||||
} | } |
VOverlay overlay = findWidget(element, VOverlay.class); | VOverlay overlay = findWidget(element, VOverlay.class); | ||||
if (overlay != null && overlay.getOwner() != null) { | if (overlay != null && overlay.getOwner() != null) { | ||||
return getConnectorForElement(client, client.getRootConnector() | |||||
return getConnectorForElement(client, client.getUIConnector() | |||||
.getWidget(), overlay.getOwner().getElement()); | .getWidget(), overlay.getOwner().getElement()); | ||||
} else { | } else { | ||||
return null; | return null; |
for (ApplicationConnection a : ApplicationConfiguration | for (ApplicationConnection a : ApplicationConfiguration | ||||
.getRunningApplications()) { | .getRunningApplications()) { | ||||
ComponentConnector connector = Util.getConnectorForElement( | ComponentConnector connector = Util.getConnectorForElement( | ||||
a, a.getRootConnector().getWidget(), eventTarget); | |||||
a, a.getUIConnector().getWidget(), eventTarget); | |||||
if (connector == null) { | if (connector == null) { | ||||
connector = Util.getConnectorForElement(a, | connector = Util.getConnectorForElement(a, | ||||
RootPanel.get(), eventTarget); | RootPanel.get(), eventTarget); | ||||
for (ApplicationConnection a : ApplicationConfiguration | for (ApplicationConnection a : ApplicationConfiguration | ||||
.getRunningApplications()) { | .getRunningApplications()) { | ||||
ComponentConnector paintable = Util.getConnectorForElement( | ComponentConnector paintable = Util.getConnectorForElement( | ||||
a, a.getRootConnector().getWidget(), eventTarget); | |||||
a, a.getUIConnector().getWidget(), eventTarget); | |||||
if (paintable == null) { | if (paintable == null) { | ||||
paintable = Util.getConnectorForElement(a, | paintable = Util.getConnectorForElement(a, | ||||
RootPanel.get(), eventTarget); | RootPanel.get(), eventTarget); | ||||
} | } | ||||
protected void dumpConnectorInfo(ApplicationConnection a) { | protected void dumpConnectorInfo(ApplicationConnection a) { | ||||
UIConnector root = a.getRootConnector(); | |||||
UIConnector root = a.getUIConnector(); | |||||
log("================"); | log("================"); | ||||
log("Connector hierarchy for Root: " + root.getState().caption + " (" | log("Connector hierarchy for Root: " + root.getState().caption + " (" | ||||
+ root.getConnectorId() + ")"); | + root.getConnectorId() + ")"); |
if (container == null) { | if (container == null) { | ||||
container = DOM.createDiv(); | container = DOM.createDiv(); | ||||
container.setId(id); | container.setId(id); | ||||
String styles = ac.getRootConnector().getWidget().getParent() | |||||
String styles = ac.getUIConnector().getWidget().getParent() | |||||
.getStyleName(); | .getStyleName(); | ||||
container.setClassName(styles); | container.setClassName(styles); | ||||
RootPanel.get().getElement().appendChild(container); | RootPanel.get().getElement().appendChild(container); |
final int delay = notification | final int delay = notification | ||||
.getIntAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY); | .getIntAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY); | ||||
createNotification(delay, client.getRootConnector().getWidget()).show( | |||||
createNotification(delay, client.getUIConnector().getWidget()).show( | |||||
html, position, style); | html, position, style); | ||||
} | } | ||||
getLayoutManager().registerDependency(this, getWidget().header); | getLayoutManager().registerDependency(this, getWidget().header); | ||||
getLayoutManager().registerDependency(this, getWidget().footer); | getLayoutManager().registerDependency(this, getWidget().footer); | ||||
getWidget().setOwner(getConnection().getRootConnector().getWidget()); | |||||
getWidget().setOwner(getConnection().getUIConnector().getWidget()); | |||||
} | } | ||||
@Override | @Override |
updatedIntSet.add(Integer.valueOf(-integer.intValue())); | updatedIntSet.add(Integer.valueOf(-integer.intValue())); | ||||
} | } | ||||
rpc.sendSet(updatedIntSet, | rpc.sendSet(updatedIntSet, | ||||
Collections.singleton(getRootConnector()), beanSet); | |||||
Collections.singleton(getUIConnector()), beanSet); | |||||
} | } | ||||
@Override | @Override | ||||
rpc.sendMap(Collections.singletonMap("a", stringMap.get("b")), | rpc.sendMap(Collections.singletonMap("a", stringMap.get("b")), | ||||
Collections.singletonMap(getThisConnector(), | Collections.singletonMap(getThisConnector(), | ||||
connectorMap.get(getRootConnector())), | |||||
connectorMap.get(getUIConnector())), | |||||
Collections.singletonMap( | Collections.singletonMap( | ||||
Integer.valueOf(stringMap.size()), | Integer.valueOf(stringMap.size()), | ||||
getThisConnector()), updatedBeanMap); | getThisConnector()), updatedBeanMap); | ||||
Collections.sort(intList); | Collections.sort(intList); | ||||
Collections.reverse(beanList); | Collections.reverse(beanList); | ||||
rpc.sendList(intList, | rpc.sendList(intList, | ||||
Arrays.asList(getThisConnector(), getRootConnector()), | |||||
Arrays.asList(getThisConnector(), getUIConnector()), | |||||
beanList); | beanList); | ||||
} | } | ||||
}); | }); | ||||
} | } | ||||
private Connector getRootConnector() { | |||||
return getConnection().getRootConnector(); | |||||
private Connector getUIConnector() { | |||||
return getConnection().getUIConnector(); | |||||
} | } | ||||
private Connector getThisConnector() { | private Connector getThisConnector() { |