Search in sources :

Example 16 with ActionGroup

use of com.intellij.openapi.actionSystem.ActionGroup in project android by JetBrains.

the class NlActionsToolbar method createToolbarComponent.

private JComponent createToolbarComponent() {
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
    // Create a layout where there are three toolbars:
    // +----------------------------------------------------------------------------+
    // | Normal toolbar, minus dynamic actions                                      |
    // +---------------------------------------------+------------------------------+
    // | Dynamic layout actions                      | Zoom actions and file status |
    // +---------------------------------------------+------------------------------+
    ConfigurationHolder context = new NlEditorPanel.NlConfigurationHolder(mySurface);
    ActionGroup configGroup = createConfigActions(context, mySurface);
    ActionManager actionManager = ActionManager.getInstance();
    myActionToolbar = actionManager.createActionToolbar("NlConfigToolbar", configGroup, true);
    myActionToolbar.getComponent().setName("NlConfigToolbar");
    myActionToolbar.setLayoutPolicy(ActionToolbar.WRAP_LAYOUT_POLICY);
    JComponent actionToolbarComponent = myActionToolbar.getComponent();
    actionToolbarComponent.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
    panel.add(actionToolbarComponent, BorderLayout.NORTH);
    final ActionToolbar layoutToolBar = actionManager.createActionToolbar("NlLayoutToolbar", myDynamicGroup, true);
    layoutToolBar.getComponent().setName("NlLayoutToolbar");
    layoutToolBar.setLayoutPolicy(ActionToolbar.WRAP_LAYOUT_POLICY);
    JPanel bottom = new JPanel(new BorderLayout());
    bottom.add(layoutToolBar.getComponent(), BorderLayout.WEST);
    JPanel combined = new JPanel(new BorderLayout());
    ActionToolbar zoomToolBar = actionManager.createActionToolbar("NlRhsToolbar", getRhsActions(mySurface), true);
    combined.add(zoomToolBar.getComponent(), BorderLayout.WEST);
    bottom.add(combined, BorderLayout.EAST);
    panel.add(bottom, BorderLayout.SOUTH);
    mySurface.addListener(this);
    updateViewActions();
    return panel;
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) ActionToolbar(com.intellij.openapi.actionSystem.ActionToolbar)

Example 17 with ActionGroup

use of com.intellij.openapi.actionSystem.ActionGroup in project intellij-plugins by JetBrains.

the class DartCallHierarchyBrowser method createTrees.

@Override
protected void createTrees(@NotNull Map<String, JTree> type2TreeMap) {
    final ActionGroup group = (ActionGroup) ActionManager.getInstance().getAction(GROUP_DART_CALL_HIERARCHY_POPUP);
    type2TreeMap.put(CALLER_TYPE, createHierarchyTree(group));
    type2TreeMap.put(CALLEE_TYPE, createHierarchyTree(group));
}
Also used : ActionGroup(com.intellij.openapi.actionSystem.ActionGroup)

Example 18 with ActionGroup

use of com.intellij.openapi.actionSystem.ActionGroup in project intellij-plugins by JetBrains.

the class DartMethodHierarchyBrowser method createTrees.

@Override
protected void createTrees(@NotNull Map<String, JTree> trees) {
    final JTree tree = createTree(false);
    ActionGroup group = (ActionGroup) ActionManager.getInstance().getAction(GROUP_DART_METHOD_HIERARCHY_POPUP);
    PopupHandler.installPopupHandler(tree, group, ActionPlaces.METHOD_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
    trees.put(METHOD_TYPE, tree);
}
Also used : ActionGroup(com.intellij.openapi.actionSystem.ActionGroup)

Example 19 with ActionGroup

use of com.intellij.openapi.actionSystem.ActionGroup in project intellij-community by JetBrains.

the class EditorActionUtil method createEditorPopupHandler.

public static EditorPopupHandler createEditorPopupHandler(@NotNull final String groupId) {
    return new EditorPopupHandler() {

        @Override
        public void invokePopup(final EditorMouseEvent event) {
            if (!event.isConsumed() && event.getArea() == EditorMouseEventArea.EDITING_AREA) {
                ActionGroup group = (ActionGroup) CustomActionsSchema.getInstance().getCorrectedAction(groupId);
                showEditorPopup(event, group);
            }
        }
    };
}
Also used : EditorMouseEvent(com.intellij.openapi.editor.event.EditorMouseEvent) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) EditorPopupHandler(com.intellij.util.EditorPopupHandler)

Example 20 with ActionGroup

use of com.intellij.openapi.actionSystem.ActionGroup in project intellij-community by JetBrains.

the class ContentImpl method setActions.

@Override
public void setActions(final ActionGroup actions, String place, @Nullable JComponent contextComponent) {
    final ActionGroup oldActions = myActions;
    myActions = actions;
    myPlace = place;
    myActionsContextComponent = contextComponent;
    myChangeSupport.firePropertyChange(PROP_ACTIONS, oldActions, myActions);
}
Also used : ActionGroup(com.intellij.openapi.actionSystem.ActionGroup)

Aggregations

ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)30 AnAction (com.intellij.openapi.actionSystem.AnAction)8 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)8 NotNull (org.jetbrains.annotations.NotNull)6 ActionManager (com.intellij.openapi.actionSystem.ActionManager)4 ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)4 GutterIconRenderer (com.intellij.openapi.editor.markup.GutterIconRenderer)3 List (java.util.List)3 Nullable (org.jetbrains.annotations.Nullable)3 Pass (com.intellij.codeHighlighting.Pass)2 LineMarkerInfo (com.intellij.codeInsight.daemon.LineMarkerInfo)2 BranchActionGroup (com.intellij.dvcs.ui.BranchActionGroup)2 BranchActionGroupPopup.wrapWithMoreActionIfNeeded (com.intellij.dvcs.ui.BranchActionGroupPopup.wrapWithMoreActionIfNeeded)2 FAVORITE_BRANCH_COMPARATOR (com.intellij.dvcs.ui.BranchActionUtil.FAVORITE_BRANCH_COMPARATOR)2 BranchActionUtil.getNumOfTopShownBranches (com.intellij.dvcs.ui.BranchActionUtil.getNumOfTopShownBranches)2 AllIcons (com.intellij.icons.AllIcons)2 Group (com.intellij.openapi.keymap.impl.ui.Group)2 Project (com.intellij.openapi.project.Project)2 PsiElement (com.intellij.psi.PsiElement)2 ArrayList (java.util.ArrayList)2