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

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

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

Node.getParentChildren介绍

[英]Finds the children we are attached to.
[中]找到我们所依恋的孩子。

代码示例

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

/** Deassigns the node from a children, when it is removed from
* a children.
*/
final void deassignFrom(Children parent) {
  synchronized (LOCK) {
    Children p = getParentChildren();
    if (parent != p) {
      throw new IllegalArgumentException("Deassign from wrong parent. Old: " + p + " Caller: " + parent); //NOI18N
    }
    this.parent = null;
  }
}

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

/** Get the parent node.
* @return the parent node, or <CODE>null</CODE> if this node is the root of a hierarchy
*/
public final Node getParentNode() {
  // if contained in a list return its parent node
  Children ch = getParentChildren();
  return (ch == null) ? null : ch.getNode();
}

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

Children ch = getParentChildren();

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

/** Deassignes the node from a children, when it is removed from
* a children.
*/
final synchronized void deassignFrom (Children parent) {
  Children p = getParentChildren ();
  if (parent != p) {
    throw new IllegalArgumentException ("Deassign from wrong parent. Old: " + p + " Caller: " + parent); //NOI18N
  }
  this.parent = null;
}

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

/** Deassignes the node from a children, when it is removed from
* a children.
*/
final synchronized void deassignFrom (Children parent) {
  Children p = getParentChildren ();
  if (parent != p) {
    throw new IllegalArgumentException ("Deassign from wrong parent. Old: " + p + " Caller: " + parent); //NOI18N
  }
  this.parent = null;
}

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

/** Get the parent node.
* @return the parent node, or <CODE>null</CODE> if this node is the root of a hierarchy
*/
public final Node getParentNode () {
  // if contained in a list return its parent node
  Children ch = getParentChildren ();
  return ch == null ? null : ch.getNode ();
}

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

/** Get the parent node.
* @return the parent node, or <CODE>null</CODE> if this node is the root of a hierarchy
*/
public final Node getParentNode () {
  // if contained in a list return its parent node
  Children ch = getParentChildren ();
  return ch == null ? null : ch.getNode ();
}

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

/** Method that allows Children to change the parent children of
* the node when the node is add to a children.
*
* @param parent the children that wants to contain this node
* @param index index that will be assigned to this node
* @exception IllegalStateException if this node already belongs to a children
*/
final synchronized void assignTo (Children parent, int index) {
  Children ch = getParentChildren ();
  if (ch != null && ch != parent) {
    throw new IllegalStateException ("Cannot initialize " + index + "th child of node " + parent.getNode () + "; it already belongs to node " + ch.getNode ()); // NOI18N
  }
  if ( ! ( this.parent instanceof ChildrenArray ) ) { 
    this.parent = parent;
  }
}

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

/** Method that allows Children to change the parent children of
* the node when the node is add to a children.
*
* @param parent the children that wants to contain this node
* @param index index that will be assigned to this node
* @exception IllegalStateException if this node already belongs to a children
*/
final synchronized void assignTo (Children parent, int index) {
  Children ch = getParentChildren ();
  if (ch != null && ch != parent) {
    throw new IllegalStateException ("Cannot initialize " + index + "th child of node " + parent.getNode () + "; it already belongs to node " + ch.getNode ()); // NOI18N
  }
  if ( ! ( this.parent instanceof ChildrenArray ) ) { 
    this.parent = parent;
  }
}

相关文章

微信公众号

最新文章

更多