private void processAddNodeActionEvent(UITreeNode srcNode) { UITree srcTree = srcNode != null ? srcNode.getUITree() : null; TreeRowKey dragNodeKey = (srcNode.getDragValue() instanceof TreeRowKey) ? (TreeRowKey) srcNode.getDragValue() : null; TreeNode draggedNode = dragNodeKey != null ? srcTree.getTreeNode(dragNodeKey) : null; log.debug("dropped key: " + dragNodeKey); // add to list of selected properties if (draggedNode != null) this.dndSelNodes.put(((OntologyProperty) draggedNode.getData()).getURI(), draggedNode); }
public void processSelection(TreeSelectionChangeEvent event) { List<Object> selection = new ArrayList<Object>(event.getNewSelection()); /*If there are no selected nodes*/ if (selection.isEmpty()) { return; } Object currentSelectionKey = selection.get(0); UITree tree = (UITree) event.getSource(); Object storedKey = tree.getRowKey(); tree.setRowKey(currentSelectionKey); repositorySelectNodeStateHolder.setSelectedNode((TreeNode) tree.getRowData()); tree.setRowKey(storedKey); }
/** Triggers expand/collapse on the tree */ public Boolean adviseNodeOpened(UITree tree) { // root always elapsed if (((OntologyProperty) tree.getRowData()).getName().startsWith(this.rootNodeName)) { return Boolean.TRUE; } // for all other nodes check if collapse/expand was chosen if (!bCollapstree) return Boolean.TRUE; return Boolean.FALSE; }
public void processDrop(DropEvent dropEvent) { // resolve drag source attributes UITreeNode srcNode = (dropEvent.getDraggableSource() instanceof UITreeNode) ? (UITreeNode) dropEvent.getDraggableSource() : null; UITree srcTree = srcNode != null ? srcNode.getUITree() : null; TreeRowKey dragNodeKey = (dropEvent.getDragValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent.getDragValue() : null; TreeNode draggedNode = dragNodeKey != null ? srcTree.getTreeNode(dragNodeKey) : null; log.debug("dropped key: " + dragNodeKey); // add to list of selected properties if (draggedNode != null) this.dndSelNodes.put(((OntologyProperty) draggedNode.getData()).getURI(), draggedNode); }
@Override public Boolean adviseNodeOpened(UITree treeComponent) { if (!isNodeExpandEvent()) { Object value = treeComponent.getRowData(); if (value instanceof DocumentTreeNode) { DocumentTreeNode treeNode = (DocumentTreeNode) value; DamService damService = Framework.getLocalService(DamService.class); if (damService.getAssetLibraryPath().equals(treeNode.getPath())) { return true; } } } return null; }