/*******************************************************************************
* Copyright (c) 2008-2011 Chair for Applied Software Engineering,
* Technische Universitaet Muenchen.
* 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:
******************************************************************************/
package org.eclipse.emf.emfstore.internal.client.model.changeTracking.merging.conflict.conflicts;
// BEGIN COMPLEX CODE
//
// WORK IN PROGRESS !
//
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.eclipse.emf.emfstore.internal.client.model.changeTracking.merging.DecisionManager;
import org.eclipse.emf.emfstore.internal.client.model.changeTracking.merging.conflict.ConflictDescription;
import org.eclipse.emf.emfstore.internal.client.model.changeTracking.merging.conflict.ConflictOption;
import org.eclipse.emf.emfstore.internal.client.model.changeTracking.merging.conflict.ConflictOption.OptionType;
import org.eclipse.emf.emfstore.internal.client.model.changeTracking.merging.conflict.VisualConflict;
import org.eclipse.emf.emfstore.internal.client.model.changeTracking.merging.util.DecisionUtil;
import org.eclipse.emf.emfstore.internal.server.conflictDetection.ConflictBucket;
public class MultiAttributeMoveSetConflict extends VisualConflict {
public MultiAttributeMoveSetConflict(ConflictBucket conflictBucket, DecisionManager decisionManager,
boolean isMySet) {
super(conflictBucket, decisionManager, isMySet, true);
}
/**
* LEFT: Set, RIGHT: Move
*/
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.emfstore.internal.client.VisualConflict.dialogs.merge.conflict.Conflict#initConflictDescription()
*/
@Override
protected ConflictDescription initConflictDescription(ConflictDescription description) {
if (isLeftMy()) {
description.setDescription(DecisionUtil.getDescription("multiattributemovesetconflict.my", //$NON-NLS-1$
getDecisionManager().isBranchMerge()));
} else {
description.setDescription(DecisionUtil.getDescription("multiattributemovesetconflict.their", //$NON-NLS-1$
getDecisionManager().isBranchMerge()));
}
return description;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.emfstore.internal.client.VisualConflict.dialogs.merge.conflict.Conflict#initConflictOptions(java.util.List)
*/
@Override
protected void initConflictOptions(List<ConflictOption> options) {
final ConflictOption myOption = new ConflictOption(StringUtils.EMPTY, OptionType.MyOperation);
myOption.addOperations(getMyOperations());
final ConflictOption theirOption = new ConflictOption(StringUtils.EMPTY, OptionType.TheirOperation);
theirOption.addOperations(getTheirOperations());
if (isLeftMy()) {
myOption.setOptionLabel(Messages.MultiAttributeMoveSetConflict_ChangeElement);
theirOption.setOptionLabel(Messages.MultiAttributeMoveSetConflict_MoveElement);
} else {
myOption.setOptionLabel(Messages.MultiAttributeMoveSetConflict_MoveElement);
theirOption.setOptionLabel(Messages.MultiAttributeMoveSetConflict_ChangeElement);
}
options.add(myOption);
options.add(theirOption);
}
}