01: package newprocess.diagram.edit.commands;
02:
03: import java.util.List;
04:
05: import org.eclipse.core.runtime.IAdaptable;
06: import org.eclipse.core.runtime.IProgressMonitor;
07: import org.eclipse.emf.transaction.TransactionalEditingDomain;
08: import org.eclipse.gmf.runtime.common.core.command.CommandResult;
09: import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
10: import org.eclipse.gmf.runtime.notation.Edge;
11: import org.eclipse.gmf.runtime.notation.View;
12:
13: /**
14: * @generated
15: */
16: public class New_processReorientConnectionViewCommand extends
17: AbstractTransactionalCommand {
18:
19: /**
20: * @generated
21: */
22: private IAdaptable edgeAdaptor;
23:
24: /**
25: * @generated
26: */
27: public New_processReorientConnectionViewCommand(
28: TransactionalEditingDomain editingDomain, String label) {
29: super (editingDomain, label, null);
30: }
31:
32: /**
33: * @generated
34: */
35: public List getAffectedFiles() {
36: View view = (View) edgeAdaptor.getAdapter(View.class);
37: if (view != null) {
38: return getWorkspaceFiles(view);
39: }
40: return super .getAffectedFiles();
41: }
42:
43: /**
44: * @generated
45: */
46: public IAdaptable getEdgeAdaptor() {
47: return edgeAdaptor;
48: }
49:
50: /**
51: * @generated
52: */
53: public void setEdgeAdaptor(IAdaptable edgeAdaptor) {
54: this .edgeAdaptor = edgeAdaptor;
55: }
56:
57: /**
58: * @generated
59: */
60: protected CommandResult doExecuteWithResult(
61: IProgressMonitor progressMonitor, IAdaptable info) {
62: assert null != edgeAdaptor : "Null child in New_processReorientConnectionViewCommand"; //$NON-NLS-1$
63: Edge edge = (Edge) getEdgeAdaptor().getAdapter(Edge.class);
64: assert null != edge : "Null edge in New_processReorientConnectionViewCommand"; //$NON-NLS-1$
65:
66: View tempView = edge.getSource();
67: edge.setSource(edge.getTarget());
68: edge.setTarget(tempView);
69:
70: return CommandResult.newOKCommandResult();
71: }
72: }
|