use of com.intellij.openapi.actionSystem.ActionManager in project azure-tools-for-java by Microsoft.
the class HDInsightActionsComponent method initComponent.
@Override
public void initComponent() {
ActionManager actionManager = ActionManager.getInstance();
DefaultActionGroup projectPopupGroup = (DefaultActionGroup) actionManager.getAction(IdeActions.GROUP_PROJECT_VIEW_POPUP);
projectPopupGroup.add(actionManager.getAction("Actions.SubmitSparkApplicationAction"));
}
use of com.intellij.openapi.actionSystem.ActionManager in project intellij-plugins by JetBrains.
the class SplitEditorToolbar method createToolbarFromGroupId.
@NotNull
private static ActionToolbar createToolbarFromGroupId(@NotNull String groupId) {
final ActionManager actionManager = ActionManager.getInstance();
if (!actionManager.isGroup(groupId)) {
throw new IllegalStateException(groupId + " should have been a group");
}
final ActionGroup group = ((ActionGroup) actionManager.getAction(groupId));
final ActionToolbarImpl editorToolbar = ((ActionToolbarImpl) actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, group, true));
editorToolbar.setOpaque(false);
editorToolbar.setBorder(new JBEmptyBorder(0, 2, 0, 2));
return editorToolbar;
}
use of com.intellij.openapi.actionSystem.ActionManager in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugProcess method registerAdditionalActions.
@Override
public void registerAdditionalActions(@NotNull DefaultActionGroup leftToolbar, @NotNull DefaultActionGroup topToolbar, @NotNull DefaultActionGroup settings) {
ActionManager manager = ActionManager.getInstance();
leftToolbar.add(new SaveAndExitAction(), new Constraints(Anchor.AFTER, IdeActions.ACTION_STOP_PROGRAM));
leftToolbar.remove(manager.getAction(IdeActions.ACTION_RERUN));
leftToolbar.remove(manager.getAction(IdeActions.ACTION_STOP_PROGRAM));
// XDebugSessionTab puts this action second from end.
AnAction[] actions = leftToolbar.getChildActionsOrStubs();
for (AnAction action : actions) {
String text = action.getTemplatePresentation().getText();
if (ExecutionBundle.message("close.tab.action.name").equals(text)) {
leftToolbar.remove(action);
break;
}
}
// https://github.com/GoogleCloudPlatform/gcloud-intellij/issues/149
for (AnAction child : leftToolbar.getChildActionsOrStubs()) {
if (child.getClass().getCanonicalName().equalsIgnoreCase("com.intellij.ide.actions.ContextHelpAction")) {
// we never want to show IDEA's help.
leftToolbar.remove(child);
// show our help if we have it.
String helpUrl = GctBundle.getString("clouddebug.helpurl");
if (!"".equals(helpUrl)) {
leftToolbar.add(new CloudDebugHelpAction(helpUrl));
}
break;
}
}
leftToolbar.remove(manager.getAction(XDebuggerActions.RESUME));
leftToolbar.remove(manager.getAction(XDebuggerActions.PAUSE));
leftToolbar.remove(manager.getAction(XDebuggerActions.MUTE_BREAKPOINTS));
topToolbar.remove(manager.getAction(XDebuggerActions.STEP_OVER));
topToolbar.remove(manager.getAction(XDebuggerActions.STEP_INTO));
topToolbar.remove(manager.getAction(XDebuggerActions.FORCE_STEP_INTO));
topToolbar.remove(manager.getAction(XDebuggerActions.STEP_OUT));
topToolbar.remove(manager.getAction(XDebuggerActions.RUN_TO_CURSOR));
topToolbar.remove(manager.getAction(XDebuggerActions.EVALUATE_EXPRESSION));
topToolbar.remove(manager.getAction(DebuggerActions.POP_FRAME));
}
use of com.intellij.openapi.actionSystem.ActionManager in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugProcessTest method testRegisterAdditionalActions_close.
public void testRegisterAdditionalActions_close() {
ActionManager manager = ActionManager.getInstance();
AnAction action0 = manager.getAction(IdeActions.ACTION_PIN_ACTIVE_TAB);
AnAction action1 = manager.getAction(IdeActions.ACTION_CLOSE);
action1.getTemplatePresentation().setText("Close");
AnAction action2 = manager.getAction(IdeActions.ACTION_CONTEXT_HELP);
AnAction action3 = manager.getAction(IdeActions.ACTION_CALL_HIERARCHY);
List<AnAction> leftToolbarActions = Lists.newArrayList();
leftToolbarActions.add(action0);
leftToolbarActions.add(action1);
leftToolbarActions.add(action2);
leftToolbarActions.add(action3);
DefaultActionGroup leftToolbar = new DefaultActionGroup(leftToolbarActions);
List<AnAction> actions = Lists.newArrayList();
DefaultActionGroup topToolbar = new DefaultActionGroup(actions);
DefaultActionGroup settings = new DefaultActionGroup(actions);
process.registerAdditionalActions(leftToolbar, topToolbar, settings);
assertEquals(4, leftToolbar.getChildrenCount());
assertEquals(action0, leftToolbar.getChildActionsOrStubs()[0]);
assertEquals(action3, leftToolbar.getChildActionsOrStubs()[1]);
}
use of com.intellij.openapi.actionSystem.ActionManager in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugProcessTest method assertRemoveFromTopToolbar.
private void assertRemoveFromTopToolbar(String actionId) {
ActionManager manager = ActionManager.getInstance();
AnAction action = manager.getAction(actionId);
List<AnAction> topToolbarActions = Lists.newArrayList();
topToolbarActions.add(action);
DefaultActionGroup topToolbar = new DefaultActionGroup(topToolbarActions);
List<AnAction> actions = Lists.newArrayList();
DefaultActionGroup leftToolbar = new DefaultActionGroup(actions);
DefaultActionGroup settings = new DefaultActionGroup(actions);
process.registerAdditionalActions(leftToolbar, topToolbar, settings);
assertEmpty(topToolbar.getChildActionsOrStubs());
}
Aggregations