Java Code Examples for com.intellij.ui.CheckedTreeNode#children()

The following examples show how to use com.intellij.ui.CheckedTreeNode#children() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BreakpointItemsTreeController.java    From consulo with Apache License 2.0 6 votes vote down vote up
private static BreakpointsGroupNode getOrCreateGroupNode(CheckedTreeNode parent, final XBreakpointGroup group,
                                                         final int level) {
  Enumeration children = parent.children();
  while (children.hasMoreElements()) {
    Object element = children.nextElement();
    if (element instanceof BreakpointsGroupNode) {
      XBreakpointGroup groupFound = ((BreakpointsGroupNode)element).getGroup();
      if (groupFound.equals(group)) {
        return (BreakpointsGroupNode)element;
      }
    }
  }
  BreakpointsGroupNode groupNode = new BreakpointsGroupNode<>(group, level);
  parent.add(groupNode);
  return groupNode;
}
 
Example 2
Source File: BreakpointItemsTreeController.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static Collection<XBreakpointGroup> getGroupNodes(CheckedTreeNode parent) {
  Collection<XBreakpointGroup> nodes = new ArrayList<>();
  Enumeration children = parent.children();
  while (children.hasMoreElements()) {
    Object element = children.nextElement();
    if (element instanceof BreakpointsGroupNode) {
      nodes.add(((BreakpointsGroupNode)element).getGroup());
    }
  }
  return nodes;
}
 
Example 3
Source File: CheckboxTreeTable.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static void uncheckChildren(final CheckedTreeNode node) {
  final Enumeration children = node.children();
  while (children.hasMoreElements()) {
    final Object o = children.nextElement();
    if (!(o instanceof CheckedTreeNode)) continue;
    CheckedTreeNode child = (CheckedTreeNode)o;
    changeNodeState(child, false);
    uncheckChildren(child);
  }
}
 
Example 4
Source File: CheckboxTreeTable.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static void checkChildren(final CheckedTreeNode node) {
  final Enumeration children = node.children();
  while (children.hasMoreElements()) {
    final Object o = children.nextElement();
    if (!(o instanceof CheckedTreeNode)) continue;
    CheckedTreeNode child = (CheckedTreeNode)o;
    changeNodeState(child, true);
    checkChildren(child);
  }
}