1 /*******************************************************************************
2 * Copyright (c) 2014 Obeo.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Obeo - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.emf
.compare
.merge
;
15 import org
.eclipse
.emf
.compare
.Diff
;
18 * This adds the ability for {@link IMerger mergers} to define their own sub-set of "required" differences.
20 * This set of differences is what will be used by the UI to highlight related differences, by the batch
21 * merger to determine whether the diff can be merged beforehand (one of the related being in conflict will
22 * prevent the merge as a whole), ...
25 * The {@link AbstractMerger} implements this and can be sub-classed instead when the default set of
26 * requirements is enough.
29 * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
32 public interface IMerger2
extends IMerger
{
34 * Retrieves the set of <b>directly</b> required diffs in order to merge the current one. This may
35 * includes the diff's {@link Diff#getRequires() requirements}, its {@link Diff#getImpliedBy() implying
36 * diff}, or any other diff that we need to merge <u>before</u> the given one.
39 * The diff which direct requirements we need.
40 * @param mergeLeftToRight
41 * The direction in which we're considering a merge.
42 * @return The set of <b>directly</b> required diffs in order to merge the current one.
44 Set
<Diff
> getDirectMergeDependencies(Diff diff
, boolean mergeLeftToRight
);
47 * Returns all differences that will be merged because of our merging the given <code>target</code>
51 * The difference we're considering merging.
52 * @param mergeRightToLeft
53 * The direction in which we're considering a merge.
54 * @return The Set of all differences that will be merged because we've merged <code>target</code>.
56 Set
<Diff
> getDirectResultingMerges(Diff target
, boolean mergeRightToLeft
);
59 * Returns the set of all differences that need to be rejected if <code>target</code> is merged in the
63 * The difference we're considering merging.
64 * @param mergeRightToLeft
65 * The direction in which we're considering a merge.
66 * @return The Set of all differences that will be rejected if we are to merge merged <code>target</code>.
68 Set
<Diff
> getDirectResultingRejections(Diff target
, boolean mergeRightToLeft
);