use of com.intellij.openapi.actionSystem.DefaultActionGroup in project intellij-community by JetBrains.
the class AbstractComboBoxAction method createPopupActionGroup.
@NotNull
@Override
protected DefaultActionGroup createPopupActionGroup(JComponent button) {
DefaultActionGroup actionGroup = new DefaultActionGroup();
for (final T item : myItems) {
if (addSeparator(actionGroup, item)) {
continue;
}
AnAction action = new AnAction() {
@Override
public void actionPerformed(AnActionEvent e) {
if (mySelection != item && selectionChanged(item)) {
mySelection = item;
AbstractComboBoxAction.this.update(item, myPresentation, false);
}
}
};
actionGroup.add(action);
Presentation presentation = action.getTemplatePresentation();
presentation.setIcon(mySelection == item ? CHECKED : null);
update(item, presentation, true);
}
return actionGroup;
}
use of com.intellij.openapi.actionSystem.DefaultActionGroup in project intellij-community by JetBrains.
the class CCPluginConfigurator method getActionGroup.
@NotNull
@Override
public DefaultActionGroup getActionGroup(Project project) {
final DefaultActionGroup group = new DefaultActionGroup();
group.add(new StudyPreviousTaskAction());
group.add(new StudyNextTaskAction());
group.add(new StudyRefreshTaskFileAction());
group.add(new CCShowHintAction());
group.add(new StudyRunAction());
group.add(new StudyEditInputAction());
return group;
}
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()));
}
}
});
}
Aggregations