blob: 08b5b0c54cdefb4d6584397aa5b5b240d1da6915 [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2019 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Xavier Le Pallec (for CEA LIST) xlepallec@lilo.org - Bug 558456
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.clazz.lf.associationlabellayout.edit.policies;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.AbstractEditPolicy;
import org.eclipse.papyrus.commands.wrappers.GMFtoGEFCommandWrapper;
public class NoMoveEditPolicy extends AbstractEditPolicy {
EditPart editPart;
public NoMoveEditPolicy(EditPart editPart) {
super();
this.editPart = editPart;
}
@Override
public Command getCommand(Request request) {
if (request instanceof org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyValueRequest) {
return new GMFtoGEFCommandWrapper(org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE);
}
return super.getCommand(request);
}
}