Search in sources :

Example 11 with CommonActionsManager

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

the class SpecificFilesViewDialog method createPanel.

private void createPanel() {
    myPanel = new JPanel(new BorderLayout());
    final DefaultActionGroup group = new DefaultActionGroup();
    final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar("SPECIFIC_FILES_DIALOG", group, true);
    addCustomActions(group, actionToolbar);
    final CommonActionsManager cam = CommonActionsManager.getInstance();
    final Expander expander = new Expander();
    group.addSeparator();
    group.add(new ToggleShowFlattenAction());
    group.add(cam.createExpandAllAction(expander, myView));
    group.add(cam.createCollapseAllAction(expander, myView));
    myPanel.add(actionToolbar.getComponent(), BorderLayout.NORTH);
    myPanel.add(ScrollPaneFactory.createScrollPane(myView), BorderLayout.CENTER);
    myView.setShowFlatten(false);
}
Also used : TreeExpander(com.intellij.ide.TreeExpander) CommonActionsManager(com.intellij.ide.CommonActionsManager)

Example 12 with CommonActionsManager

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

the class ProjectProfileSelectionDialog method createTreePanel.

@NotNull
static JPanel createTreePanel(@NotNull CheckboxTreeView tree) {
    JPanel treePanel = new JPanel(new BorderLayout());
    DefaultActionGroup group = new DefaultActionGroup();
    CommonActionsManager actions = CommonActionsManager.getInstance();
    group.addAll(actions.createExpandAllAction(tree, treePanel), actions.createCollapseAllAction(tree, treePanel));
    ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar("AndroidProjectProfileSelection", group, true);
    JPanel buttonsPanel = new JPanel(new BorderLayout());
    buttonsPanel.add(actionToolBar.getComponent(), BorderLayout.CENTER);
    buttonsPanel.setBorder(new SideBorder(JBColor.border(), SideBorder.TOP | SideBorder.LEFT | SideBorder.RIGHT, 1));
    treePanel.add(buttonsPanel, BorderLayout.NORTH);
    treePanel.add(ScrollPaneFactory.createScrollPane(tree), BorderLayout.CENTER);
    return treePanel;
}
Also used : CommonActionsManager(com.intellij.ide.CommonActionsManager) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) NotNull(org.jetbrains.annotations.NotNull)

Example 13 with CommonActionsManager

use of com.intellij.ide.CommonActionsManager 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

CommonActionsManager (com.intellij.ide.CommonActionsManager)13 TreeExpander (com.intellij.ide.TreeExpander)7 DefaultTreeExpander (com.intellij.ide.DefaultTreeExpander)5 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)4 NotNull (org.jetbrains.annotations.NotNull)3 FilterComponent (com.intellij.ui.FilterComponent)2 Alarm (com.intellij.util.Alarm)2 TreePath (javax.swing.tree.TreePath)2 ConsoleActionsPostProcessor (com.intellij.execution.actions.ConsoleActionsPostProcessor)1 ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 ActionToolbarImpl (com.intellij.openapi.actionSystem.impl.ActionToolbarImpl)1 ScrollToTheEndToolbarAction (com.intellij.openapi.editor.actions.ScrollToTheEndToolbarAction)1 ToggleUseSoftWrapsToolbarAction (com.intellij.openapi.editor.actions.ToggleUseSoftWrapsToolbarAction)1 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)1 RelativePoint (com.intellij.ui.awt.RelativePoint)1 ArrayList (java.util.ArrayList)1 EmptyBorder (javax.swing.border.EmptyBorder)1 TreeSelectionEvent (javax.swing.event.TreeSelectionEvent)1 TreeSelectionListener (javax.swing.event.TreeSelectionListener)1