org.openide.nodes.Node.assignTo()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(194)

本文整理了Java中org.openide.nodes.Node.assignTo()方法的一些代码示例,展示了Node.assignTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.assignTo()方法的具体详情如下:
包路径:org.openide.nodes.Node
类名称:Node
方法名:assignTo

Node.assignTo介绍

[英]Method that allows Children to change the parent children of the node when the node is add to a children.
[中]

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-nodes

  1. public void useNodes(Collection<Node> nodes) {
  2. // forces creation of the array
  3. ChildrenArray arr = getArray(null);
  4. arr.useNodes(this, nodes);
  5. // assign all there nodes the new children
  6. for (Node n : nodes) {
  7. n.assignTo(EntrySupportDefault.this.children, -1);
  8. n.fireParentNodeChange(null, children.parent);
  9. }
  10. }

代码示例来源:origin: org.netbeans.api/org-openide-nodes

  1. /** Notifies that a set of nodes has been add to
  2. * children. It is necessary that the system is already
  3. * in consistent state, so any callbacks will return
  4. * valid values.
  5. *
  6. * @param nodes list of removed nodes
  7. */
  8. void notifyAdd(Collection<Node> nodes) {
  9. if (LOGGER.isLoggable(Level.FINER)) {
  10. LOGGER.finer("notifyAdd: " + nodes);
  11. }
  12. // notify about parent change
  13. for (Node n : nodes) {
  14. n.assignTo(children, -1);
  15. n.fireParentNodeChange(null, children.parent);
  16. }
  17. Node[] arr = nodes.toArray(new Node[nodes.size()]);
  18. Node n = children.parent;
  19. if (n != null && children.getEntrySupport() == this) {
  20. n.fireSubNodesChange(true, arr, null);
  21. }
  22. }

代码示例来源:origin: org.netbeans.api/org-openide-nodes

  1. n.assignTo(children, i);
  2. n.fireParentNodeChange(null, children.parent);

代码示例来源:origin: org.netbeans.api/org-openide-nodes

  1. node.assignTo(ch, -1);
  2. node.fireParentNodeChange(null, ch.parent);
  3. return node;

代码示例来源:origin: org.netbeans.api/org-openide-nodes

  1. /** This method can be called by subclasses that
  2. * directly modify the nodes collection to update the
  3. * state of the nodes appropriatelly.
  4. * This method should be called under
  5. * MUTEX.writeAccess.
  6. */
  7. final void refreshImpl() {
  8. if (isInitialized()) {
  9. Array.this.entrySupport().refreshEntry(getNodesEntry());
  10. entrySupport().getNodes(false);
  11. } else if (nodes != null) {
  12. for (Node n : nodes) {
  13. n.assignTo(this, -1);
  14. }
  15. }
  16. }

