use of com.intellij.openapi.actionSystem.ActionManager in project android by JetBrains.
the class OpenAndroidSdkManagerHyperlink method execute.
@Override
protected void execute(@NotNull Project project) {
ActionManager actionManager = ActionManager.getInstance();
AnAction sdkManagerAction = actionManager.getAction("Android.RunAndroidSdkManager");
sdkManagerAction.actionPerformed(null);
}
use of com.intellij.openapi.actionSystem.ActionManager in project flutter-intellij by flutter.
the class FlutterStudioStartupActivity method replaceAction.
public static void replaceAction(@NotNull String actionId, @NotNull AnAction newAction) {
ActionManager actionManager = ActionManager.getInstance();
AnAction oldAction = actionManager.getAction(actionId);
if (oldAction != null) {
newAction.getTemplatePresentation().setIcon(oldAction.getTemplatePresentation().getIcon());
newAction.getTemplatePresentation().setText(oldAction.getTemplatePresentation().getTextWithMnemonic(), true);
newAction.getTemplatePresentation().setDescription(oldAction.getTemplatePresentation().getDescription());
actionManager.unregisterAction(actionId);
}
actionManager.registerAction(actionId, newAction);
}
use of com.intellij.openapi.actionSystem.ActionManager in project evosuite by EvoSuite.
the class ApplicationRegistration method initComponent.
@Override
public void initComponent() {
EvoAction evo = new EvoAction();
// Gets an instance of the WindowMenu action group.
// DefaultActionGroup windowM = (DefaultActionGroup) am.getAction("WindowMenu");
// this in the file editor, not the left-pane file selection
// DefaultActionGroup editorM = (DefaultActionGroup) am.getAction("EditorPopupMenu");
ActionManager am = ActionManager.getInstance();
DefaultActionGroup pvM = (DefaultActionGroup) am.getAction("ProjectViewPopupMenu");
pvM.addSeparator();
pvM.add(evo);
DefaultActionGroup epM = (DefaultActionGroup) am.getAction("EditorPopupMenu");
epM.addSeparator();
epM.add(evo);
}
use of com.intellij.openapi.actionSystem.ActionManager in project evosuite by EvoSuite.
the class ProjectRegistration method projectOpened.
@Override
public void projectOpened() {
EvoParameters.getInstance().load(project);
ActionManager am = ActionManager.getInstance();
// create the tool window, which will appear in the bottom when an EvoSuite run is started
ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow = toolWindowManager.registerToolWindow("EvoSuite", false, ToolWindowAnchor.BOTTOM);
toolWindow.setTitle("EvoSuite Console Output");
toolWindow.setType(ToolWindowType.DOCKED, null);
// create a console panel
console = (ConsoleViewImpl) TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
JComponent consolePanel = console.getComponent();
IntelliJNotifier notifier = IntelliJNotifier.registerNotifier(project, "EvoSuite Plugin", console);
// create left-toolbar with stop button
DefaultActionGroup buttonGroup = new DefaultActionGroup();
buttonGroup.add(new StopEvoAction(notifier));
ActionToolbar viewToolbar = am.createActionToolbar("EvoSuite.ConsoleToolbar", buttonGroup, false);
JComponent toolBarPanel = viewToolbar.getComponent();
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(toolBarPanel, BorderLayout.WEST);
panel.add(consolePanel, BorderLayout.CENTER);
// Content content = contentFactory.createContent(consolePanel, "", false);
Content content = contentFactory.createContent(panel, "", false);
toolWindow.getContentManager().addContent(content);
}
use of com.intellij.openapi.actionSystem.ActionManager in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugProcessTest method assertRemoveFromLeftToolbar.
private void assertRemoveFromLeftToolbar(String actionId) {
ActionManager manager = ActionManager.getInstance();
AnAction action = manager.getAction(actionId);
List<AnAction> leftToolbarActions = Lists.newArrayList();
leftToolbarActions.add(action);
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(1, leftToolbar.getChildrenCount());
AnAction actual = leftToolbar.getChildActionsOrStubs()[0];
assertEquals("Stop IDE Debugging. (Exit debug mode and continue the debug session later.)", actual.toString());
}
Aggregations