Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Adding extra nodes to the Content Merge Viewer
Adding extra nodes to the Content Merge Viewer [message #1751655] Thu, 12 January 2017 09:56 Go to next message
Conor O'Mahony is currently offline Conor O'MahonyFriend
Messages: 27
Registered: August 2016
Junior Member
Hi all,

By following the PapyrusTreeContentMergeViewer implementation we were able to filter out some elements from the viewer, by applying a filter in the getChildren() method in our extension of TreeContentMergeViewerItemContentProvider (Thanks Philip - see https://www.eclipse.org/forums/index.php/t/1082766/ ).

Now we are wondering about the following, or if anyone has any pointers on doing this - how would it be possible to add in some extra children into the Content Viewer, that are not part of the original models (and resulting comparison)?

The case in our application is as follows -
We have an EMF model for a "Block", which has a "input" feature (a list of "Input" objects)
The EMF comparison compares 2 Blocks, and correctly detects the differences between the Inputs that are contained on the block.
But we have further "static" Block Inputs that are not persisted to the Block model (these are derived elsewhere), and we want to add these to our Content Merge Viewer - they are not different between blocks but form part of the "Content" of each block from the user's perspective.

e.g - something like the following:

Static Input list: Input0

Block_A contains Input1
Block_B contains Input2

Result of comparison - e.g., Input1 is added, Input2 is deleted

But Content Merge Viewer should show

Left
+ Block_A
  + Input0
  + Input1


Right
+ Block_B
  + Input0
  + Input2



Re: Adding extra nodes to the Content Merge Viewer [message #1751732 is a reply to message #1751655] Fri, 13 January 2017 08:38 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1843
Registered: July 2009
Senior Member
Hi Conor,

The same approach you used to "hide" elements should work to "show" additional ones since you are directly in the content provider... Could you develop on the changes you've made and why it won't work to display additional data? From my understanding if you use a custom content provider that adds these static inputs to your block they should be shown on the viewer?

Laurent Goubet
Obeo
Re: Adding extra nodes to the Content Merge Viewer [message #1751742 is a reply to message #1751732] Fri, 13 January 2017 11:42 Go to previous message
Conor O'Mahony is currently offline Conor O'MahonyFriend
Messages: 27
Registered: August 2016
Junior Member
Hi Laurent,

Thanks for the reply.

I did develop further the changes I was making yesterday - a problem I had then was when I was adding an "Input" object directly to the array in the getChildren() method in the content provider - this was causing exceptions in the TreeContentMergeViewer, as it assumes that any items are IMergeViewerItems.

By wrapping the Input objects in my own implementation of "IMergeViewerItem", they now appear in the tree.

The thing that isn't working now is selection in the merge content viewer, e.g. selecting "Input0" on the LHS viewer does not select the corresponding "Input0" on the RHS - but I will look further at this.


Previous Topic:EMF compare implementation of INavigatable.hasChange()
Next Topic:New UUIDs for non-conflicting Addition changes after merge
Goto Forum:
  


Current Time: Fri Jan 19 06:03:55 GMT 2018

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

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