blob: 8f302e486ea39f9bfc0011b1dabb131134f2f74a (
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
|
/*****************************************************************************
* Copyright (c) 2010 Atos Origin.
*
*
* 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:
* Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.documentation;
import java.util.List;
import java.util.Set;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
/**
* Interface used to provide a way to get or change the documentation of an element.
*
* @author mvelten
*
*/
public interface IDocumentationManager {
/**
* Returns an EMF Command to change the documentation.
*
* @param eObject
* The element where to change the documentation.
* @param newDocumentation
* The new value of the documentation or null to remove it.
* @return the command to execute or null if this element can not host a documentation.
*/
public Command getChangeDocumentationCommand(EObject eObject, String newDocumentation);
/**
* Returns an EMF Command to add an associated resource to the element.
*
* @param eObject
* The element where to add the associated resource.
* @param resourceURI
* the URI of the resource.
* @return the command to execute or null if this element can not host a documentation.
*/
public Command getAddAssociatedResourceCommand(EObject eObject, URI resourceURI);
/**
* Returns an EMF Command to remove an associated resource from the element.
*
* @param eObject
* The element where to remove the associated resource.
* @param resourceURI
* the URI of the resource.
* @return the command to execute or null if this element can not host a documentation.
*/
public Command getRemoveAssociatedResourceCommand(EObject eObject, URI resourceURI);
/**
* Returns the documentation of an element.
*
* @param eObject
* The element where to look for the documentation.
* @return The documentation or null if there is no documentation.
* @throws DocumentationUnsupportedException
* if documentation is not supported on this element.
*/
public String getDocumentation(EObject eObject) throws DocumentationUnsupportedException;
/**
* Returns the associated resources of the element.
*
* @param eObject
* The element where to look for the associated resources.
* @return a list of resource URIs.
* @throws DocumentationUnsupportedException
* if documentation is not supported on this element.
*/
public List<URI> getAssociatedResources(EObject eObject) throws DocumentationUnsupportedException;
/**
* Register a IDocumentationChangedListener (see {@link IDocumentationChangedListener}).
*
* @param listener
*/
public void registerDocumentationChangedListener(IDocumentationChangedListener listener);
/**
* Unregister a IDocumentationChangedListener (see {@link IDocumentationChangedListener}).
*
* @param listener
*/
public void unregisterDocumentationChangedListener(IDocumentationChangedListener listener);
/**
* @return the registered IDocumentationChangedListeners.
*/
public Set<IDocumentationChangedListener> getRegisteredDocumentationChangedListeners();
}
|