Search in sources :

Example 11 with TreeExpander

use of com.intellij.ide.TreeExpander in project intellij-community by JetBrains.

the class TreeExpandAllActionBase method actionPerformed.

public final void actionPerformed(AnActionEvent e) {
    TreeExpander expander = getExpander(e.getDataContext());
    if (expander == null)
        return;
    if (!expander.canExpand())
        return;
    expander.expandAll();
}
Also used : TreeExpander(com.intellij.ide.TreeExpander)

Example 12 with TreeExpander

use of com.intellij.ide.TreeExpander in project android by JetBrains.

the class ToolWindowAlikePanel method createTreePanel.

@NotNull
public static ToolWindowAlikePanel createTreePanel(@NotNull String title, @NotNull JTree tree) {
    ToolWindowAlikePanel panel = new ToolWindowAlikePanel(title, createScrollPane(tree));
    Object root = tree.getModel().getRoot();
    if (root instanceof TreeNode && ((TreeNode) root).getChildCount() > 0) {
        TreeExpander expander = new DefaultTreeExpander(tree);
        CommonActionsManager actions = CommonActionsManager.getInstance();
        AnAction expandAllAction = actions.createExpandAllAction(expander, tree);
        expandAllAction.getTemplatePresentation().setIcon(ExpandAll);
        AnAction collapseAllAction = actions.createCollapseAllAction(expander, tree);
        collapseAllAction.getTemplatePresentation().setIcon(CollapseAll);
        panel.setAdditionalTitleActions(expandAllAction, collapseAllAction);
    }
    return panel;
}
Also used : TreeExpander(com.intellij.ide.TreeExpander) DefaultTreeExpander(com.intellij.ide.DefaultTreeExpander) TreeNode(javax.swing.tree.TreeNode) CommonActionsManager(com.intellij.ide.CommonActionsManager) DefaultTreeExpander(com.intellij.ide.DefaultTreeExpander) AnAction(com.intellij.openapi.actionSystem.AnAction) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

TreeExpander (com.intellij.ide.TreeExpander)12 CommonActionsManager (com.intellij.ide.CommonActionsManager)7 DefaultTreeExpander (com.intellij.ide.DefaultTreeExpander)3 Presentation (com.intellij.openapi.actionSystem.Presentation)2 FilterComponent (com.intellij.ui.FilterComponent)2 Alarm (com.intellij.util.Alarm)2 NotNull (org.jetbrains.annotations.NotNull)2 ExecutionBundle (com.intellij.execution.ExecutionBundle)1 DashboardGrouper (com.intellij.execution.dashboard.tree.DashboardGrouper)1 RunDashboardTreeStructure (com.intellij.execution.dashboard.tree.RunDashboardTreeStructure)1 DataManager (com.intellij.ide.DataManager)1 com.intellij.ide.util.treeView (com.intellij.ide.util.treeView)1 ActionPresentation (com.intellij.ide.util.treeView.smartTree.ActionPresentation)1 Disposable (com.intellij.openapi.Disposable)1 com.intellij.openapi.actionSystem (com.intellij.openapi.actionSystem)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 ApplicationManager (com.intellij.openapi.application.ApplicationManager)1 DumbAware (com.intellij.openapi.project.DumbAware)1 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)1