Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Post processing matches breaks navigation to differences(If I remove levels of Matches in postprocessing, navigation is broken)
Post processing matches breaks navigation to differences [message #1386082] Fri, 13 June 2014 11:22
Mattias Backman is currently offline Mattias BackmanFriend
Messages: 4
Registered: June 2014
Location: Sweden
Junior Member

This topic is very much related to my other question,, in case you wonder about the similarities.

I have written a post processor to remove some container objects from the tree of matches. It is successful in that in the top window I can see the model without the unwanted levels.

The problem is that doing so breaks the behavior of the bottom window. Double-clicking on a diff in the top window no longer scrolls to that diff in the bottom window.

Also, in the bottom window the entire model tree is displayed, disregarding the changes that are in effect in the top window.

Is there something more I need to process to get the same view in the bottom as well as keeping the navigation intact?

		class CustomPostProcessor implements IPostProcessor {

			public void postMatch(Comparison comparison, Monitor monitor) {
				EList<Match> matches = comparison.getMatches();

				EList<Match> processedMatches = removeListElements(matches);

			private EList<Match> removeListElements(EList<Match> originalMatches) {
				EList<Match> newMatches = new BasicEList<Match>();
				for (Match m : originalMatches) {

					if (m.getLeft() instanceof DomainRTVariableSetupList || m.getRight() instanceof DomainRTVariableSetupList) {
					EList<Match> submatches = m.getSubmatches();
					if (!submatches.isEmpty()) {
						EList<Match> originalSubmatches = m.getSubmatches();
						EList<Match> newSubmatches = removeListElements(originalSubmatches);
				return newMatches;

			public void postDiff(Comparison comparison, Monitor monitor) {
				// TODO Auto-generated method stub

			public void postRequirements(Comparison comparison, Monitor monitor) {
				// TODO Auto-generated method stub

			public void postEquivalences(Comparison comparison, Monitor monitor) {
				// TODO Auto-generated method stub

			public void postConflicts(Comparison comparison, Monitor monitor) {
				// TODO Auto-generated method stub

			public void postComparison(Comparison comparison, Monitor monitor) {
				// TODO Auto-generated method stub
		IPostProcessor customPostProcessor = new CustomPostProcessor();
		IPostProcessor.Descriptor descriptor = new BasicPostProcessorDescriptorImpl(customPostProcessor, Pattern.compile(".*"), null);

		PostProcessorDescriptorRegistryImpl<String> registry = new PostProcessorDescriptorRegistryImpl<String>();
		registry.put(CustomPostProcessor.class.getName(), descriptor);
		result = EMFCompare.builder().setPostProcessorRegistry(registry).build().compare(scope);
		return result;

Previous Topic:Plugin vs. standalone configuration of EMF Compare
Next Topic:Accessing elements properties in a EMF Compare Diff Model
Goto Forum:

Current Time: Wed Jun 29 09:41:48 GMT 2022

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

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

Back to the top