Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Best way to combine two attribute changes into a high-level atomic one
Best way to combine two attribute changes into a high-level atomic one [message #1281432] Mon, 31 March 2014 22:14 Go to next message
Leonid Ripeynih is currently offline Leonid RipeynihFriend
Messages: 150
Registered: February 2012
Senior Member
Hi, all!

We're trying to provider custom merge UI for our model. We have a visual form model, with grid layout, where components have a layout position of x and y.

During merge, we want this changes to x and y to be atomic, because, accepting only one of them can lead to a broken form. (component overlap, e.t.c)

For now, we have implemented a post-processor, which makes one change require each other, so when one is merged, the other is merge automatically, and it works fine.

Now i wander, how to combine this change into an atomic one (say, 'Layout Position Changed')? I've read developer's guide, and it said that we should create a refinement change. But there is not much after it. I've took a brief look into a UML2 support, and found out that it has it's extension model to Compare model.

So, the steps looks like that to me:

1. Create an extension model, create a 'PositionChange', extend it from Diff?
2. Create an Extension Factory, here create a position changes, refined by x,y changes of corresponding position?
3. Create an Accessor Factory to correctly display that PositionChange in the UI?

I've tried it, and what confuses me now, is that x,y changes are still displayed, even when a PositionChange is correctly refined by them, and have the same parent.

Should I take any additional steps to hide them from the structure viewer, and show only the composite change?

Thanks in advance.
Re: Best way to combine two attribute changes into a high-level atomic one [message #1282520 is a reply to message #1281432] Wed, 02 April 2014 12:19 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1895
Registered: July 2009
Senior Member
Hi Leonid,

Seems to me like you took all the necessary steps already as far as the comparison is concerned : since x and y must be accepted at the same time, making one require the other is the good course of action.

Refining them afterwards is more of an UI thing, and the only thing you seem to be missing is a filter to hide the details of your refining diffs to the user. To that end, you might want to look at what we did in and the related entry in the plugin.xml of that plugin to extend the extension point (a little more on this in the documentation). Once contributed, filters are available to the user from the compare UI (see also the User documentation entry).

Please let us know if this isn't enough to cover your use case.

Laurent Goubet
Previous Topic:How to attach itemproviders to EMF Compare UI?
Next Topic:[Bug?] NPE during comparison of EObjects
Goto Forum:

Current Time: Sat Oct 23 09:02:30 GMT 2021

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

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

Back to the top