blob: c0dc05c42ef0d0f18ac659605281627311046b48 [file] [log] [blame]
/*******************************************************************************
* Copyright 2011 Chair for Applied Software Engineering,
* Technische Universitaet Muenchen.
* All rights reserved. This program and the accompanying materials
* are made available under the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
******************************************************************************/
package org.eclipse.emf.emfstore.client.model.changeTracking.merging.conflict.conflicts;
// BEGIN COMPLEX CODE
//
// WORK IN PROGRESS !
//
import java.util.List;
import java.util.Set;
import org.eclipse.emf.emfstore.client.model.changeTracking.merging.DecisionManager;
import org.eclipse.emf.emfstore.client.model.changeTracking.merging.conflict.Conflict;
import org.eclipse.emf.emfstore.client.model.changeTracking.merging.conflict.ConflictDescription;
import org.eclipse.emf.emfstore.client.model.changeTracking.merging.conflict.ConflictOption;
import org.eclipse.emf.emfstore.client.model.changeTracking.merging.conflict.ConflictOption.OptionType;
import org.eclipse.emf.emfstore.client.model.changeTracking.merging.util.DecisionUtil;
import org.eclipse.emf.emfstore.server.model.versioning.operations.AbstractOperation;
public class MultiAttributeMoveSetConflict extends Conflict {
public MultiAttributeMoveSetConflict(Set<AbstractOperation> opsA, Set<AbstractOperation> opsB,
AbstractOperation leftOperation, AbstractOperation rightOperation, DecisionManager decisionManager,
boolean isMySet) {
super(opsA, opsB, leftOperation, rightOperation, decisionManager, isMySet, true);
}
/**
* LEFT: Set, RIGHT: Move
*/
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.emfstore.client.ui.dialogs.merge.conflict.Conflict#initConflictDescription()
*/
@Override
protected ConflictDescription initConflictDescription(ConflictDescription description) {
if (isLeftMy()) {
description.setDescription(DecisionUtil.getDescription("multiattributemovesetconflict.my",
getDecisionManager().isBranchMerge()));
} else {
description.setDescription(DecisionUtil.getDescription("multiattributemovesetconflict.their",
getDecisionManager().isBranchMerge()));
}
return description;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.emfstore.client.ui.dialogs.merge.conflict.Conflict#initConflictOptions(java.util.List)
*/
@Override
protected void initConflictOptions(List<ConflictOption> options) {
ConflictOption myOption = new ConflictOption("", OptionType.MyOperation);
myOption.addOperations(getMyOperations());
ConflictOption theirOption = new ConflictOption("", OptionType.TheirOperation);
theirOption.addOperations(getTheirOperations());
if (isLeftMy()) {
myOption.setOptionLabel("Change element");
theirOption.setOptionLabel("Move element");
} else {
myOption.setOptionLabel("Move element");
theirOption.setOptionLabel("Change element");
}
options.add(myOption);
options.add(theirOption);
}
}