Java Code Examples for com.intellij.util.ui.tree.TreeUtil#collapseAll()

The following examples show how to use com.intellij.util.ui.tree.TreeUtil#collapseAll() . 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: BaseStructureConfigurable.java    From consulo with Apache License 2.0 6 votes vote down vote up
protected void addCollapseExpandActions(final List<AnAction> result) {
  final TreeExpander expander = new TreeExpander() {
    @Override
    public void expandAll() {
      TreeUtil.expandAll(myTree);
    }

    @Override
    public boolean canExpand() {
      return true;
    }

    @Override
    public void collapseAll() {
      TreeUtil.collapseAll(myTree, 0);
    }

    @Override
    public boolean canCollapse() {
      return true;
    }
  };
  final CommonActionsManager actionsManager = CommonActionsManager.getInstance();
  result.add(actionsManager.createExpandAllAction(expander, myTree));
  result.add(actionsManager.createCollapseAllAction(expander, myTree));
}
 
Example 2
Source File: BaseStructureConfigurableNoDaemon.java    From consulo with Apache License 2.0 6 votes vote down vote up
protected void addCollapseExpandActions(final List<AnAction> result) {
  final TreeExpander expander = new TreeExpander() {
    @Override
    public void expandAll() {
      TreeUtil.expandAll(myTree);
    }

    @Override
    public boolean canExpand() {
      return true;
    }

    @Override
    public void collapseAll() {
      TreeUtil.collapseAll(myTree, 0);
    }

    @Override
    public boolean canCollapse() {
      return true;
    }
  };
  final CommonActionsManager actionsManager = CommonActionsManager.getInstance();
  result.add(actionsManager.createExpandAllAction(expander, myTree));
  result.add(actionsManager.createCollapseAllAction(expander, myTree));
}
 
Example 3
Source File: ModulesDependenciesPanel.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static ActionGroup createTreePopupActions(final boolean isRightTree, final Tree tree) {
  DefaultActionGroup group = new DefaultActionGroup();
  final TreeExpander treeExpander = new TreeExpander() {
    @Override
    public void expandAll() {
      TreeUtil.expandAll(tree);
    }

    @Override
    public boolean canExpand() {
      return isRightTree;
    }

    @Override
    public void collapseAll() {
      TreeUtil.collapseAll(tree, 3);
    }

    @Override
    public boolean canCollapse() {
      return true;
    }
  };

  final CommonActionsManager actionManager = CommonActionsManager.getInstance();
  if (isRightTree){
    group.add(actionManager.createExpandAllAction(treeExpander, tree));
  }
  group.add(actionManager.createCollapseAllAction(treeExpander, tree));
  final ActionManager globalActionManager = ActionManager.getInstance();
  group.add(globalActionManager.getAction(IdeActions.ACTION_EDIT_SOURCE));
  group.add(AnSeparator.getInstance());
  group.add(globalActionManager.getAction(IdeActions.ACTION_ANALYZE_DEPENDENCIES));
  group.add(globalActionManager.getAction(IdeActions.ACTION_ANALYZE_BACK_DEPENDENCIES));
  //non exists in platform group.add(globalActionManager.getAction(IdeActions.ACTION_ANALYZE_CYCLIC_DEPENDENCIES));
  return group;
}
 
Example 4
Source File: IntentionSettingsTree.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void onlineFilter() {
  final String filter = getFilter();
  if (filter != null && filter.length() > 0) {
    if (!myExpansionMonitor.isFreeze()) {
      myExpansionMonitor.freeze();
    }
  }
  IntentionSettingsTree.this.filter(filterModel(filter, true));
  TreeUtil.expandAll(myTree);
  if (filter == null || filter.length() == 0) {
    TreeUtil.collapseAll(myTree, 0);
    myExpansionMonitor.restore();
  }
}
 
Example 5
Source File: InspectionResultsView.java    From consulo with Apache License 2.0 5 votes vote down vote up
private JComponent createLeftActionsToolbar() {
  final CommonActionsManager actionsManager = CommonActionsManager.getInstance();
  DefaultActionGroup group = new DefaultActionGroup();
  group.add(new RerunAction(this));
  group.add(new CloseAction());
  final TreeExpander treeExpander = new TreeExpander() {
    @Override
    public void expandAll() {
      TreeUtil.expandAll(myTree);
    }

    @Override
    public boolean canExpand() {
      return true;
    }

    @Override
    public void collapseAll() {
      TreeUtil.collapseAll(myTree, 0);
    }

    @Override
    public boolean canCollapse() {
      return true;
    }
  };
  group.add(actionsManager.createExpandAllAction(treeExpander, myTree));
  group.add(actionsManager.createCollapseAllAction(treeExpander, myTree));
  group.add(actionsManager.createPrevOccurenceAction(getOccurenceNavigator()));
  group.add(actionsManager.createNextOccurenceAction(getOccurenceNavigator()));
  group.add(myGlobalInspectionContext.createToggleAutoscrollAction());
  group.add(new ExportHTMLAction(this));
  group.add(new ContextHelpAction(HELP_ID));

  return createToolbar(group);
}
 
Example 6
Source File: SpecificFilesViewDialog.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void collapseAll() {
  TreeUtil.collapseAll(myView, 1);
  TreeUtil.expand(myView, 0);
}
 
Example 7
Source File: MemberChooser.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void actionPerformed(AnActionEvent e) {
  TreeUtil.collapseAll(myTree, 1);
}
 
Example 8
Source File: TodoPanel.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void collapseAll() {
  TreeUtil.collapseAll(myTree, 0);
}
 
Example 9
Source File: ChangesViewManager.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void collapseAll() {
  TreeUtil.collapseAll(myView, 2);
  TreeUtil.expand(myView, 1);
}
 
Example 10
Source File: GlobalConfigsToolWindowPanel.java    From mule-intellij-plugins with Apache License 2.0 4 votes vote down vote up
private void collapseAll() {
    ApplicationManager.getApplication().assertIsDispatchThread();
    TreeUtil.collapseAll(myTree, 0);
}
 
Example 11
Source File: NewErrorTreeViewPanel.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void collapseAll() {
  TreeUtil.collapseAll(myTree, 2);
}
 
Example 12
Source File: DefaultTreeExpander.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void collapseAll() {
  TreeUtil.collapseAll(myTree, 1);
  showSelectionCentered();
}
 
Example 13
Source File: TestTreeExpander.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void collapseAll() {
  TreeUtil.collapseAll(myModel.getTreeView(), 1);
}
 
Example 14
Source File: CouchbasePanel.java    From nosql4idea with Apache License 2.0 4 votes vote down vote up
void collapseAll() {
    TreeTableTree tree = resultTableView.getTree();
    TreeUtil.collapseAll(tree, 1);
}
 
Example 15
Source File: RedisPanel.java    From nosql4idea with Apache License 2.0 4 votes vote down vote up
void collapseAll() {
    TreeTableTree tree = resultTableView.getTree();
    TreeUtil.collapseAll(tree, 1);
}
 
Example 16
Source File: NoSqlExplorerPanel.java    From nosql4idea with Apache License 2.0 4 votes vote down vote up
private void collapseAll() {
    TreeUtil.collapseAll(databaseTree, 1);
}
 
Example 17
Source File: MongoResultPanel.java    From nosql4idea with Apache License 2.0 4 votes vote down vote up
void collapseAll() {
    TreeTableTree tree = resultTableView.getTree();
    TreeUtil.collapseAll(tree, 1);
}