use of com.intellij.openapi.actionSystem.ActionManager in project intellij-community by JetBrains.
the class MavenUIUtil method executeAction.
public static void executeAction(final String actionId, final InputEvent e) {
final ActionManager actionManager = ActionManager.getInstance();
final AnAction action = actionManager.getAction(actionId);
if (action != null) {
final Presentation presentation = new Presentation();
final AnActionEvent event = new AnActionEvent(e, DataManager.getInstance().getDataContext(e.getComponent()), "", presentation, actionManager, 0);
action.update(event);
if (presentation.isEnabled()) {
action.actionPerformed(event);
}
}
}
use of com.intellij.openapi.actionSystem.ActionManager in project intellij-community by JetBrains.
the class SelectionTool method handlePopup.
@Override
protected void handlePopup() {
ActionManager actionManager = ActionManager.getInstance();
ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(myArea.getPopupPlace(), myArea.getPopupActions());
MouseEvent event = (MouseEvent) myInputEvent;
popupMenu.getComponent().show(myArea.getNativeComponent(), event.getX(), event.getY());
}
use of com.intellij.openapi.actionSystem.ActionManager in project intellij-community by JetBrains.
the class ApplicationLoader method installValidateXmlAction.
private static void installValidateXmlAction() {
final ActionManager mgr = ActionManager.getInstance();
final AnAction validateAction = mgr.getAction(VALIDATE_XML);
mgr.unregisterAction(VALIDATE_XML);
mgr.registerAction(VALIDATE_XML, new ValidateAction(validateAction));
}
use of com.intellij.openapi.actionSystem.ActionManager in project azure-tools-for-java by Microsoft.
the class AzureActionsComponent method initComponent.
public void initComponent() {
if (!AzurePlugin.IS_ANDROID_STUDIO) {
initAuthManage();
ActionManager am = ActionManager.getInstance();
DefaultActionGroup toolbarGroup = (DefaultActionGroup) am.getAction(IdeActions.GROUP_MAIN_TOOLBAR);
toolbarGroup.addAll((DefaultActionGroup) am.getAction("AzureToolbarGroup"));
DefaultActionGroup popupGroup = (DefaultActionGroup) am.getAction(IdeActions.GROUP_PROJECT_VIEW_POPUP);
popupGroup.add(am.getAction("AzurePopupGroup"));
if (PlatformUtils.isIdeaUltimate()) {
ActionManager actionManager = ActionManager.getInstance();
DefaultActionGroup actionGroup = (DefaultActionGroup) actionManager.getAction("PublishGroup");
if (actionGroup != null)
actionGroup.addAll((ActionGroup) actionManager.getAction("AzureWebDeployGroup"));
}
}
try {
PlatformDependent.isAndroid();
} catch (Throwable ignored) {
DefaultLoader.getUIHelper().showError("A problem with your Android Support plugin setup is preventing the Azure Toolkit from functioning correctly (Retrofit2 and RxJava failed to initialize).\n" + "To fix this issue, try disabling the Android Support plugin or installing the Android SDK", "Azure Toolkit for IntelliJ");
// DefaultLoader.getUIHelper().showException("Android Support Error: isAndroid() throws " + ignored.getMessage(), ignored, "Error Android", true, false);
}
}
use of com.intellij.openapi.actionSystem.ActionManager in project intellij-elixir by KronicDeth.
the class CreateElixirModuleActionTest method checkModuleFile.
private void checkModuleFile(final String moduleName, String path) throws IOException {
ActionManager actionManager = ActionManager.getInstance();
final CreateElixirModuleAction elixirNewFileAction = (CreateElixirModuleAction) actionManager.getAction("Elixir.NewFile");
// @see https://devnet.jetbrains.com/message/5539349#5539349
VirtualFile directoryVirtualFile = myFixture.getTempDirFixture().findOrCreateDir("");
final PsiDirectory directory = myFixture.getPsiManager().findDirectory(directoryVirtualFile);
Application application = ApplicationManager.getApplication();
application.runWriteAction(new Runnable() {
@Override
public void run() {
ElixirFile file = elixirNewFileAction.createFile(moduleName, TEMPLATE_NAME, directory);
assertNotNull("Expected CreateElixirModuleAction.createFile to create an ElixirFile", file);
}
});
boolean ignoreTrailingWhitespaces = true;
myFixture.checkResultByFile(path, path, ignoreTrailingWhitespaces);
}
Aggregations