Search in sources :

Example 1 with CollapseAllAction

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

the class FavoritesTreeViewPanel method setupToolWindow.

public void setupToolWindow(ToolWindowEx window) {
    final CollapseAllAction collapseAction = new CollapseAllAction(myTree);
    collapseAction.getTemplatePresentation().setIcon(AllIcons.General.CollapseAll);
    collapseAction.getTemplatePresentation().setHoveredIcon(AllIcons.General.CollapseAllHover);
    window.setTitleActions(collapseAction);
    final DefaultActionGroup group = new DefaultActionGroup();
    final ProjectViewDirectoryHelper helper = ProjectViewDirectoryHelper.getInstance(myProject);
    if (helper.supportsFlattenPackages()) {
        group.add(new FavoritesFlattenPackagesAction(myProject, myBuilder));
    }
    if (helper.supportsHideEmptyMiddlePackages()) {
        group.add(new FavoritesCompactEmptyMiddlePackagesAction(myProject, myBuilder));
    }
    if (helper.supportsFlattenPackages()) {
        group.addAction(new FavoritesAbbreviatePackageNamesAction(myProject, myBuilder));
    }
    if (!PlatformUtils.isCidr()) {
        group.add(new FavoritesShowMembersAction(myProject, myBuilder));
    }
    final FavoritesAutoscrollFromSourceHandler handler = new FavoritesAutoscrollFromSourceHandler(myProject, myBuilder);
    handler.install();
    group.add(handler.createToggleAction());
    group.add(new FavoritesAutoScrollToSourceAction(myProject, myAutoScrollToSourceHandler, myBuilder));
    window.setAdditionalGearActions(group);
}
Also used : CollapseAllAction(com.intellij.ui.treeStructure.actions.CollapseAllAction) ProjectViewDirectoryHelper(com.intellij.ide.projectView.impl.nodes.ProjectViewDirectoryHelper)

Example 2 with CollapseAllAction

use of com.intellij.ui.treeStructure.actions.CollapseAllAction 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 3 with CollapseAllAction

use of com.intellij.ui.treeStructure.actions.CollapseAllAction 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 4 with CollapseAllAction

use of com.intellij.ui.treeStructure.actions.CollapseAllAction 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 5 with CollapseAllAction

use of com.intellij.ui.treeStructure.actions.CollapseAllAction 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)

Aggregations

CollapseAllAction (com.intellij.ui.treeStructure.actions.CollapseAllAction)6 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 ProjectViewDirectoryHelper (com.intellij.ide.projectView.impl.nodes.ProjectViewDirectoryHelper)1