Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f86d590869695c55ee337e0fe192ed901f23e1ed (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
/*****************************************************************************
 * 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:
 *	Amine EL KOUHEN (CEA LIST/LIFL) - Amine.Elkouhen@cea.fr 
 *****************************************************************************/
package org.eclipse.papyrus.infra.services.decoration;

import java.util.Observer;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.infra.core.services.IService;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.services.decoration.util.Decoration.PreferedPosition;
import org.eclipse.papyrus.infra.services.decoration.util.IPapyrusDecoration;


/**
 * The Interface IDecorationService.
 */
public interface IDecorationService extends IService {

	/**
	 * @see org.eclipse.papyrus.infra.core.services.IService#startService()
	 * 
	 * @throws ServiceException
	 */

	void startService() throws ServiceException;

	/**
	 * @see org.eclipse.papyrus.infra.core.services.IService#disposeService()
	 * 
	 * @throws ServiceException
	 */

	void disposeService() throws ServiceException;

	/**
	 * Adds the listener.
	 * 
	 * @param o
	 *        the o
	 */
	void addListener(Observer o);

	/**
	 * Delete listener.
	 * 
	 * @param o
	 *        the o
	 */
	void deleteListener(Observer o);

	/**
	 * Notify listeners.
	 * 
	 * @param decorationService
	 *        the decoration service
	 */
	void notifyListeners(DecorationService decorationService);


	/**
	 * Adds the decoration. If a decoration with the same ID already exists, do not add, but update
	 * the decoration.
	 * 
	 * @param id
	 *        the id
	 * @param type
	 *        the decoration type, currently corresponding to the marker type
	 * @param element
	 *        the element
	 * @param decorationForGE
	 *        the decoration image for a graphical editor
	 * @param decorationForME
	 *        the decoration image for the model explorer
	 * @param message
	 *        the message
	 * @return the created (or existing) decoration
	 */
	IPapyrusDecoration addDecoration(String id, String type, EObject element, ImageDescriptor decorationForGE, ImageDescriptor decorationForME, PreferedPosition position, String message);

	/**
	 * Removes the decoration.
	 * 
	 * @param id
	 *        the id
	 */
	void removeDecoration(String id);

	/**
	 * Gets the decoration.
	 * 
	 * @param element
	 *        the element
	 * @param navigateToParents
	 *        the navigate to parents
	 * @return the decoration
	 */
	EList<IPapyrusDecoration> getDecorations(Object element, boolean navigateToParents);
}

Back to the top