Search in sources :

Example 16 with DefaultActionGroup

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

the class OpenUrlHyperlinkInfo method getPopupMenuGroup.

@Override
public ActionGroup getPopupMenuGroup(@NotNull MouseEvent event) {
    DefaultActionGroup group = new DefaultActionGroup();
    for (final WebBrowser browser : WebBrowserManager.getInstance().getActiveBrowsers()) {
        if (browserCondition.value(browser)) {
            group.add(new AnAction("Open in " + browser.getName(), "Open URL in " + browser.getName(), browser.getIcon()) {

                @Override
                public void actionPerformed(AnActionEvent e) {
                    BrowserLauncher.getInstance().browse(url, browser, e.getProject());
                }
            });
        }
    }
    group.add(new AnAction("Copy URL", "Copy URL to clipboard", PlatformIcons.COPY_ICON) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            CopyPasteManager.getInstance().setContents(new StringSelection(url));
        }
    });
    return group;
}
Also used : AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) AnAction(com.intellij.openapi.actionSystem.AnAction) StringSelection(java.awt.datatransfer.StringSelection)

Example 17 with DefaultActionGroup

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

the class RadGridLayoutManager method getCaptionActions.

@Override
public ActionGroup getCaptionActions() {
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new InsertBeforeAction());
    group.add(new InsertAfterAction());
    group.add(new SplitAction());
    group.add(new DeleteAction());
    return group;
}
Also used : InsertAfterAction(com.intellij.uiDesigner.actions.InsertAfterAction) SplitAction(com.intellij.uiDesigner.actions.SplitAction) InsertBeforeAction(com.intellij.uiDesigner.actions.InsertBeforeAction) DeleteAction(com.intellij.uiDesigner.actions.DeleteAction) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 18 with DefaultActionGroup

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

the class IpnbEditablePanel method addRightClickMenu.

@Override
protected void addRightClickMenu() {
    myViewPanel.addMouseListener(new MouseAdapter() {

        @Override
        public void mousePressed(MouseEvent e) {
            if (SwingUtilities.isRightMouseButton(e) && e.getClickCount() == 1) {
                final DefaultActionGroup group = new DefaultActionGroup(new IpnbMergeCellAboveAction(), new IpnbMergeCellBelowAction());
                final ListPopup menu = createPopupMenu(group);
                menu.show(RelativePoint.fromScreen(e.getLocationOnScreen()));
            }
        }
    });
    myEditableTextArea.addMouseListener(new MouseAdapter() {

        @Override
        public void mousePressed(MouseEvent e) {
            if (SwingUtilities.isRightMouseButton(e) && e.getClickCount() == 1) {
                final DefaultActionGroup group = new DefaultActionGroup(new IpnbSplitCellAction());
                final ListPopup menu = createPopupMenu(group);
                menu.show(RelativePoint.fromScreen(e.getLocationOnScreen()));
            }
        }
    });
}
Also used : MouseEvent(java.awt.event.MouseEvent) IpnbMergeCellBelowAction(org.jetbrains.plugins.ipnb.editor.actions.IpnbMergeCellBelowAction) MouseAdapter(java.awt.event.MouseAdapter) ListPopup(com.intellij.openapi.ui.popup.ListPopup) IpnbMergeCellAboveAction(org.jetbrains.plugins.ipnb.editor.actions.IpnbMergeCellAboveAction) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) IpnbSplitCellAction(org.jetbrains.plugins.ipnb.editor.actions.IpnbSplitCellAction)

Example 19 with DefaultActionGroup

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

the class MvcConsole method setUpToolWindow.

private Content setUpToolWindow() {
    //Create runner UI layout
    final RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject);
    final RunnerLayoutUi layoutUi = factory.create("", "", "session", myProject);
    // Adding actions
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(myKillAction);
    group.addSeparator();
    layoutUi.getOptions().setLeftToolbar(group, ActionPlaces.UNKNOWN);
    final Content console = layoutUi.createContent(CONSOLE_ID, myConsole.getComponent(), "", null, null);
    layoutUi.addContent(console, 0, PlaceInGrid.right, false);
    final JComponent uiComponent = layoutUi.getComponent();
    myPanel.add(uiComponent, BorderLayout.CENTER);
    final ContentManager manager = myToolWindow.getContentManager();
    final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    final Content content = contentFactory.createContent(uiComponent, null, true);
    manager.addContent(content);
    return content;
}
Also used : RunnerLayoutUi(com.intellij.execution.ui.RunnerLayoutUi) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) ContentFactory(com.intellij.ui.content.ContentFactory)

Example 20 with DefaultActionGroup

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

the class SelectLocationDialog method createToolbar.

@NotNull
private JComponent createToolbar() {
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new RepositoryBrowserDialog.EditLocationAction(myRepositoryBrowser));
    return ActionManager.getInstance().createActionToolbar(RepositoryBrowserDialog.PLACE_TOOLBAR, group, true).getComponent();
}
Also used : DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)109 NotNull (org.jetbrains.annotations.NotNull)38 AnAction (com.intellij.openapi.actionSystem.AnAction)22 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)16 Nullable (org.jetbrains.annotations.Nullable)11 ActionManager (com.intellij.openapi.actionSystem.ActionManager)8 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)7 Separator (com.intellij.openapi.actionSystem.Separator)7 ListPopup (com.intellij.openapi.ui.popup.ListPopup)7 Content (com.intellij.ui.content.Content)6 BrowserHelpAction (com.android.tools.idea.actions.BrowserHelpAction)5 Project (com.intellij.openapi.project.Project)5 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 List (java.util.List)5 RecordingAction (com.android.tools.idea.monitor.actions.RecordingAction)4 ActionToolbar (com.intellij.openapi.actionSystem.ActionToolbar)4 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)4 javax.swing (javax.swing)4 FolderConfiguration (com.android.ide.common.resources.configuration.FolderConfiguration)3 CommonActionsManager (com.intellij.ide.CommonActionsManager)3