Hiding nodes in Content Merge Viewer [message #1748774] |
Mon, 28 November 2016 09:18  |
Eclipse User |
|
|
|
Hi,
We are using EMF Compare and the default Structure and Content merge viewers.
In the structure viewer we also implement and contribute an IDifferenceGroupExtender to hide some nodes in our model.
We would like to do something similar in the Content Viewer, i.e., Hide a node in the left and right viewers. However it looks like it might not be possible based on the implementation of MergeViewerItem.Container.getChildren(), which delegates to the generated ItemProvider getChildrenFeatures() method, and therefore is based on containment features.
Even if I implement ITreeItemContentProvider.getChildren() in our generated itemproviders to somehow skip a node, this method won't be then called by MergeViewerItem.getChildren() anyway.
Is this correct, and are there any options for skipping a node in the default implementation of the Content Viewers?
Many thanks,
Conor
|
|
|
|
Re: Hiding nodes in Content Merge Viewer [message #1748886 is a reply to message #1748861] |
Tue, 29 November 2016 12:49   |
Eclipse User |
|
|
|
Hi Conor,
recently we refactored the TreeContentMerge viewer to make it more extensible and allow to take custom content providers. Take a look at the PapyrusTreeContentMergeViewer (it has been introduced in change 67683). It extends the default TreeContentMergeViewer and uses a custom content provider (the one from Papyrus) to determine the contents of the tree content merge viewer. You could do the same to hide elements from it.
It for sure is still a bit complicated to customize the tree content merge viewer, but this viewer is also quite a complex piece (given it has to synchronize the trees based on the match, create ghost nodes, draw lines among matching nodes, etc.). Anyway, it is possible and has been done successfully already, for instance, with the PapyursTreeContentMergeViewer. 
Hope that helps!
Best wishes,
Philip
--
Philip Langer
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
[Updated on: Tue, 29 November 2016 12:50] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.06748 seconds