How to trigger IntelliJ actions from plugin.

Hi I'm hoping that you brigth guys can help me out.
I'm developing a litte tool plugin for IntelliJ IDEA and I need to trigger som intelliJ actions from my code.
The action that I want to be able to trigger from my code is to upload a given file to the default server (tools -> deployment -> uplod to default server), so I need a method like this:

private void uploadToDefaultServer(VirtualFile v){
     // Do stuff
}

As I have understood "deploy to server" is only avalible in Ultimate edition and not in Community edition, is this a problem?

I really hope that you guys can help me figure out how to achive this functionality.
Thanx for the efford in advance.

// Toke

2 comments
Comment actions Permalink

Hi i want to know this too.
I already read about this here:
http://devnet.jetbrains.com/thread/268927

But dont get it how to use this code.

        new AnActionEvent(null, DataManager.getInstance().getDataContext(),                       ActionPlaces.UNKNOWN, CheckboxAction.this.getTemplatePresentation(),                       ActionManager.getInstance(), 0);



What should the 4. argument should be?

EDIT:

worked fine with this:

ActionManager am = ActionManager.getInstance();         am.getAction("yourActionID").actionPerformed(new AnActionEvent(null, DataManager.getInstance().getDataContext(),                                                                            ActionPlaces.UNKNOWN, new Presentation(),                                                                            ActionManager.getInstance(), 0));

0
Comment actions Permalink

I write a plugin, I want to trigger when user toggles bookmark, but it not work.

 

 

0

Please sign in to leave a comment.