Bug 250198 [CommonNavigator] Allow CommonNavigator to be subclassed
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.
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigator.java
* Eclipse workbench. This class also serves as the backbone for navigational
 * viewers. The following types are used by this class to render the Common
 * Navigator:
 * <ul>
 * <li>
 * <p>
 * {@link org.eclipse.ui.navigator.CommonViewer}: The viewer that renders the
 * extensible tree. Creates and manages the lifecycle of the Navigator Content
 * Service (described below).
 * </p>
 * </li>
 * <li>
 * <p>
 * {@link org.eclipse.ui.navigator.NavigatorActionService}: Manages instances
 * of {@link org.eclipse.ui.navigator.CommonActionProvider}s provided by
 * individual extensions and content extensions.
 * </p>
 * </li>
 * <li>
 * <p>
 * {@link org.eclipse.ui.navigator.INavigatorContentService}: Manages instances
 * of Navigator Content Extensions. Instances are created as needed, and
 * disposed of upon the disposal of the Navigator Content Service.
 * </p>
 * </li>
 * </ul>
 * <p>
 * Clients are not expected to subclass CommonNavigator. Clients that wish to
 * define their own custom extensible navigator view need to specify an instance
 * of the <b>org.eclipse.ui.views</b> extension point: