p2izing the editor
[taxeditor.git] / eclipseprojects / eu.etaxonomy.taxeditor / src / eu / etaxonomy / taxeditor / editor / WarningAnnotation.java
1 package eu.etaxonomy.taxeditor.editor;
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 WarningAnnotation 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 WARNING_TYPE = "warning.type";
17 public static Image WARNING_IMAGE;
18 public static final RGB WARNING_RGB = new RGB(244, 200, 45);
19
20 public WarningAnnotation(IMarker marker) {
21 this.marker = marker;
22 }
23
24 public WarningAnnotation(int line, String text) {
25 super(WARNING_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 WARNING_IMAGE;
45 }
46
47 public int getLayer() {
48 return 3;
49 }
50
51 public String getType() {
52 return WARNING_TYPE;
53 }
54
55 public Position getPosition() {
56 return position;
57 }
58
59 public void setPosition(Position position) {
60 this.position = position;
61 }
62 }