Jump to: navigation, search

EMF Compare/Specifications/PreTestMerge


Evolution Specification: Pre test merge

Current status is ABANDONED


Summary: Provide a new IMerger interface to avoid partial merge action.


EMFCompare is more and more configurable. It is why EMFCompare need to more and more robust to handle incoherent configuration. With Enable/Disable Merger feature, a comparison can be launched in the workbench with missing mergers. The framework shall prevent from running merge action if not all requirement for this merge are fetched.

Detailed Specification

  • EMFCompare shall not launch merge action if all preconditions are not met.
    • It shall prevent merge action if one or more IMerger are missing to complete merge action.
  • It shall not prevent to merge to one side if the oppsite one can not be merged.
  • User interface shall notify the user when a merge action can not be performed
    • In the EMFCompare UI. The merge button shall be disabled if all selected differences are not mergeable
    • A label shall be provided on a difference in the StructureMergeViewer if it can not me merged. This notification shall appear depending of the preview mode selected (RightToLeft, LeftToRight, Accept and Reject)



Provide a new IMerger sub-interface that provides methods to test if the merge is executable between each side regarding the preconditions of the merge.

IMerger2 definition:

 * Copyright (c) 2014 Obeo.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * Contributors:
 *     Obeo - initial API and implementation
package org.eclipse.emf.compare.merge;

import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Diff;

 * IMeger providing methods to check that preconditions are met to execute a merge action.
 * @author <a href="mailto:arthur.daussy@obeo.fr">Arthur Daussy</a>
public interface IMerger2 extends IMerger {

	 * Return true if all preconditions are met to copy from right to left.
	 * @param target
	 *            The difference to test.
	 * @param monitor
	 *            Monitor.
	 * @return True if can copy from right to left.
	boolean canCopyRightToLeft(Diff target,Monitor monitor);

	 * Return true if all preconditions are met to copy from left to right.
	 * @param target
	 *            The difference to test.
	 * @param monitor
	 *            Monitor.
	 * @return True if can copy from left to right.
	boolean canCopyLeftToRight(Diff target, Monitor monitor);