/** * Finds a UI ancestor of this connector. <code>null</code> is returned if * no UI ancestor is found (typically because the connector is not attached * to a proper hierarchy). * * @return the UI ancestor of this connector, or <code>null</code> if none * is found. */ @Override public UI getUI() { ClientConnector connector = this; while (connector != null) { if (connector instanceof UI) { return (UI) connector; } connector = connector.getParent(); } return null; }
private ClientConnector findFirstVisibleParent(ClientConnector connector) { while (connector != null) { connector = connector.getParent(); if (LegacyCommunicationManager .isConnectorVisibleToClient(connector)) { return connector; } } return null; }
/** * Returns {@link #getConnectorString(ClientConnector)} for the connector * and its parent (if it has a parent). * * @param connector * The connector * @return A string describing the connector and its parent */ private String getConnectorAndParentInfo(ClientConnector connector) { String message = getConnectorString(connector); if (connector.getParent() != null) { message += " (parent: " + getConnectorString(connector.getParent()) + ")"; } return message; }
/** * Gets the {@link Grid} this renderer is attached to. Used internally for * indicating the source grid of possible events emitted by this renderer, * such as {@link RendererClickEvent}s. * * @return the grid this renderer is attached to or {@code null} if * unattached */ @SuppressWarnings("unchecked") protected Grid<T> getParentGrid() { if (super.getParent() == null) { return null; } return (Grid<T>) super.getParent().getParent(); }
/** * Checks if the connector is visible in context. For Components, * {@link #isComponentVisibleToClient(Component)} is used. For other types * of connectors, the contextual visibility of its first Component ancestor * is used. If no Component ancestor is found, the connector is not visible. * * @deprecated As of 7.1. See #11411. * * @param connector * The connector to check * @return <code>true</code> if the connector is visible to the client, * <code>false</code> otherwise */ @Deprecated public static boolean isConnectorVisibleToClient( ClientConnector connector) { if (connector instanceof Component) { return isComponentVisibleToClient((Component) connector); } else { ClientConnector parent = connector.getParent(); if (parent == null) { return false; } else { return isConnectorVisibleToClient(parent); } } }
stack.add(child); if (!connector.equals(child.getParent())) { noErrors = false; getLogger().log(Level.WARNING, new Object[] { getConnectorString(connector), getConnectorString(child), getConnectorString(child.getParent()) }); "{0} claims that {1} is its parent, but the parent does not acknowledge the parenthood.", new Object[] { getConnectorString(dangling), getConnectorString(dangling.getParent()) });
ClientConnector parent = connector.getParent(); if (parent != null) { return findErrorHandler(parent);