Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 250198 - [CommonNavigator] Allow CommonNavigator to be subclassed
Summary: [CommonNavigator] Allow CommonNavigator to be subclassed
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Francis Upton IV CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 246632 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-08 18:43 EDT by Rob Stryker CLA
Modified: 2009-06-01 09:56 EDT (History)
5 users (show)

See Also:


Attachments
Patch (1.34 KB, patch)
2008-10-08 18:45 EDT, Rob Stryker CLA
francisu: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Stryker CLA 2008-10-08 18:43:28 EDT
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.
Comment 1 Rob Stryker CLA 2008-10-08 18:45:25 EDT
Created attachment 114609 [details]
Patch
Comment 2 Andre Ribeiro CLA 2009-01-05 06:17:07 EST
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!
Comment 3 Paul Webster CLA 2009-01-05 07:40:48 EST
(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
Comment 4 Francis Upton IV CLA 2009-01-15 02:44:16 EST
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
Comment 5 Francis Upton IV CLA 2009-01-15 04:21:11 EST
*** Bug 246632 has been marked as a duplicate of this bug. ***
Comment 6 Francis Upton IV CLA 2009-04-28 13:55:16 EDT
Verified in I20090428-0100
Comment 7 John Arthorne CLA 2009-06-01 09:56:27 EDT
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