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 224007 - NetBeans should support Mutil MimeResovler.Resigeration annotations in the same class
Summary: NetBeans should support Mutil MimeResovler.Resigeration annotations in the sa...
Status: RESOLVED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.2.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on: 191777
Blocks:
  Show dependency tree
 
Reported: 2012-12-19 03:24 UTC by hantsy
Modified: 2012-12-19 13:11 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hantsy 2012-12-19 03:24:47 UTC
I tried to update some old xml layer config to the Annotation config in my plugin(https://github.com/hantsy/click4nb).

for example, 

@NbBundle.Messages({"CLICK_RESOVLVER_NAME=Click Config File"})
@MIMEResolver.Registration(
   displayName = "#CLICK_RESOVLVER_NAME",
resource = "ClickResolver.xml")
public class ClickMimeResolverRegistration {
}

But it did not support mutil @MIMEResolver.Registration in one class, I have two Resolvers in this project.

I have to create another one in the project.

@NbBundle.Messages({
    "CLICKMENU_RESOVLVER_NAME=Click Menu Config"})
@MIMEResolver.Registration(
   displayName = "#CLICKMENU_RESOVLVER_NAME",
resource = "MenuResolver.xml")
public class MemuMimeResolverRegistration {
}


why not supports like this:
@NbBundle.Messages({
    "CLICKMENU_RESOVLVER_NAME=Click Menu Config"})
@MIMEResolver.Registrations({
     @MIMEResolver.Registration(
         displayName = "#CLICKMENU_RESOVLVER_NAME",
         resource = "MenuResolver.xml"),
     @MIMEResolver.Registration(
         displayName = "#CLICK_RESOVLVER_NAME",
         resource = "ClickResolver.xml")
)
public class MimeResolverRegistration {
}

The original layer.xml supports mutil resovlers in the "MIMEResovler" nodes, why one class only support one @MIMEResolver.Registration.


BTW: personally, I am disappeared when I use the newest Annotation to config plugin, obviously this  MimeResolverRegistration is no use at all(I have to create a empty class to register????), and the annotation @MIMEResolver.Registration is only use for translate info into xml at compiling time.

This did not improve any programming experience.

I hope Netbeans can provide rumtime annotations to improve the programming model, such JSR330, it is supported in Eclipse e4.x, the NetBeans team rejected my  issues directly about this.
Comment 1 Jaroslav Tulach 2012-12-19 13:05:19 UTC
When you mix multiple issues into one report, you risk the chance of not being addressed all.

I understand this report as an enhancement request to allow multiple MIMEResolver.Registration annotations in a single class. I've changed the type of the issue accordingly.
Comment 2 Jaroslav Tulach 2012-12-19 13:11:53 UTC
Please note that the target of the annotation does not have to be only class, it can be any element. For example http://hg.netbeans.org/ergonomics/file/default/cnd.source/src/org/netbeans/modules/cnd/source/CCDataObject.java
is using this "feature". 

Thus I have a feeling your use case is relatively well supported. Marking as works for me.

In case you insist on the "plural annotation" I am sure you know the rules: create patch and use the API review process.