blob: 4d70d49aa85bfd2b72317f74f4509059aa3843dd (
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
/*****************************************************************************
* Copyright (c) 2018 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:
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.uml.tools.decoration;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions;
import org.eclipse.papyrus.infra.services.decoration.util.Decoration.PreferedPosition;
import org.eclipse.papyrus.infra.services.decoration.util.IPapyrusDecoration;
import org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
/**
* Decoration for Undefined Profile.
*
* @author Gabriel Pascual
* @since 4.1
*/
public class UndefinedProfileDecoration implements IDecorationSpecificFunctions {
/** The Constant DECORATION_MESSAGE. */
private static final String DECORATION_MESSAGE = "The Profile Definition is outdated since last modifications"; //$NON-NLS-1$
/**
* Constructor.
*
*/
public UndefinedProfileDecoration() {
}
/**
* Gets the image descriptor for ge.
*
* @param marker
* the marker
* @return the image descriptor for ge
* @see org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions#getImageDescriptorForGE(org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker)
*/
@Override
public ImageDescriptor getImageDescriptorForGE(IPapyrusMarker marker) {
return null;
}
/**
* Gets the image descriptor for me.
*
* @param marker
* the marker
* @return the image descriptor for me
* @see org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions#getImageDescriptorForME(org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker)
*/
@Override
public ImageDescriptor getImageDescriptorForME(IPapyrusMarker marker) {
ImageDescriptor imageDescriptor = null;
if (marker instanceof UndefinedProfileMarker) {
imageDescriptor = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING);
}
return imageDescriptor;
}
/**
* Gets the prefered position.
*
* @param marker
* the marker
* @return the prefered position
* @see org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions#getPreferedPosition(org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker)
*/
@Override
public PreferedPosition getPreferedPosition(IPapyrusMarker marker) {
return PreferedPosition.NORTH_EAST;
}
/**
* Gets the message.
*
* @param marker
* the marker
* @return the message
* @see org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions#getMessage(org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker)
*/
@Override
public String getMessage(IPapyrusMarker marker) {
return DECORATION_MESSAGE;
}
/**
* Gets the priority.
*
* @param marker
* the marker
* @return the priority
* @see org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions#getPriority(org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker)
*/
@Override
public int getPriority(IPapyrusMarker marker) {
return 0;
}
/**
* Supports marker propagation.
*
* @return the mark children
* @see org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions#supportsMarkerPropagation()
*/
@Override
public MarkChildren supportsMarkerPropagation() {
return null;
}
/**
* Marker propagation.
*
* @param childDecorations
* the child decorations
* @return the i papyrus decoration
* @see org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions#markerPropagation(org.eclipse.emf.common.util.EList)
*/
@Override
public IPapyrusDecoration markerPropagation(EList<IPapyrusDecoration> childDecorations) {
return null;
}
}
|