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.
Summary: | Annotation to register separators | ||
---|---|---|---|
Product: | platform | Reporter: | Jaroslav Tulach <jtulach> |
Component: | Actions | Assignee: | Jaroslav Tulach <jtulach> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apireviews, jglick |
Priority: | P3 | ||
Version: | 7.0 | ||
Hardware: | Other | ||
OS: | Linux | ||
Issue Type: | TASK | Exception Reporter: | |
Bug Depends on: | 189558, 193263 | ||
Bug Blocks: | |||
Attachments: | separatorBefore() and separatorAfter() |
Description
Jaroslav Tulach
2010-08-25 14:00:05 UTC
(In reply to comment #0) > String group() default "none"; > > If there is a sequence of actions after each other with same group they would > have no separator among themselves. But this is slightly tricky, the primary > sorting criteria should naturally be the group, the position shall be > secondary. This is hard to do compatibly. Also hard to make work with Lookup-based menu interpretation such as Actions.forPath; currently the position attributes simply order the lookup result, but a group ID would complicate this system. > Last option I can think of is to provide @ActionReference with > > int[] separators() default {} I would actually suggest int separatorBefore() default Integer.MAX_VALUE; int separatorAfter() default Integer.MAX_VALUE; where the processor verifies that these attrs, if set, are less (resp. greater) than position(), which must in that case also be set. Basically matches what the wizard already generates, and the basename of the separator instance file can be taken from the reference name, e.g. com-mycom-MyAction-separatorBefore.instance OK, as you wish my lord. Created attachment 101737 [details]
separatorBefore() and separatorAfter()
I'll integrate the change over weekend. core-main#960db7e78a68 Integrated into 'main-golden', will be available in build *201009050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/960db7e78a68 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #189848: ActionReference.separatorBefore and After Integrated into 'main-golden', will be available in build *201009180000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/d8cc05b87cd5 User: Jesse Glick <jglick@netbeans.org> Log: #189848: again, Integer.MAX_VALUE is the customary default value for "no specified position". -1 is a legal position value between -2 and 0. |