/** Attach itself as a listener to the given nodes */ private void attachListeners(List<Reference<Node>> nodes) { if (nodes != null) { Iterator<Reference<Node>> it = nodes.iterator(); while (it.hasNext()) { Node node = it.next().get(); if (node != null) { node.addNodeListener(listener); } } } }
/** Attach itself as a listener to the given nodes */ void attachListeners(List<Reference<Node>> nodes) { Iterator<Reference<Node>> it = nodes.iterator(); while (it.hasNext()) { Node node = it.next().get(); if (node != null) { node.addNodeListener(listener); } } }
/** Getter for node listener. */ synchronized NodeListener getNodeListener() { if (nodeL == null) { nodeL = createNodeListener(); getOriginal().addNodeListener(nodeL); } return nodeL; }
private void addNotifyImpl() { // add itself to reflect to changes children of original node nodeL = new ChildrenAdapter(this); original.addNodeListener(nodeL); filterSupport().update(); }
/** Creates a node representant for given bean. Uses factory * to get the node. * @param subbean the bean from bean context * @return node created by the factory */ protected Node[] createNodes(Object subbean) { try { if (subbean instanceof BeanContextSupport) { BeanContextSupport bcs = (BeanContextSupport) subbean; if (bean.contains(bcs.getBeanContextPeer()) && (bcs != bcs.getBeanContextPeer())) { // sometimes a BeanContextSupport occures in the list of // beans children even there is its peer. we think that // it is desirable to hide the context if the peer is // also present return new Node[0]; } } Node n = factory.createNode(subbean); // #7925: deleting from BeanChildren has no effect synchronized (nodes2Beans) { nodes2Beans.put(n, new Reference[] { new WeakReference<BeanContext>(bean), new WeakReference<Object>(subbean) }); } n.addNodeListener(contextL); return new Node[] { n }; } catch (IntrospectionException ex) { Logger.getLogger(BeanChildren.class.getName()).log(Level.WARNING, null, ex); return new Node[0]; } }
/** Attach itself as a listener to the given nodes */ void attachListeners (List nodes) { Iterator it = nodes.iterator(); while (it.hasNext()) { Node node = (Node)((Reference)it.next()).get (); if (node != null) node.addNodeListener(this); } }
/** Attach itself as a listener to the given nodes */ void attachListeners (List nodes) { Iterator it = nodes.iterator(); while (it.hasNext()) { Node node = (Node)((Reference)it.next()).get (); if (node != null) node.addNodeListener(this); } }
/** Attach itself as a listener to the given nodes */ private void attachListeners (List nodes) { if (nodes != null){ Iterator it = nodes.iterator(); while (it.hasNext()) { Node node = (Node)((Reference)it.next()).get (); if (node != null) node.addNodeListener(listener); } } } } // end of CookieDelegateAction
/** Check whether the node has not been updated. */ private void updateNode (Node n) { if (current != null && current.get () == n) { return; } if (current != null && current.get () != null) { ((Node)current.get ()).removeNodeListener (listener); } n.addNodeListener (listener); current = new WeakReference (n); }
private void addNotifyImpl () { // add itself to reflect to changes children of original node nodeL = new ChildrenAdapter (this); original.addNodeListener (nodeL); updateKeys (); }
private void addNotifyImpl () { // add itself to reflect to changes children of original node nodeL = new ChildrenAdapter (this); original.addNodeListener (nodeL); updateKeys (); }
/** Getter for node listener. */ synchronized NodeListener getNodeListener () { if (nodeL == null) { nodeL = createNodeListener (); getOriginal().addNodeListener(nodeL); } return nodeL; }
/** Create an index cookie associated with a data folder. * @param df the data folder * @param node node to be associated with. subnodes of this node will be returned, etc. */ public Index(final DataFolder df, Node node) { this.df = df; this.node = node; listener = new Listener (); node.addNodeListener (org.openide.nodes.NodeOp.weakNodeListener (listener, node)); }
/** Getter for node listener. */ synchronized NodeListener getNodeListener () { if (nodeL == null) { nodeL = createNodeListener (); getOriginal().addNodeListener(nodeL); } return nodeL; }
@Override public void addNotify() { super.addNotify(); for (NodeListener listener : listeners) { getExplorerManager().getRootContext().addNodeListener(listener); } listeners.clear(); }
this.original.addNodeListener(getNodeListener());
/** Constructor. */ public LazyMenu(final DataFolder df, boolean icon) { master = df; this.icon = icon; // Listen for changes in Node's DisplayName/Icon Node n = master.getNodeDelegate (); n.addNodeListener (org.openide.nodes.NodeOp.weakNodeListener (this, n)); updateProps(); }
ProxyNode(Node... original) { super(Children.LEAF); this.original = original; nl = new NodeAdapterImpl(true); pcl = new NodeAdapterImpl(false); for (int i = 0; i < original.length; i++) { original[i].addPropertyChangeListener(org.openide.util.WeakListeners.propertyChange(pcl, original[i])); original[i].addNodeListener( org.openide.util.WeakListeners.create(NodeListener.class, nl, original[i]) ); } }
@Override public void addNotify() { super.addNotify(); getExplorerManager().getRootContext().addNodeListener(rootNodeListener); getExplorerManager().addPropertyChangeListener(selectionListener); }
/** Overrides superclass method. Initializes editor component. */ protected void initializeCloneableEditor (CloneableEditor editor) { DataObject obj = getDataObject(); if(obj.isValid()) { org.openide.nodes.Node ourNode = obj.getNodeDelegate(); editor.setActivatedNodes(new org.openide.nodes.Node[] {ourNode}); editor.setIcon(ourNode.getIcon (java.beans.BeanInfo.ICON_COLOR_16x16)); NodeListener nl = new DataNodeListener(editor); ourNode.addNodeListener(org.openide.nodes.NodeOp.weakNodeListener (nl, ourNode)); nodeL = nl; } }