038cf74fa76841d43d096f8d4078a1676b57534f
[taxeditor.git] / eclipseprojects / eu.etaxonomy.taxeditor / src / eu / etaxonomy / taxeditor / view / nameviewersupport / ErrorAnnotation.java
1 package eu.etaxonomy.taxeditor.view.nameviewersupport;
2
3 import org.eclipse.core.resources.IMarker;
4 import org.eclipse.jface.text.Position;
5 import org.eclipse.jface.text.source.Annotation;
6 import org.eclipse.swt.graphics.Image;
7 import org.eclipse.swt.graphics.RGB;
8
9 public class ErrorAnnotation extends Annotation {
10 private IMarker marker;
11 private String text;
12 private int line;
13 private Position position;
14
15 // error identifiers, images and colors
16 public static String ERROR_TYPE = "error.type";
17 public static Image ERROR_IMAGE;
18 public static final RGB ERROR_RGB = new RGB(255, 0, 0);
19
20 public ErrorAnnotation(IMarker marker) {
21 this.marker = marker;
22 }
23
24 public ErrorAnnotation(int line, String text) {
25 super(ERROR_TYPE, true, null);
26 this.marker = null;
27 this.line = line;
28 this.text = text;
29 }
30
31 public IMarker getMarker() {
32 return marker;
33 }
34
35 public int getLine() {
36 return line;
37 }
38
39 public String getText() {
40 return text;
41 }
42
43 public Image getImage() {
44 return ERROR_IMAGE;
45 }
46
47 public int getLayer() {
48 return 3;
49 }
50
51 public String getType() {
52 return ERROR_TYPE;
53 }
54
55 public Position getPosition() {
56 return position;
57 }
58
59 public void setPosition(Position position) {
60 this.position = position;
61 }
62 }