Refine search
public Node[] callGetNodes(boolean optimalResult) { Node[] hold = null; if (optimalResult) { hold = original.getChildren().getNodes(true); } hold = Children.this.getNodes(); return hold; }
@Override @Deprecated public boolean add(Node[] arr) { return original.getChildren().add(arr); }
public Node findChild(String name) { Node dontGC = original.getChildren().findChild(name); return Children.super.findChild(name); }
Children.MUTEX.postWriteRequest(new Runnable() { public void run() { boolean wasInited = hierarchy.isInitialized(); boolean wasLeaf = hierarchy == Children.LEAF; prevSnapshot = hierarchy.snapshot(); hierarchy.detachFrom(); int[] idxs = Children.getSnapshotIdxs(prevSnapshot); fireSubNodesChangeIdx(false, idxs, null, Collections.<Node>emptyList(), prevSnapshot); hierarchy.attachTo(Node.this); hierarchy.getNodesCount(); List<Node> snapshot = hierarchy.snapshot(); if (snapshot.size() > 0) { int[] idxs = Children.getSnapshotIdxs(snapshot); fireSubNodesChangeIdx(true, idxs, null, snapshot, null); fireOwnPropertyChange(PROP_LEAF, wasLeaf, hierarchy == Children.LEAF);
Children ch = getParentChildren(); Throwable t = null; try { parentNodes = Arrays.toString(parent.getNodes()); chNodes = Arrays.toString(ch.getNodes()); } catch (StackOverflowError e) { t = e; "Cannot initialize " + index + "th child of node " + parent.getNode() + "; it already belongs to node " + ch.getNode() + " (did you forgot to use cloneNode?)\nChildren of new node: " + parentNodes + "\nChildren of old node: " + chNodes
public static FileObject getFileObjectFromNode(Node node) { FileObject fo = node.getLookup().lookup(FileObject.class); if(fo == null) { Children children = node.getChildren(); for(Node child : children.getNodes()) { fo = child.getLookup().lookup(FileObject.class); if(fo != null) { return child.getDisplayName().equals("<default package>") ? fo : fo.getParent(); } } } return fo; }
public void run() { ArchetypeNGProjectCreator customCreator = Lookup.getDefault().lookup(ArchetypeNGProjectCreator.class); Lookup.Result<ArchetypeProvider> res = Lookup.getDefault().lookup(new Lookup.Template<ArchetypeProvider>(ArchetypeProvider.class)); List<Archetype> archetypes = new ArrayList<Archetype>(); for (ArchetypeProvider provider : res.allInstances()) { for (Archetype ar : provider.getArchetypes()) { if (customCreator == null && ar.archetypeNg) { continue; } if (!archetypes.contains(ar)) { archetypes.add(ar); } } } archetypes.add(REMOTE_PLACEHOLDER); Childs childs = (Childs)manager.getRootContext().getChildren(); childs.addArchetypes(archetypes); try { manager.setSelectedNodes(new Node[] {manager.getRootContext().getChildren().getNodes()[0]}); } catch (PropertyVetoException e) { } }
@Override public void propertyChange(PropertyChangeEvent evt) { if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) { for (Node nd : explorerManager.getSelectedNodes()) { DependencyNode n = nd.getLookup().lookup(DependencyNode.class); if (n != null) { Artifact a = n.getArtifact(); recursCollapse(treeExplorerManager.getRootContext().getChildren().getNodes(), (BeanTreeView)tvTree); Set<Node> selectedNodes = recurse(a, treeExplorerManager.getRootContext(), (BeanTreeView)tvTree); try { treeExplorerManager.setSelectedNodes(selectedNodes.toArray(new Node[0])); } catch (PropertyVetoException ex) { Exceptions.printStackTrace(ex); } } } } }
@Override public Transferable paste() { try { // adds the new node to the selected parent (current node) dropNode.getParentNode().getChildren().add(new Node[]{new LayerNode(selectedLayer,getLookup().lookup(MapController.class))}); } catch (IntrospectionException ex) { Exceptions.printStackTrace(ex); } // remove the node from the old location dropNode.getParentNode().getChildren().remove(new Node[]{dropNode}); return null; } };
private void selectNode(String name) { Node node = null; if (name != null) { node = findNode(manager.getRootContext(), name); } if (node == null) { node = (manager.getRootContext().getChildren().getNodes()[0]); } if (node != null) { try { manager.setSelectedNodes(new Node[]{node}); } catch (Exception e) { } } }
/** * get a list with shape nodes managed by this data provider * * @return list with shape nodes */ public List<ShapeNode> getShapeNodes(){ List<ShapeNode> nodes = new ArrayList<ShapeNode>(); for (Node node: getExplorerManager().getRootContext().getChildren().getNodes()){ if (node instanceof ShapeNode){ nodes.add((ShapeNode)node); } } return nodes; }
/** * method to indicate that the import has finished * A layer will be constructed based on the added shapes * and a node hierarchy will be created. */ public void finished(){ importLayer = new ImportLayer(plotFile, this); ShapeNodeFactory shapeNodeFactory = new ShapeNodeFactory(importLayer); shapeNodeFactory.setService(this); getExplorerManager().setRootContext(new AbstractNode(Children.create(shapeNodeFactory, true))); }
private static Node findProjectNode(Node root, Project p) { Node[] n = root.getChildren().getNodes(true); Template<Project> t = new Template<>(null, null, p); for (int cntr = 0; cntr < n.length; cntr++) { if (n[cntr].getLookup().lookupItem(t) != null) { return n[cntr]; } } return null; }
/** * Not used for this module */ @Override protected void initExplorer() { Node rootNode = new AbstractNode(Children.create(new MessageNodeFactory(), true)); ExplorerManager manager = new ExplorerManager(); manager.setRootContext(rootNode); manager.getRootContext().setDisplayName("messages"); setExplorerManager(manager, new ActionMap()); }
public ShapeDataObjectNode(Node original, String name) { super(Children.create(new ShapeChildFactory(), true), new ProxyLookup(original.getLookup(), Lookups.singleton(new SimpleLayer(name)))); this.origional = original; setIconBaseWithExtension("nl/cloudfarming/client/shape/file_extension_shp.png"); setDisplayName(name); }
@Override public int callGetNodesCount(boolean optimalResult) { return original.getChildren().getNodesCount(optimalResult); }
public void run() { Node root = ptLogial.getExplorerManager().getRootContext(); // Node projNode = root.getChildren ().findChild( p.getProjectDirectory().getName () ); Node projNode = root.getChildren().findChild( ProjectUtils.getInformation( p ).getName() ); if ( projNode != null ) { try { ptLogial.getExplorerManager().setSelectedNodes( new Node[] { projNode } ); } catch (Exception ignore) { // may ignore it } } } });
private Node[] findDropedNodes(Node folder, Node[] dragNodes) { if ((folder == null) || (dragNodes.length == 0)) { return null; } Node[] dropNodes = new Node[dragNodes.length]; Children children = folder.getChildren(); for (int i = 0; i < dragNodes.length; i++) { dropNodes[i] = children.findChild(dragNodes[i].getName()); } return dropNodes; }
Children.PR.enterReadAccess(); String childPath = node.getName(); Node parentNode = node.getParentNode(); Node foundChild = parentNode.getChildren().findChild(childPath); if (foundChild != node) { Logger.getLogger(DefaultHandle.class.getName()).log(Level.WARNING,
/*************************************************************************** * * **************************************************************************/ protected EntityNode (@Nonnull final EntityChildFactory entityChildFactory) { super(Children.create(entityChildFactory, true)); this.entity = null; this.entityChildFactory = entityChildFactory; pasteTypeFactory = null; // refreshAttributes(); }