private void _setTreeSelected(Treenode selectedNode) { Treeview treeview = getTreeview(); if (treeview != null) { treeview.setSelectedNode(selectedNode); } }
/** * Search the tree for a tree item whose label contains the specified text. * * @param start Tree item to start search. * @param text Text to find. * @param search Search logic. * @return The first matching tree item after the starting item, or null if none found. */ public static Treenode search(Treenode start, String text, ITreenodeSearch search) { return search(start.getTreeview(), text, search); }
/** * Search the tree for a tree item whose label contains the specified text. * * @param start Tree item to start search. * @param text Text to find. * @return The first matching tree item after the starting item, or null if none found. */ public static Treenode search(Treenode start, String text) { return search(start.getTreeview(), text, defaultTreenodeSearch); }
/** * Set the selected state of this node. * * @param selected The new selected state. * @param notifyClient If true, notify the client of the state change. * @param notifyParent If true, notify the parent tree view of the state change. */ /*package*/ void _setSelected(boolean selected, boolean notifyClient, boolean notifyParent) { if (propertyChange("selected", this.selected, this.selected = selected, notifyClient) && notifyParent) { Treeview treeview = getTreeview(); if (treeview != null) { if (selected) { treeview.setSelectedNode(this); } else if (treeview.getSelectedNode() == this) { treeview.setSelectedNode(null); } } } }
/** * Handles change events from the client. * * @param event A change event. */ @EventHandler(value = "change", syncToClient = false, mode = "init") private void _onChange(ChangeEvent event) { _setSelected(defaultify(event.getValue(Boolean.class), false), false, true); Treeview tree = getTreeview(); if (tree != null) { event = new ChangeEvent(tree, event.getData(), this); EventUtil.send(event); } }