Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Ignoring attributes depending on their value
Ignoring attributes depending on their value [message #1755447] Fri, 03 March 2017 12:27 Go to next message
Matteo M. is currently offline Matteo M.Friend
Messages: 40
Registered: May 2012
for my custom model comparison process, I've programmed a FeatureFilter() with its isIgnoredAttribute() method to filter a number of model attributes out of the comparison. This works just fine when you want to avoid that different values of a given model attribute (e.g., "foo") are identified as differences.

Now the question. I have a model attribute called "properties" which takes Property objects. These objects have an attribute called "name". I don't want to just ignore all the properties (hence merely adding the "properties" attribute to the list of ignored attributes), but only those for which "name" assumes a given value (e.g., "Position").

Is there a simple way to achieve this? I couldn't find any example in the docs/Faq.

Thanks in advance.
Re: Ignoring attributes depending on their value [message #1755614 is a reply to message #1755447] Mon, 06 March 2017 10:46 Go to previous message
Philip Langer is currently offline Philip LangerFriend
Messages: 98
Registered: March 2015
Location: Vienna, Austria

Hi Matteo,

do you want to remove those diffs entirely or just hide them from the UI?

If you really want to remove them entirely (and take into account that no conflicts will be detected for them, they will not be merged, etc.), you have two options to implement such a requirement: either you use an own customized diff engine, eg by replacing the diff builder, which just doesn't add a diff if you don't want one or you use a post-processor that removes the diffs that you don't want after the diffing phase.

Personally, I'd rather go for the second option. There is a slight performance penalty for the second option, since you have to re-iterate through the diff model, but it is less intrusive, easier to active de-activate using a preference, etc.

If you are only interested in removing them from the UI, you can add a diff filter (extension point

Best wishes,


Philip Langer

Get professional Eclipse developer support:

Philip Langer

Get professional Eclipse developer support:
Previous Topic:EMF Compare hide matched stereotype applications
Next Topic:can't find kind=ADD
Goto Forum:

Current Time: Tue Jun 06 03:24:44 GMT 2023

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

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

Back to the top