[platform-dev] Use my action in getPreferredAction?

  • From: "Mvek" < >
  • To:
  • Subject: [platform-dev] Use my action in getPreferredAction?
  • Date: Thu, 26 Apr 2012 22:33:24 +0000

What is the best way to use my action created for example via wizard in IDE 
as the preferredAction (after double click on node)?

I can add my action with annotations, I just use the attribute category, for 

@ActionID(category = "VNode",...

and then use it:
  public Action[] getActions(boolean context) {
    List<Action> a = (List<Action>) Utilities.actionsForPath("Actions/VNode");
    return a.toArray(
            new Action[a.size()]);

But should I do similar thing, but then get the first item from the 
collection or array and return it in the getPreferredAction method?
Or is there a way, how to get the particular action, not all for some path?
Is there for example a way, to use it via the annotation property key? Like 
getActionMap().put("MyAction".... ?

[platform-dev] Use my action in getPreferredAction?

Mvek 04/26/2012

Project Features

Project Links

About this Project

Platform was started in November 2009, is owned by Antonin Nebuzelsky, and has 149 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
Please Confirm