blob: 00ed44b4892d97cc39447573fc1d665be94a5f46 (
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
113
114
115
116
117
118
119
120
121
|
/*****************************************************************************
* Copyright (c) 2011 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.infra.hyperlink.helper;
import java.util.List;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkObject;
/**
* this class is an abstract helper used to serialize and deserialize a HyperLink Object
*
*/
public abstract class AbstractHyperLinkHelper {
/**
* the id of the tab
*/
private String tabid;
/**
* Getter for this{@link #tabid}
*
* @return
* this{@link #tabid}
*/
public final String getTabId() {
return this.tabid;
}
/**
* Setter for this{@link #tabid}
*
* @param tabId
* the id of the tab
*/
public final void setTabId(final String tabId) {
this.tabid = tabId;
}
/**
*
* @return as string of the kind of hyperlink to display
*/
public abstract String getNameofManagedHyperLink();
/**
* this method is called in order to create an HyperLinkObject and add into
* a given HyperLinkObject list
*
* @param list
* a list of hyperlink Object
* @param aModel
* TODO
*/
// TODO remove this method
public abstract void executeNewMousePressed(List<HyperLinkObject> list, EObject aModel);
/**
* this method is called in order to edit an HyperLinkObject and add into a
* given HyperLinkObject list
*
* @param list
* a list of hyperlink Object
* @param amodel
* the root model
* @param HyperLinkObject
* the HyperLinkObject to edit
*/
public void executeEditMousePressed(List<HyperLinkObject> list, HyperLinkObject HyperLinkObject, EObject amodel) {
HyperLinkObject.executeEditMousePressed(list, amodel);
}
/**
* from a list of hyperlinks, it return a list of hyperlink with the same
* kind. for example return a list of diagramhyperlink
*
* @param HyperLinkObjects
* the list of HyperLinkObjects
* @return a list of hyperlink object with the same kind
*/
public abstract List<HyperLinkObject> getFilteredObject(List<HyperLinkObject> HyperLinkObjects);
/**
*
* @param eAnnotation
* that represents a hyperlink object
* @return the hyperlink object from the eannotation
*/
public abstract HyperLinkObject getHyperLinkObject(EAnnotation eAnnotation);
/**
* get a command to serailize a hyperlink object
*
* @param domain
* the editing domain
* @param object
* the EModelElement to which the hyperlink as attached
* @param HyperLinkObject
* the HyperLinkObject to serailize
* @return the command in charge of the serialization
*/
public abstract RecordingCommand getAddHyperLinkCommand(TransactionalEditingDomain domain, EModelElement object, HyperLinkObject HyperLinkObject);
}
|