Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Determine if all conflicts have been resolved
Determine if all conflicts have been resolved [message #1745609] Thu, 13 October 2016 10:01 Go to next message
Vlad Acretoaie is currently offline Vlad AcretoaieFriend
Messages: 95
Registered: April 2014
Member
How can I programmatically determine if the user has solved all conflicts in the EMF Compare UI, or there are still unsolved conflicts left? I am using EMF Compare as a plugin to an RCP application.

Thanks in advance!
Vlad
Re: Determine if all conflicts have been resolved [message #1745658 is a reply to message #1745609] Fri, 14 October 2016 07:29 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

You'll have to iterate on the conflicts to see if one is still in its "unresolved" state. You can do so through code such as this:

Predicate<Conflict> unresolvedConflict = new Predicate<Conflict>() {
	public boolean apply(Conflict conflict) {
		return conflict != null && conflict.getKind() != ConflictKind.PSEUDO && Iterables.any(conflict.getDifferences(), EMFComparePredicates.hasState(DifferenceState.UNRESOLVED));
	}
};
if (!Iterables.any(comparison.getConflicts(), unresolvedConflict)) {
	<no unresolved conflicts found>
}


Laurent Goubet
Obeo
Re: Determine if all conflicts have been resolved [message #1745685 is a reply to message #1745658] Fri, 14 October 2016 13:59 Go to previous message
Vlad Acretoaie is currently offline Vlad AcretoaieFriend
Messages: 95
Registered: April 2014
Member
Hi Laurent,

Thank you for the help. That was exactly what I was looking for.

Cheers,
Vlad
Previous Topic:Using EMFResourceMappingMerger in core
Next Topic:using EMF Compare to compare Comparison objects
Goto Forum:
  


Current Time: Tue Nov 05 07:52:26 GMT 2024

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

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

Back to the top