1 package eu
.etaxonomy
.taxeditor
.prototype2
.view
.nameviewersupport
;
3 import org
.eclipse
.jface
.text
.source
.Annotation
;
4 import org
.eclipse
.jface
.text
.source
.IAnnotationAccess
;
5 import org
.eclipse
.jface
.text
.source
.IAnnotationAccessExtension
;
6 import org
.eclipse
.jface
.text
.source
.ImageUtilities
;
7 import org
.eclipse
.swt
.SWT
;
8 import org
.eclipse
.swt
.graphics
.GC
;
9 import org
.eclipse
.swt
.graphics
.Rectangle
;
10 import org
.eclipse
.swt
.widgets
.Canvas
;
12 public class AnnotationMarkerAccess
implements IAnnotationAccess
, IAnnotationAccessExtension
{
13 public Object
getType(Annotation annotation
) {
14 return annotation
.getType();
17 public boolean isMultiLine(Annotation annotation
) {
21 public boolean isTemporary(Annotation annotation
) {
22 return !annotation
.isPersistent();
25 public String
getTypeLabel(Annotation annotation
) {
26 if (annotation
instanceof ErrorAnnotation
)
32 public int getLayer(Annotation annotation
) {
33 if (annotation
instanceof ErrorAnnotation
)
34 return ((ErrorAnnotation
)annotation
).getLayer();
39 public void paint(Annotation annotation
, GC gc
, Canvas canvas
, Rectangle bounds
) {
40 ImageUtilities
.drawImage(((ErrorAnnotation
)annotation
).getImage(),
41 gc
, canvas
, bounds
, SWT
.CENTER
, SWT
.TOP
);
44 public boolean isPaintable(Annotation annotation
) {
45 if (annotation
instanceof ErrorAnnotation
)
46 return ((ErrorAnnotation
)annotation
).getImage() != null;
51 public boolean isSubtype(Object annotationType
, Object potentialSupertype
) {
52 if (annotationType
.equals(potentialSupertype
))
59 public Object
[] getSupertypes(Object annotationType
) {