Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 205798 - API to retrieve a specific action by ID
API to retrieve a specific action by ID
Product: platform
Classification: Unclassified
Component: Actions
All All
: P3 (vote)
: 7.2
Assigned To: Jesse Glick
Depends on: 169338 207003
Blocks: 183794
  Show dependency treegraph
Reported: 2011-12-01 17:58 UTC by Jesse Glick
Modified: 2012-01-07 16:21 UTC (History)
1 user (show)

See Also:

Proposed patch (18.83 KB, patch)
2011-12-28 23:36 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-12-01 17:58:44 UTC
Given a known

@ActionID(category=Constants.CATEGORY, id=Constants.ID) ...

it is often useful to load that Action for some sort of programmatic presentation. Currently you need to do

FileUtil.getConfigObject("Actions/" + Constants.CATEGORY + "/" + Constants.ID.replace('.', '-') + ".instance", Action.class)

which is awkward. This should rather be a utility method in Actions.
Comment 1 Jesse Glick 2011-12-28 23:36:40 UTC
Created attachment 114514 [details]
Proposed patch
Comment 2 Jesse Glick 2011-12-28 23:37:25 UTC
Please review.
Comment 3 Jesse Glick 2012-01-06 16:18:31 UTC
Employed the new method in a bunch more places. Also changed it to throw IAE when the corresponding @ActionID would have been rejected during compilation, to defend against likely mistakes such as using '-' as a package separator. core-main #f5e9614e5a7d
Comment 4 Quality Engineering 2012-01-07 16:21:45 UTC
Integrated into 'main-golden'
User: Jesse Glick <>
Log: #205798: API to retrieve a specific action by ID.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo