Bug 235768 - [CommonNavigator] Decouple CommonNavigator from CommonViewer
Summary: [CommonNavigator] Decouple CommonNavigator from CommonViewer
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Francis Upton IV CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-05 04:02 EDT by David Sciamma CLA
Modified: 2019-09-06 16:14 EDT (History)
5 users (show)

See Also:


Attachments
Patch to enable the use of CNF in an Outline (62.77 KB, patch)
2008-06-17 12:48 EDT, David Sciamma CLA
no flags Details | Diff
Updated patch using good format (42.20 KB, patch)
2008-06-19 11:40 EDT, David Sciamma CLA
no flags Details | Diff
Patch supporting CNF in a outline (supporting menu extensions) (91.94 KB, patch)
2008-07-02 12:19 EDT, David Sciamma CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Sciamma CLA 2008-06-05 04:02:47 EDT
It could be interesting to be able to use the extensibility of the CNF in an Outline.
Currently it is to deeply linked with the CommonNavigator View.
Comment 1 Francis Upton IV CLA 2008-06-06 10:16:52 EDT
Can you elaborate on this a little more?  Exactly what would you like the CNF to do in an outline view?
Comment 2 David Sciamma CLA 2008-06-06 11:24:42 EDT
We are interested in an extensible outline. Currently we are developing editors (graphical or forms) for EMF models and the outline is used to provide a treeview of the current edited model.

First, models can be extensible so we want to extend the outline to reflect this model extension.

But we can also imagine another scenario where several kind of treeview can be defined for a model (just like in the Team Synchronize view) and then the architecture of the CNF is perfect for this usecase.

A solution could be to replace all the dependencies on CommonNavigator by an interface.
This interface will implemented by CommonNavigator and CommonNavigatorPage (the IContentOutlinePage using CNF)
Currently, the framework is not too dependent on CommonNavigator. Here are the methods from CommonNavigator used by the framework :
----- CommonNavigator methods ----
CommonNavigator.IS_LINKING_ENABLED_PROPERTY
getCommonViewer()
getNavigatorContentService()
selectReveal(newSelection)
isLinkingEnabled()
setLinkingEnabled()
----- IViewPart methods ----
addPropertyListener()
removePropertyListener()
getSite()
getTitle()
getViewSite().getActionBars()

As you can see, only 5 IViewPart methods are used and can be extracted to an interface.
Comment 3 Francis Upton IV CLA 2008-06-06 12:14:01 EDT
Ok, it sounds like you want an ICommonNavigator interface or something like that so that you can provide your own implementation.  But then how are you using the CommonNavigator?  (I'm sure I'm missing the point here, please try and help me understand).

When you talk about outline, you mean a specific outline implementation?  If so, can you give me the class you are talking about.  Do you mean that you want to decouple the current outline implementation from the CommonNavigator so you can provide your own?

Can you accomplish this by subclassing the CommonNavigator (I know that subclassing is not "allowed" by the API definition, but I'm asking more to find out what you are wanting)?
Comment 4 David Sciamma CLA 2008-06-06 12:30:38 EDT
Creating an interface ICommonNavigator would be perfect. Then we can create an implementation extending ICommonNavigator and IContentOutlinePage.

I am working on a prototype to test if it is possible and perhaps to initialize a patch if the community is interested.
Comment 5 Francis Upton IV CLA 2008-06-06 12:34:47 EDT
(In reply to comment #4)
> Creating an interface ICommonNavigator would be perfect. Then we can create an
> implementation extending ICommonNavigator and IContentOutlinePage.
> 
> I am working on a prototype to test if it is possible and perhaps to initialize
> a patch if the community is interested.
> 

Ok, I would welcome a patch for this.  Thanks.

Comment 6 David Sciamma CLA 2008-06-17 12:48:03 EDT
Created attachment 105184 [details]
Patch to enable the use of CNF in an Outline

This patch extracts generic methods from CommonNavigator to a ICommonNavigator interface and proposed a default implementation of this interface for outlines based on IContentOutlinePage.
Modified files are all in the org.eclipse.ui.navigator project.

This is a first implementation I've done to validate the concept. I currently extend the CommonNavigatorOutline to create a generic extensible outline for EMF models.
Comment 7 Francis Upton IV CLA 2008-06-19 11:07:55 EDT
(In reply to comment #6)
> Created an attachment (id=105184) [details]
> Patch to enable the use of CNF in an Outline
> 
> This patch extracts generic methods from CommonNavigator to a ICommonNavigator
> interface and proposed a default implementation of this interface for outlines
> based on IContentOutlinePage.
> Modified files are all in the org.eclipse.ui.navigator project.
> 
> This is a first implementation I've done to validate the concept. I currently
> extend the CommonNavigatorOutline to create a generic extensible outline for
> EMF models.
> 

Your patch has quite a bit of formatting changes which makes it difficult to determine the substantive changes.  Can you provide a patch with no formatting changes so the differences only show what actually changed? 

Comment 8 David Sciamma CLA 2008-06-19 11:40:59 EDT
Created attachment 105426 [details]
Updated patch using good format

I think it will be easier with this one...
Sorry but what is your formatting options ? I cannot find the exact configuration.
Comment 9 Francis Upton IV CLA 2008-06-19 15:36:35 EDT
(In reply to comment #8)
> Created an attachment (id=105426) [details]
> Updated patch using good format
> 
> I think it will be easier with this one...
> Sorry but what is your formatting options ? I cannot find the exact
> configuration.
> 
Generally the default eclipse options are used for formatting, though some projects tend to vary a bit from that sometimes.  I'm not sure about the CNF code.

Thanks for the patch, it's going to take me a little while to get to this, as I am only a part-time committer and need to devote time to bugs right now.  Feel free to ping me (by commenting on the bug report) if you have not heard anything in a while.
Comment 10 David Sciamma CLA 2008-07-02 12:19:11 EDT
Created attachment 106327 [details]
Patch supporting CNF in a outline (supporting menu extensions)

I forgot to refactor some classes to support popup menu extensions. The new patch fixes this and works well but I don't like the way it is currently done. So I will try to propose another solution soon.
Comment 11 David Sciamma CLA 2008-08-20 10:16:18 EDT
Do you plan to integrate this kind of feature in 3.5 ?
Do I need to integrate changes in the patch ?

Because we really need this behavior to create customizable and extensible outlines.
We created a first example of use in the Ecore Tools project and we would be interested to switch from the basic outline to this new extensible CNF-based outline.
Comment 12 Francis Upton IV CLA 2008-08-20 10:19:11 EDT
I have not looked at this yet, and probably won't for a couple of weeks.  Assuming I agree it should be done at all (I have no opinion on it right now), it can certainly be done in the 3.5 timeframe.  The reason for the delay is I'm focusing on 3.4.1 issues and bugs right now.  Thanks for your patch and your patience, and feel free to ping me in a couple of weeks if you like.
Comment 13 Jacques LESCOT CLA 2008-10-06 12:35:00 EDT
Do you have some time to look at this patch. This is a blocking point for me, as I wish to contribute an outline based on the CNF for the upcoming Eclipse Papyrus project. I would like to avoid duplicating code and I am so waiting for this feature to be implemented.
Comment 14 David Sciamma CLA 2008-11-03 09:47:18 EST
Any news ?
Comment 15 Francis Upton IV CLA 2009-02-11 19:13:36 EST
I like this and I want to get it into 3.5, which means it needs to go in soon, and into M6.   However, the patch is much larger than 250 lines, and something bigger than 250 lines needs to get all kinds of approval.

So here is what I would like to do to get this in:

1) You should explain the steps at making the change based on your patch, but excluding your outline implementation.  E.g.

 a) create ICommonNavigator as extracted from CommonNavigator
 b) any special methods you needed to add to ICommonNavigator
 c) any extra hooks you needed in other classes
  (you don't need to explain the mechanical stuff about extracting the interface, just the odd things you found -- including the issues about
the menu extensions).

If you can do this in the next week or so, I will check it in shortly after that.


2) File a different bug report offering the outline implementation.  You can create a patch for that once the work on this bug report has completed.  I assume your outline implementation will be < 250 lines.

 
Comment 16 Jon Barrilleaux CLA 2009-02-12 13:11:47 EST
It seems that in trying to get CommonNavigator functionality to work as a page for use in a PageBookView, I've been pursuing this issue also.

See Bug 264738. Attached are the classes CommonViewerPageView and CommonViewerManager, which is derived from NavigatorViewManager.  I have not thoroughly tested all of this it seems to do the trick.
Comment 17 Francis Upton IV CLA 2009-03-07 03:23:07 EST
Unfortunately the CNF now depends on the CommonViewer to store a pointer to the NavigatorContentExtension (it actually stores this in the TreeItem).  I can't think of an straightforwards way to not have this dependency, given that you are not supposed to subclass the views.

So I don't think we can do this.

If you disagree and have a proposal, please reopen this.
Comment 18 Francis Upton IV CLA 2010-03-18 12:05:56 EDT
Others have been requesting this and we have done some abstraction in the Viewer area for having the viewer remember the CNF content. So I think we should reconsider this.
Comment 19 Eclipse Webmaster CLA 2019-09-06 16:14:24 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.