This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 205798

Summary: API to retrieve a specific action by ID
Product: platform Reporter: Jesse Glick <jglick>
Component: ActionsAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: normal CC: apireviews
Priority: P3 Keywords: API, API_REVIEW_FAST
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 169338, 207003    
Bug Blocks: 183794    
Attachments: Proposed patch

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'
Changeset: http://hg.netbeans.org/main-golden/rev/f5e9614e5a7d
User: Jesse Glick <jglick@netbeans.org>
Log: #205798: API to retrieve a specific action by ID.