Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2003-10-30 07:33:01 +0000
committerDani Megert2003-10-30 07:33:01 +0000
commite16dc3ca3b4fe85b67df531fb113a3a555ff1afc (patch)
tree140b6f6add00f78ff713e7ce4783e5bae482c471
parent34072374a8514e2b5982d747d0b67b9cd1b2934c (diff)
downloadeclipse.platform.text-e16dc3ca3b4fe85b67df531fb113a3a555ff1afc.tar.gz
eclipse.platform.text-e16dc3ca3b4fe85b67df531fb113a3a555ff1afc.tar.xz
eclipse.platform.text-e16dc3ca3b4fe85b67df531fb113a3a555ff1afc.zip
- 40318: Warning hides error in vertical ruler and squiggles
- 40784: Improve annotations and annotation handling
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultAnnotation.java35
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotation.java11
2 files changed, 33 insertions, 13 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultAnnotation.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultAnnotation.java
index e1b8efb75..82f8d92d7 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultAnnotation.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultAnnotation.java
@@ -49,9 +49,29 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
public class DefaultAnnotation extends Annotation implements IAnnotationExtension {
/**
- * The layer in which markers representing problem are located.
+ * The layer in which task annotations are located.
*/
- public final static int PROBLEM_LAYER= 5;
+ public final static int TASK_LAYER= 1;
+
+ /**
+ * The layer in which bookmarks annotatons are located.
+ */
+ public final static int BOOKMARK_LAYER= 2;
+
+ /**
+ * The layer in which info annotations are located.
+ */
+ public final static int INFO_LAYER= 3;
+
+ /**
+ * The layer in which warning annotations representing are located.
+ */
+ public final static int WARNING_LAYER= 4;
+
+ /**
+ * The layer in which error annotations representing are located.
+ */
+ public final static int ERROR_LAYER= 5;
/** Internal image registry */
private static Map fgImageRegistry;
@@ -142,7 +162,6 @@ public class DefaultAnnotation extends Annotation implements IAnnotationExtensio
fSeverity= severity;
fIsTemporary= isTemporary;
fMessage= message;
- setLayer(PROBLEM_LAYER + 1);
fAnnotationType= annotationType;
}
@@ -157,23 +176,23 @@ public class DefaultAnnotation extends Annotation implements IAnnotationExtensio
if (isAnnotationType(fAnnotationType, IMarker.TASK)) {
name= ISharedImages.IMG_OBJS_TASK_TSK;
- layer= 1;
+ layer= TASK_LAYER;
} else if (isAnnotationType(fAnnotationType, IMarker.BOOKMARK)) {
name= ISharedImages.IMG_OBJS_BKMRK_TSK;
- layer= 2;
+ layer= BOOKMARK_LAYER;
} else if (isAnnotationType(fAnnotationType, IMarker.PROBLEM)) {
switch (fSeverity) {
case IMarker.SEVERITY_INFO:
name= ISharedImages.IMG_OBJS_INFO_TSK;
- layer= 3;
+ layer= INFO_LAYER;
break;
case IMarker.SEVERITY_WARNING:
name= ISharedImages.IMG_OBJS_WARN_TSK;
- layer= 3;
+ layer= WARNING_LAYER;
break;
case IMarker.SEVERITY_ERROR:
name= ISharedImages.IMG_OBJS_ERROR_TSK;
- layer= PROBLEM_LAYER;
+ layer= ERROR_LAYER;
break;
}
}
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotation.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotation.java
index 16baaa679..a8f7e27cd 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotation.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkerAnnotation.java
@@ -43,10 +43,11 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
* @see org.eclipse.core.resources.IMarker
*/
public class MarkerAnnotation extends Annotation implements IAnnotationExtension {
-
+
/**
* The layer in which markers representing problem are located.
* @since 2.0
+ * XXX to be deprecated as of 3.0 use {@link DefaultAnnotation#ERROR_LAYER}
*/
public final static int PROBLEM_LAYER= 5;
@@ -163,10 +164,10 @@ public class MarkerAnnotation extends Annotation implements IAnnotationExtension
if (MarkerUtilities.isMarkerType(fMarker, IMarker.TASK)) {
name= ISharedImages.IMG_OBJS_TASK_TSK;
- layer= 1;
+ layer= DefaultAnnotation.TASK_LAYER;
} else if (MarkerUtilities.isMarkerType(fMarker, IMarker.BOOKMARK)) {
name= ISharedImages.IMG_OBJS_BKMRK_TSK;
- layer= 2;
+ layer= DefaultAnnotation.BOOKMARK_LAYER;
} else if (MarkerUtilities.isMarkerType(fMarker, IMarker.PROBLEM)) {
switch (fMarker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO)) {
case IMarker.SEVERITY_INFO:
@@ -175,11 +176,11 @@ public class MarkerAnnotation extends Annotation implements IAnnotationExtension
break;
case IMarker.SEVERITY_WARNING:
name= ISharedImages.IMG_OBJS_WARN_TSK;
- layer= 3;
+ layer= DefaultAnnotation.WARNING_LAYER;
break;
case IMarker.SEVERITY_ERROR:
name= ISharedImages.IMG_OBJS_ERROR_TSK;
- layer= PROBLEM_LAYER;
+ layer= DefaultAnnotation.ERROR_LAYER;
break;
}
}

Back to the top