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);
}
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;
}
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;
}
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);
}
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;
}
Aggregations