Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Hiding nodes in Content Merge Viewer(Hiding nodes in the Content Merge Viewer, implementation of MergeViewerItem.getChildren())
Hiding nodes in Content Merge Viewer [message #1748774] Mon, 28 November 2016 14:18 Go to next message
Conor O'Mahony is currently offline Conor O'MahonyFriend
Messages: 27
Registered: August 2016
Junior Member
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 #1748861 is a reply to message #1748774] Tue, 29 November 2016 12:44 Go to previous messageGo to next message
Conor O'Mahony is currently offline Conor O'MahonyFriend
Messages: 27
Registered: August 2016
Junior Member
In addition to the above -
it looks like I may be able to get around this by extending TreeContentMergeViewer and TreeContentMergeViewerItemContentProvider and contributing my own content merge viewer creator via the extension point.
Then I can reimplement the interface for ITreeContentProvider to provide content for the Merge Viewer - although I am not sure if this would cause other problems?

Re: Hiding nodes in Content Merge Viewer [message #1748886 is a reply to message #1748861] Tue, 29 November 2016 17:49 Go to previous messageGo to next message
Philip Langer is currently offline Philip LangerFriend
Messages: 86
Registered: March 2015
Location: Vienna, Austria
Member

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. Smile

Hope that helps!

Best wishes,

Philip

--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/

[Updated on: Tue, 29 November 2016 17:50]

Report message to a moderator

Re: Hiding nodes in Content Merge Viewer [message #1749146 is a reply to message #1748886] Fri, 02 December 2016 10:14 Go to previous message
Conor O'Mahony is currently offline Conor O'MahonyFriend
Messages: 27
Registered: August 2016
Junior Member
Hi Philip,

Thanks for your help, we will have a look at the Papyrus Implementation of the content providers.

Best regards,
Conor
Previous Topic:Determine if two Ecore xmi models are equal
Next Topic:EMF Compare: Start over!?
Goto Forum:
  


Current Time: Wed Nov 14 09:53:17 GMT 2018

Powered by FUDForum. Page generated in 0.02285 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top