Community
Participate
Working Groups
I believe CommonNavigator.java should be subclassable. I'm not sure why it is not intended to be subclassed. Many of the individual components ARE intended to be subclassed. I've read many many bugs where users are subclassing CommonNavigator anyway, to get around other bugs or deficiencies. I think this ability to subclass is valuable and important. I'm attaching a patch to allow for easier subclassing of the CommonNavigator class. By adding a protected getMemento() method, an adopter can override both the createCommonViewer and createCommonManager methods. By changing getLinkHelperService() to protected, the user can better override the createCommonActionGroup method with a subclass implementation of the CommonNavigatorActionGroup class. These slight changes would make the CommonNavigator class much easier to override in bits and pieces. I think it is important. Currently, CommonViewer *is* allowed to be subclassed, but to create a Common Navigator with just a slight tiny change to CommonViewer, I'd need to copy the entire CommonNavigator class because createCommonViewer() includes the line: aViewer.getNavigatorContentService().restoreState(memento); which requires access to the memento, which is private. Again, these tiny changes would make subclassing much easier without ruining anything.
Created attachment 114609 [details] Patch
totally agree with patch submitted! Memento should definitely be accessible by subclasses (and/or if possible for public access). Please include it for 3.4.2!
(In reply to comment #2) > Please include it for 3.4.2! This can only be considered for 3.5 (we cannot add API in 3.4.x) PW
Had to make the CommonNavigatorManager and the LinkHelperService API to do this, in addition to your patch. The CommonNavigator is now subclassible. Released to HEAD 3.5M5
*** Bug 246632 has been marked as a duplicate of this bug. ***
Verified in I20090428-0100
Removing iplog+ from bug - this indicates an IP contribution in a comment rather than a patch. http://wiki.eclipse.org/Development_Resources/Automatic_IP_Log