import com.vaadin.terminal.gwt.client.ui.VContextMenu;
import com.vaadin.terminal.gwt.client.ui.VNotification;
import com.vaadin.terminal.gwt.client.ui.VNotification.HideEvent;
+import com.vaadin.terminal.gwt.client.ui.WindowConnector;
import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
import com.vaadin.terminal.gwt.server.AbstractCommunicationManager;
for (ServerConnector c : currentConnectors) {
if (c instanceof ComponentConnector) {
ComponentConnector cc = (ComponentConnector) c;
- if (cc.getParent() == null
- && !(cc instanceof RootConnector)) {
+ if (cc.getParent() != null) {
+ if (!cc.getParent().getChildren().contains(cc)) {
+ VConsole.error("ERROR: Connector is connected to a parent but the parent does not contain the connector");
+ }
+ } else if ((cc instanceof RootConnector && cc == getView())) {
+ // RootConnector for this connection, leave as-is
+ } else if (cc instanceof WindowConnector
+ && getView().hasSubWindow((WindowConnector) cc)) {
+ // Sub window attached to this RootConnector, leave
+ // as-is
+ } else {
// The connector has been detached from the
// hierarchy, unregister it and any possible
// children. The RootConnector should never be
// unregistered even though it has no parent.
connectorMap.unregisterConnector(cc);
unregistered++;
- } else if (cc.getParent() != null
- && !cc.getParent().getChildren().contains(cc)) {
- VConsole.error("ERROR: Connector is connected to a parent but the parent does not contain the connector");
}
}
import com.vaadin.terminal.gwt.client.ui.RootConnector;
import com.vaadin.terminal.gwt.client.ui.VLazyExecutor;
import com.vaadin.terminal.gwt.client.ui.VOverlay;
+import com.vaadin.terminal.gwt.client.ui.VWindow;
/**
* A helper console for client side development. The debug console can also be
actions.add(analyzeLayout);
actions.add(highlight);
actions.add(connectorStats);
- connectorStats
- .setTitle("Show connector statistics for client");
+ connectorStats.setTitle("Show connector statistics for client");
highlight
.setTitle("Select a component and print details about it to the server log and client side console.");
actions.add(savePosition);
ConnectorMap connectorMap = a.getConnectorMap();
Collection<? extends ServerConnector> registeredConnectors = connectorMap
.getConnectors();
+ log("Sub windows:");
+ Set<ComponentConnector> subWindowHierarchyConnectors = new HashSet<ComponentConnector>();
+ for (VWindow w : root.getWidget().getSubWindowList()) {
+ dumpConnectorHierarchy(connectorMap.getConnector(w), "",
+ subWindowHierarchyConnectors);
+ }
log("Registered connectors not in hierarchy (should be empty):");
for (ServerConnector registeredConnector : registeredConnectors) {
continue;
}
+ if (subWindowHierarchyConnectors.contains(registeredConnector)) {
+ continue;
+ }
error(getConnectorString(registeredConnector));
}