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