代码示例来源:origin: org.netbeans.api/org-openide-nodes

  1. node.assignTo(Children.this, i);
  2. node.fireParentNodeChange(null, parent);

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. public void useNodes (Collection nodes) {
  2. // forces creation of the array
  3. ChildrenArray arr = getArray (null);
  4. arr.useNodes (this, nodes);
  5. // assign all there nodes the new children
  6. Iterator it = nodes.iterator ();
  7. while (it.hasNext ()) {
  8. Node n = (Node)it.next ();
  9. n.assignTo (Children.this, -1);
  10. n.fireParentNodeChange (null, parent);
  11. }
  12. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. public void useNodes (Collection nodes) {
  2. // forces creation of the array
  3. ChildrenArray arr = getArray (null);
  4. arr.useNodes (this, nodes);
  5. // assign all there nodes the new children
  6. Iterator it = nodes.iterator ();
  7. while (it.hasNext ()) {
  8. Node n = (Node)it.next ();
  9. n.assignTo (Children.this, -1);
  10. n.fireParentNodeChange (null, parent);
  11. }
  12. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. /** Notifies that a set of nodes has been add to
  2. * children. It is necessary that the system is already
  3. * in consistent state, so any callbacks will return
  4. * valid values.
  5. *
  6. * @param nodes list of removed nodes
  7. */
  8. private void notifyAdd (Collection nodes) {
  9. // notify about parent change
  10. Iterator it = nodes.iterator ();
  11. while (it.hasNext ()) {
  12. Node n = (Node)it.next ();
  13. n.assignTo (this, -1);
  14. n.fireParentNodeChange (null, parent);
  15. }
  16. Node[] arr = (Node[])nodes.toArray (new Node[nodes.size ()]);
  17. Node n = parent;
  18. if (n != null) {
  19. n.fireSubNodesChange (
  20. true, arr, null
  21. );
  22. }
  23. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. /** Notifies that a set of nodes has been add to
  2. * children. It is necessary that the system is already
  3. * in consistent state, so any callbacks will return
  4. * valid values.
  5. *
  6. * @param nodes list of removed nodes
  7. */
  8. private void notifyAdd (Collection nodes) {
  9. // notify about parent change
  10. Iterator it = nodes.iterator ();
  11. while (it.hasNext ()) {
  12. Node n = (Node)it.next ();
  13. n.assignTo (this, -1);
  14. n.fireParentNodeChange (null, parent);
  15. }
  16. Node[] arr = (Node[])nodes.toArray (new Node[nodes.size ()]);
  17. Node n = parent;
  18. if (n != null) {
  19. n.fireSubNodesChange (
  20. true, arr, null
  21. );
  22. }
  23. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. /** Computes the nodes now.
  2. */
  3. final Node[] justComputeNodes () {
  4. if (map == null) {
  5. map = new HashMap (17);
  6. // debug.append ("Map initialized\n"); // NOI18N
  7. // printStackTrace();
  8. }
  9. LinkedList l = new LinkedList ();
  10. Iterator it = entries.iterator ();
  11. while (it.hasNext ()) {
  12. Entry entry = (Entry)it.next ();
  13. Info info = findInfo (entry);
  14. try {
  15. l.addAll (info.nodes ());
  16. } catch (RuntimeException ex) {
  17. NodeOp.warning (ex);
  18. }
  19. }
  20. Node[] arr = (Node[])l.toArray (new Node[l.size ()]);
  21. // initialize parent nodes
  22. for (int i = 0; i < arr.length; i++) {
  23. Node n = arr[i];
  24. n.assignTo (this, i);
  25. n.fireParentNodeChange (null, parent);
  26. }
  27. return arr;
  28. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. /** Computes the nodes now.
  2. */
  3. final Node[] justComputeNodes () {
  4. if (map == null) {
  5. map = new HashMap (17);
  6. // debug.append ("Map initialized\n"); // NOI18N
  7. // printStackTrace();
  8. }
  9. LinkedList l = new LinkedList ();
  10. Iterator it = entries.iterator ();
  11. while (it.hasNext ()) {
  12. Entry entry = (Entry)it.next ();
  13. Info info = findInfo (entry);
  14. try {
  15. l.addAll (info.nodes ());
  16. } catch (RuntimeException ex) {
  17. NodeOp.warning (ex);
  18. }
  19. }
  20. Node[] arr = (Node[])l.toArray (new Node[l.size ()]);
  21. // initialize parent nodes
  22. for (int i = 0; i < arr.length; i++) {
  23. Node n = arr[i];
  24. n.assignTo (this, i);
  25. n.fireParentNodeChange (null, parent);
  26. }
  27. return arr;
  28. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. /** This method can be called by subclasses that
  2. * directly modify the nodes collection to update the
  3. * state of the nodes appropriatelly.
  4. * This method should be called under
  5. * MUTEX.writeAccess.
  6. */
  7. final void refreshImpl () {
  8. if ( isInitialized() ) {
  9. Array.this.refreshEntry (getNodesEntry ());
  10. super.getArray (null).nodes ();
  11. }
  12. else if ( nodes != null ) {
  13. for( Iterator it = nodes.iterator(); it.hasNext(); ) {
  14. Node n = (Node)it.next();
  15. n.assignTo( this, -1 );
  16. }
  17. }
  18. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. /** This method can be called by subclasses that
  2. * directly modify the nodes collection to update the
  3. * state of the nodes appropriatelly.
  4. * This method should be called under
  5. * MUTEX.writeAccess.
  6. */
  7. final void refreshImpl () {
  8. if ( isInitialized() ) {
  9. Array.this.refreshEntry (getNodesEntry ());
  10. super.getArray (null).nodes ();
  11. }
  12. else if ( nodes != null ) {
  13. for( Iterator it = nodes.iterator(); it.hasNext(); ) {
  14. Node n = (Node)it.next();
  15. n.assignTo( this, -1 );
  16. }
  17. }
  18. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. node.assignTo (Children.this, i);
  2. node.fireParentNodeChange (null, parent);

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. node.assignTo (Children.this, i);
  2. node.fireParentNodeChange (null, parent);

相关文章