how to invoke predefined actions?

There are lots of predefined 'actions' as were showed in the keymap setting panel. What should I do to trigger them in my plugin?

4 comments
Comment actions Permalink

got the same problem .. any ideas?

0
Comment actions Permalink

Hi,
Personally I'm using it like this:

public void actionPerformed(AnActionEvent e) {
ActionManager.getInstance().getAction("ShowIntentionActions").actionPerformed(e);
}


Where code of action can be found in ]]>\doc\openapi\actionmanager.xml

TIA,
Dmitry

0
Comment actions Permalink

thanks so far, but I need to call 'HighlightUsagesInFile' from a mouseEvent in my ToolWindow and I cant find a way to provide it with a correct AnActionEvent. I tried to use the AnActionEvent of the Action that fills the ToolWindow but I got the exception 'cannot share data context between Swing events' and the EDITOR has changed too.

0
Comment actions Permalink

Hi,
May something like this? Just idea.

EditorActionManager eam = EditorActionManager.getInstance();
EditorActionHandler editorHandler = eam.getActionHandler("HighlightUsagesInFile");
editorHandler.execute(, ); And data context fill according to: ]]>/doc/openapi/javadoc/com/intellij/openapi/actionSystem/DataConstants.html

May be you may look at NoSelectionCopyKiller plugin this snippet inspired by it.

TIA,
Dmitr

0

Please sign in to leave a comment.