com.intellij.openapi.ui.playback.commands.ActionCommand Java Examples

The following examples show how to use com.intellij.openapi.ui.playback.commands.ActionCommand. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractRichStringBasedPostfixTemplate.java    From HakunaMatataIntelliJPlugin with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #2
Source File: FindViewByIdFieldTemplate.java    From android-postfix-plugin with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #3
Source File: FindViewByIdVariableTemplate.java    From android-postfix-plugin with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #4
Source File: AbstractRichStringBasedPostfixTemplate.java    From android-postfix-plugin with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #5
Source File: GotoClassAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
static void invokeGoToFile(@Nonnull Project project, @Nonnull AnActionEvent e) {
  String actionTitle = StringUtil.trimEnd(ObjectUtils.notNull(e.getPresentation().getText(), GotoClassPresentationUpdater.getActionTitle()), "...");
  String message = IdeBundle.message("go.to.class.dumb.mode.message", actionTitle);
  DumbService.getInstance(project).showDumbModeNotification(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);
}
 
Example #6
Source File: WindowTool.java    From ADB-Duang with MIT License 4 votes vote down vote up
private void actionPerform(String action) {
    ActionManager am = ActionManager.getInstance();
    am.tryToExecute(am.getAction(action),
            ActionCommand.getInputEvent(action), panel1, "", true);

}