Search in sources :

Example 1 with ExpandAllAction

use of com.intellij.ui.treeStructure.actions.ExpandAllAction in project intellij-community by JetBrains.

the class ChangesTreeList method getTreeActions.

public AnAction[] getTreeActions() {
    final ToggleShowDirectoriesAction directoriesAction = new ToggleShowDirectoriesAction();
    final ExpandAllAction expandAllAction = new ExpandAllAction(this) {

        @Override
        public void update(AnActionEvent e) {
            e.getPresentation().setEnabledAndVisible(!myShowFlatten || !myIsModelFlat);
        }
    };
    final CollapseAllAction collapseAllAction = new CollapseAllAction(this) {

        @Override
        public void update(AnActionEvent e) {
            e.getPresentation().setEnabledAndVisible(!myShowFlatten || !myIsModelFlat);
        }
    };
    final AnAction[] actions = new AnAction[] { directoriesAction, expandAllAction, collapseAllAction };
    directoriesAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_P, SystemInfo.isMac ? InputEvent.META_DOWN_MASK : InputEvent.CTRL_DOWN_MASK)), this);
    expandAllAction.registerCustomShortcutSet(new CustomShortcutSet(KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_EXPAND_ALL)), this);
    collapseAllAction.registerCustomShortcutSet(new CustomShortcutSet(KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_COLLAPSE_ALL)), this);
    return actions;
}
Also used : CollapseAllAction(com.intellij.ui.treeStructure.actions.CollapseAllAction) ExpandAllAction(com.intellij.ui.treeStructure.actions.ExpandAllAction)

Example 2 with ExpandAllAction

use of com.intellij.ui.treeStructure.actions.ExpandAllAction in project android by JetBrains.

the class CapturesToolWindow method getPopupActions.

private ActionGroup getPopupActions() {
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new ExpandAllAction(myTree));
    group.add(new CollapseAllAction(myTree));
    group.addSeparator();
    group.add(new RevealFileAction());
    group.add(new RenameCaptureFileAction(myTree));
    group.add(new DeleteAction());
    group.addSeparator();
    group.add(new RunHprofConvAndSaveAsAction());
    return group;
}
Also used : CollapseAllAction(com.intellij.ui.treeStructure.actions.CollapseAllAction) RunHprofConvAndSaveAsAction(com.android.tools.idea.ddms.hprof.RunHprofConvAndSaveAsAction) DeleteAction(com.intellij.ide.actions.DeleteAction) ExpandAllAction(com.intellij.ui.treeStructure.actions.ExpandAllAction) RevealFileAction(com.intellij.ide.actions.RevealFileAction)

Example 3 with ExpandAllAction

use of com.intellij.ui.treeStructure.actions.ExpandAllAction in project intellij-community by JetBrains.

the class CommittedChangesTreeBrowser method createGroupFilterToolbar.

public ActionToolbar createGroupFilterToolbar(final Project project, final ActionGroup leadGroup, @Nullable final ActionGroup tailGroup, final List<AnAction> extra) {
    DefaultActionGroup toolbarGroup = new DefaultActionGroup();
    toolbarGroup.add(leadGroup);
    toolbarGroup.addSeparator();
    toolbarGroup.add(new SelectFilteringAction(project, this));
    toolbarGroup.add(new SelectGroupingAction(project, this));
    final ExpandAllAction expandAllAction = new ExpandAllAction(myChangesTree);
    final CollapseAllAction collapseAllAction = new CollapseAllAction(myChangesTree);
    expandAllAction.registerCustomShortcutSet(new CustomShortcutSet(KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_EXPAND_ALL)), myChangesTree);
    collapseAllAction.registerCustomShortcutSet(new CustomShortcutSet(KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_COLLAPSE_ALL)), myChangesTree);
    toolbarGroup.add(expandAllAction);
    toolbarGroup.add(collapseAllAction);
    toolbarGroup.add(ActionManager.getInstance().getAction(VcsActions.ACTION_COPY_REVISION_NUMBER));
    toolbarGroup.add(new ContextHelpAction(myHelpId));
    if (tailGroup != null) {
        toolbarGroup.add(tailGroup);
    }
    for (AnAction anAction : extra) {
        toolbarGroup.add(anAction);
    }
    return ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarGroup, true);
}
Also used : CollapseAllAction(com.intellij.ui.treeStructure.actions.CollapseAllAction) ExpandAllAction(com.intellij.ui.treeStructure.actions.ExpandAllAction) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction)

Example 4 with ExpandAllAction

use of com.intellij.ui.treeStructure.actions.ExpandAllAction in project intellij-community by JetBrains.

the class StructureViewComponent method createActionGroup.

protected ActionGroup createActionGroup() {
    DefaultActionGroup result = new DefaultActionGroup();
    Sorter[] sorters = myTreeModel.getSorters();
    for (final Sorter sorter : sorters) {
        if (sorter.isVisible()) {
            result.add(new TreeActionWrapper(sorter, this));
        }
    }
    if (sorters.length > 0) {
        result.addSeparator();
    }
    addGroupByActions(result);
    Filter[] filters = myTreeModel.getFilters();
    for (Filter filter : filters) {
        result.add(new TreeActionWrapper(filter, this));
    }
    if (myTreeModel instanceof ProvidingTreeModel) {
        final Collection<NodeProvider> providers = ((ProvidingTreeModel) myTreeModel).getNodeProviders();
        for (NodeProvider provider : providers) {
            result.add(new TreeActionWrapper(provider, this));
        }
    }
    result.add(new ExpandAllAction(getTree()));
    result.add(new CollapseAllAction(getTree()));
    if (showScrollToFromSourceActions()) {
        result.addSeparator();
        result.add(myAutoScrollToSourceHandler.createToggleAction());
        result.add(myAutoScrollFromSourceHandler.createToggleAction());
    }
    return result;
}
Also used : CollapseAllAction(com.intellij.ui.treeStructure.actions.CollapseAllAction) ExpandAllAction(com.intellij.ui.treeStructure.actions.ExpandAllAction)

Example 5 with ExpandAllAction

use of com.intellij.ui.treeStructure.actions.ExpandAllAction in project intellij-community by JetBrains.

the class DomModelTreeView method getPopupActions.

protected ActionGroup getPopupActions() {
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(ActionManager.getInstance().getAction("DomElementsTreeView.TreePopup"));
    group.addSeparator();
    group.add(new ExpandAllAction(myTree));
    group.add(new CollapseAllAction(myTree));
    return group;
}
Also used : CollapseAllAction(com.intellij.ui.treeStructure.actions.CollapseAllAction) ExpandAllAction(com.intellij.ui.treeStructure.actions.ExpandAllAction)

Aggregations

CollapseAllAction (com.intellij.ui.treeStructure.actions.CollapseAllAction)5 ExpandAllAction (com.intellij.ui.treeStructure.actions.ExpandAllAction)5 RunHprofConvAndSaveAsAction (com.android.tools.idea.ddms.hprof.RunHprofConvAndSaveAsAction)1 ContextHelpAction (com.intellij.ide.actions.ContextHelpAction)1 DeleteAction (com.intellij.ide.actions.DeleteAction)1 RevealFileAction (com.intellij.ide.actions.RevealFileAction)1