You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by tw...@apache.org on 2007/10/11 20:39:24 UTC

svn commit: r583909 - /incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java

Author: twgoetz
Date: Thu Oct 11 11:39:23 2007
New Revision: 583909

URL: http://svn.apache.org/viewvc?rev=583909&view=rev
Log:
Jira UIMA-593: apply UIMA-593.patch.

https://issues.apache.org/jira/browse/UIMA-593

Modified:
    incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java?rev=583909&r1=583908&r2=583909&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java Thu Oct 11 11:39:23 2007
@@ -578,7 +578,10 @@
     }
 
     public boolean isSubtype(Object annotationType, Object potentialSupertype) {
-      return true;
+
+      // imitate behavior without IAnnotationAccessExtension
+      return mShowAnnotationsMenu.getSelectedTypes().contains(
+                getDocument().getCAS().getTypeSystem().getType((String) annotationType));
     }
 
     public void paint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds) {
@@ -645,11 +648,12 @@
   @Override
   protected ISourceViewer createSourceViewer(Composite parent,
           org.eclipse.jface.text.source.IVerticalRuler ruler, int styles) {
-	  SourceViewer sourceViewer = new SourceViewer(parent, ruler, styles);
+    SourceViewer sourceViewer = new SourceViewer(parent, ruler, styles);
 
     sourceViewer.setEditable(false);
 
     mPainter = new AnnotationPainter(sourceViewer, new AnnotationAccess());
+
     sourceViewer.addPainter(mPainter);
 
     return sourceViewer;
@@ -854,22 +858,22 @@
   }
 
   /**
-   *
+   * Synchronizes all annotations which the eclipse annotation painter.
    */
   private void syncAnnotations() {
 
-	mPainter.removeAllAnnotationTypes();
+    mPainter.removeAllAnnotationTypes();
 
-	for (Type displayType : mShowAnnotationsMenu.getSelectedTypes()) {
-		showAnnotationType(displayType);
-	}
+    for (Type displayType : mShowAnnotationsMenu.getSelectedTypes()) {
+      showAnnotationType(displayType);
+    }
 
     // if not contained in types add current mode annotations
     if (!mShowAnnotationsMenu.getSelectedTypes().contains(mAnnotationMode)) {
-    	showAnnotationType(mAnnotationMode);
+      showAnnotationType(mAnnotationMode);
     }
 
-	mPainter.paint(IPainter.CONFIGURATION);
+    mPainter.paint(IPainter.CONFIGURATION);
   }
 
   /**