/** * Returns the tree node containing the component. * * @param comp The component whose containing tree node is sought. * @return The tree node. */ private Treenode getTreenode(BaseComponent comp) { return (Treenode) (comp instanceof Treenode ? comp : comp.getAncestor(Treenode.class)); }
/** * Return first ancestor that is of the requested type. * * @param <T> The type of ancestor sought. * @param type The type of ancestor sought. * @return The ancestor component of the requested type, or null if none found. */ public <T extends BaseComponent> T getAncestor(Class<T> type) { return getAncestor(type, false); }
/** * Wire controller from toolbar components first, then from plugin. */ @Override public void afterInitialized(BaseComponent comp) { super.afterInitialized(comp); PluginContainer container = comp.getAncestor(PluginContainer.class, true); plugin = (ElementPlugin) ElementUI.getAssociatedElement(container); }
@Override public void onEvent(Event event) { BaseComponent target = event.getCurrentTarget(); Event newEvent = new Event("showManifest", target.getAncestor(Grid.class), target.getData()); EventUtil.send(newEvent); }
public void afterInitialized(BaseComponent comp) { root = comp.getAncestor(Window.class); HttpServletRequest req = RequestUtil.getRequest();