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 237033 - Generated action annotation not usable (compile time error)
Summary: Generated action annotation not usable (compile time error)
Status: RESOLVED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: Actions (show other bugs)
Version: 7.4
Hardware: PC Mac OS X
: P1 normal (vote)
Assignee: Jan Peska
URL:
Keywords: PLATFORM
Depends on:
Blocks:
 
Reported: 2013-10-11 13:24 UTC by lanthale
Modified: 2013-10-14 07:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lanthale 2013-10-11 13:24:37 UTC
I have a RCP application created originally on NB 6.9 which overrides the "Toolbar.Presenter" to replace the tool bar with a version that can display text under each icon. Now on NB 7.4 adding new modules is a high manual work because all wizards are generating annotation and the annotation are not working.


Steps to produce the problem:
1. Generate a simple RCP application
2. Generate a module with the wizard
3. Generate a TopComponent with the wizard
4. Generate a Action (menu + keyboard) for that module
5. Change the first line of the action class to the following:
"public final class ShowAnalyseAction implements ActionListener, Presenter.Toolbar"

The important part is if the Presenter.Toolbar is implemented a compile time error occurs and the class can no longer be compiled.

The workaround for my was to delete all annotation and create a layer.xml file by hand.
Comment 1 markiewb 2013-10-13 16:18:53 UTC
Which compile error? Do you mean "xxx is not assignable to javax.swing.Action"?

Use 
"public final class ShowAnalyseAction extends AbstractAction implements Presenter.Toolbar"

instead of

"public final class ShowAnalyseAction implements ActionListener, Presenter.Toolbar"

See https://blogs.oracle.com/geertjan/entry/presenter_toolbar_meets_action_annotation

That's not even a P1. @Jan: Resolve as invalid?
Comment 2 Jan Peska 2013-10-14 07:18:18 UTC
(In reply to markiewb from comment #1)
> Which compile error? Do you mean "xxx is not assignable to
> javax.swing.Action"?
> 
> Use 
> "public final class ShowAnalyseAction extends AbstractAction implements
> Presenter.Toolbar"
> 
> instead of
> 
> "public final class ShowAnalyseAction implements ActionListener,
> Presenter.Toolbar"
> 
> See
> https://blogs.oracle.com/geertjan/entry/
> presenter_toolbar_meets_action_annotation
> 
> That's not even a P1. @Jan: Resolve as invalid?

I agree, lanthale please try this out and reopen if there is another problem with proposed solution. 

markiewb, thank you for solving this.

PS. if you have a problem to see the blog entry try to google the URL and then open it.