blob: 475d61a2eb0a1eeeb63912de17e1b48cf2c8a07f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
/*****************************************************************************
* Copyright (c) 2008 CEA LIST.
*
*
* 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:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.commands;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
/**
* This class is used to supplement a gmf connection command.
*
* @author Patrick Tessier
*/
public abstract class SupplementCommand {
private EObject container;
private final EObject source;
private final EObject target;
/**
* the supplement command has the same parameter as connection create
* command of gmf command
*
* @param container
* the container of the link
* @param source
* the source of the link
*
* @param target
* the target of the link
*/
public SupplementCommand(EObject container, EObject source, EObject target) {
super();
this.container = container;
this.source = source;
this.target = target;
}
/**
* this is the same fucntionnality as {@link IUndoableOperation}
*
* @return true if the command ca be executed
*/
// @unused
public abstract boolean canExecute();
/**
* Creates the request to configure the new element.
*
* @see EditElementCommand
* @return the request
*/
// @unused
protected abstract ConfigureRequest createConfigureRequest(ConfigureRequest request);
/**
* this is the method tat realize the execution of the command
*
* @param newElement
* the new element ro configure
* @return the new element
*/
public abstract EObject doDefaultElementCreation(TransactionalEditingDomain domain, EObject newElement);
/**
* use to obtain the container of the link
*
* @return the container of the link
*/
public EObject getContainer() {
return container;
}
/**
* use to obtain the source of the link
*
* @return the source of the link
*/
public EObject getSource() {
return source;
}
/**
* use to obtain the target of the link
*
* @return the target of the link
*/
public EObject getTarget() {
return target;
}
/**
* use to set the container of the link
*/
// @unused
public void setContainer(EObject container) {
this.container = container;
}
}
|