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.
AttachType.getCustomizer() returns a JComponent, which can optionally implement Controller interface. However, both java.awt.Component and Controller define isValid() method and every class have it for a different purpose. Therefore Controller.isValid() becomes useless.
AttachType is abstract class, therefore we can solve this by adding: public Controller getController() { JComponent c = getCustomizer(); if (c instanceof Controller) { return ((Controller) c); } else { return null; } } Subclasses of AttachType could override getController() method and return a different class from JComponent. The advantage is that this is a compatible solution. The disadvantage is that the client have to create a special class to implement Controller. Thoughts?
Created attachment 63925 [details] The proposed API change.
Please review this simple API change. AttachType.getController() method was added to solve clash of isValid() methods.
For symmetry, shouldn't the same be done for BreakpointType?
Nice. Y01 Test for default behaviour of public Controller getController()? Y02 Test for ConnectorPanel really calling getController()?
Thanks for your reminder, we'll do the same change for BreakpointType.
Created attachment 70022 [details] The new API change that modifies both AttachType and BreakpointType.
I'd like to integrate this shortly, since it already went through review for AttachType and the change for BreakpointType is identical. Thanks.
Y01 typo in "intarface"
Thanks for noticing the typo, it was in the code already. I'll fix that as well. Thanks for the review, I'll integrate the change this Friday during business hours CEST.
Fixed in changeset: 102828:555019f44b55 getController() method added to AttachType and BreakpointType http://hg.netbeans.org/main/rev/555019f44b55
Integrated into 'main-golden', will be available in build *200809200201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/555019f44b55 User: mentlicher@netbeans.org Log: #138717 - getController() method added to AttachType and BreakpointType to solve clash of isValid() methods.
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.