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: | Action registration by the annotation doesn't work (PHP "comment" button stopped working in 7.3 beta 2) | ||
---|---|---|---|
Product: | editor | Reporter: | rkaiser0324 |
Component: | Actions/Menu/Toolbar | Assignee: | Miloslav Metelka <mmetelka> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ajustesen, akozlov75, charrison1988, honza1313, kenchen, mmetelka, mmirilovic, obrejla, tobypinder |
Priority: | P3 | Keywords: | REGRESSION |
Version: | 7.3 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | IDE log |
Description
rkaiser0324
2012-11-09 20:47:52 UTC
Created attachment 127511 [details]
IDE log
reproducible in Product Version: NetBeans IDE Dev (Build 201211080001) Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b13 Really strange...seems that a click on that button doesn't create PHP custom ToggleCommentAction, but pressing ctrl+shift+c works properly. Really don't know who made what change, that this stopped to work. Milo, can you help me? Svata told me, that you made some changes in Actions in last few weeks... Milo, just a note. We register our custom ToggleCommentAction using the annotation: @EditorActionRegistration(name = ExtKit.toggleCommentAction, mimeType = PHP_MIME_TYPE) and default CSL Toggle action registration is suppressed by: if (!mimeType.equals("text/x-php5")) { actions.add(new ToggleBlockCommentAction()); } in CSLEditorKit.createActions(). Maybe it can help you to understand the problem. Thanks in advance! Just another note, if I register it directly through the layer: <file name="org-netbeans-modules-php-editor-actions-ToggleBlockCommentAction.instance"/> Everything works as expected. So maybe something is wrong with annotation processing? I don't know what else can I do on my side. Milo, can you evaluate it please? Thanks in advance. Fixed. It was an error of the old EditorActionRegistrationProcessor that it honored action's constructor with (Map<String, ?> attrs) parameter though it could not call it since xml layer does not support such construction (only static method with such parameter is supported) so in fact it called default constructor anyway but it generated a direct construction instead of wrapper construction. I've modified the processor to no longer generate direct construction which mostly would not affect anything but in this particular case there's a code in ExtKit that checks for BaseAction which fails with wrapper action. http://hg.netbeans.org/jet-main/rev/2b4073efa613 *** Bug 222509 has been marked as a duplicate of this bug. *** *** Bug 222694 has been marked as a duplicate of this bug. *** *** Bug 222926 has been marked as a duplicate of this bug. *** *** Bug 223240 has been marked as a duplicate of this bug. *** So it's fixed, but how do we fix it now? Any patch? If your client code uses EditorActionRegistration and has a similar problem then please create a static method and annotate that one instead (like it's done in the fix): @EditorActionRegistration(name = ExtKit.toggleCommentAction, mimeType = PHP_MIME_TYPE) public static ToggleBlockCommentAction create(Map<String, ?> attrs) { return new ToggleBlockCommentAction(attrs); } That will fix the problem (action will be directly instantiated without a wrapper). *** Bug 224307 has been marked as a duplicate of this bug. *** *** Bug 225797 has been marked as a duplicate of this bug. *** |