@Override public void actionPerformed(@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) return; if (!DumbService.getInstance(project).isDumb()) { super.actionPerformed(e); } else { DumbService.getInstance(project).showDumbModeNotification(IdeBundle.message("go.to.class.dumb.mode.message")); AnAction action = ActionManager.getInstance().getAction(GotoFileAction.ID); InputEvent event = ActionCommand.getInputEvent(GotoFileAction.ID); Component component = e.getData(PlatformDataKeys.CONTEXT_COMPONENT); ActionManager.getInstance().tryToExecute(action, event, component, e.getPlace(), true); } }
@Override public void actionPerformed(@Nonnull AnActionEvent e) { Project project = e.getProject(); if (project == null) return; if (!DumbService.getInstance(project).isDumb()) { super.actionPerformed(e); } else { DumbService.getInstance(project).showDumbModeNotification(IdeBundle.message("go.to.class.dumb.mode.message")); AnAction action = ActionManager.getInstance().getAction(GotoFileAction.ID); InputEvent event = ActionCommand.getInputEvent(GotoFileAction.ID); Component component = e.getData(PlatformDataKeys.CONTEXT_COMPONENT); ActionManager.getInstance().tryToExecute(action, event, component, e.getPlace(), true); } }
protected void onTemplateFinished(TemplateManager manager, Editor editor, Template template) { // format and add ; final ActionManager actionManager = ActionManagerImpl.getInstance(); final String editorCompleteStatementText = "EditorCompleteStatement"; final AnAction action = actionManager.getAction(editorCompleteStatementText); actionManager.tryToExecute(action, ActionCommand.getInputEvent(editorCompleteStatementText), null, ActionPlaces.UNKNOWN, true); }
@Override protected void onTemplateFinished(final TemplateManager manager, final Editor editor, Template template) { final ActionManager actionManager = ActionManagerImpl.getInstance(); final String editorCompleteStatementText = "IntroduceField"; final AnAction action = actionManager.getAction(editorCompleteStatementText); actionManager.tryToExecute(action, ActionCommand.getInputEvent(editorCompleteStatementText), null, ActionPlaces.UNKNOWN, true); }
@Override protected void onTemplateFinished(final TemplateManager manager, final Editor editor, Template template) { final ActionManager actionManager = ActionManagerImpl.getInstance(); final String editorCompleteStatementText = "IntroduceVariable"; final AnAction action = actionManager.getAction(editorCompleteStatementText); actionManager.tryToExecute(action, ActionCommand.getInputEvent(editorCompleteStatementText), null, ActionPlaces.UNKNOWN, true); }
private void actionPerform(String action) { ActionManager am = ActionManager.getInstance(); am.tryToExecute(am.getAction(action), ActionCommand.getInputEvent(action), panel1, "", true); }