Author: pkluegl
Date: Fri Nov  4 13:18:24 2011
New Revision: 1197547

URL: http://svn.apache.org/viewvc?rev=1197547&view=rev
Log:
UIMA-2273
added listener methods to ICasEditor and removed casts to AnnotationEditor in 
two views

Modified:
    
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/ICasEditor.java
    
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java
    
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java

Modified: 
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/ICasEditor.java
URL: 
http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/ICasEditor.java?rev=1197547&r1=1197546&r2=1197547&view=diff
==============================================================================
--- 
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/ICasEditor.java
 (original)
+++ 
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/ICasEditor.java
 Fri Nov  4 13:18:24 2011
@@ -36,4 +36,9 @@ public interface ICasEditor extends IEdi
   CasDocumentProvider getCasDocumentProvider();
   
   void reopenEditorWithNewTypeSystem();
+  
+  void addCasEditorInputListener(ICasEditorInputListener listener);
+  
+  void removeCasEditorInputListener(ICasEditorInputListener listener);
+  
 }

Modified: 
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java
URL: 
http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java?rev=1197547&r1=1197546&r2=1197547&view=diff
==============================================================================
--- 
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java
 (original)
+++ 
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java
 Fri Nov  4 13:18:24 2011
@@ -29,7 +29,6 @@ import org.apache.uima.cas.FeatureStruct
 import org.apache.uima.cas.StringArrayFS;
 import org.apache.uima.cas.Type;
 import org.apache.uima.caseditor.editor.AbstractDocumentListener;
-import org.apache.uima.caseditor.editor.AnnotationEditor;
 import org.apache.uima.caseditor.editor.ArrayValue;
 import org.apache.uima.caseditor.editor.CasEditorError;
 import org.apache.uima.caseditor.editor.FeatureValue;
@@ -55,9 +54,7 @@ final class FeatureStructureContentProvi
     if (mDocument == null) {
       throw new IllegalArgumentException("document parameter must not be 
null!");
     }
-    if(mEditor instanceof AnnotationEditor) {
-      ((AnnotationEditor)mEditor).addCasEditorInputListener(this);
-    }
+     mEditor.addCasEditorInputListener(this);
   }
 
   private int arraySize(FeatureStructure value) {
@@ -123,9 +120,7 @@ final class FeatureStructureContentProvi
 
   public void dispose() {
     mDocument.removeChangeListener(this);
-    if(mEditor instanceof AnnotationEditor) {
-      ((AnnotationEditor)mEditor).removeCasEditorInputListener(this);
-    }
+    mEditor.removeCasEditorInputListener(this);
   }
 
   public void inputChanged(final Viewer viewer, Object oldInput, Object 
newInput) {

Modified: 
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java
URL: 
http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java?rev=1197547&r1=1197546&r2=1197547&view=diff
==============================================================================
--- 
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java
 (original)
+++ 
uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java
 Fri Nov  4 13:18:24 2011
@@ -33,7 +33,6 @@ import org.apache.uima.cas.text.Annotati
 import org.apache.uima.caseditor.CasEditorPlugin;
 import org.apache.uima.caseditor.Images;
 import org.apache.uima.caseditor.editor.AbstractAnnotationDocumentListener;
-import org.apache.uima.caseditor.editor.AnnotationEditor;
 import org.apache.uima.caseditor.editor.FeatureValue;
 import org.apache.uima.caseditor.editor.ICasDocument;
 import org.apache.uima.caseditor.editor.ICasEditor;
@@ -81,9 +80,7 @@ public final class FeatureStructureBrows
     FeatureStructureTreeContentProvider(ICasEditor editor) {
       mEditor = editor;
       mDocument = editor.getDocument();
-      if(mEditor instanceof AnnotationEditor) {
-        ((AnnotationEditor)mEditor).addCasEditorInputListener(this);
-      }
+      mEditor.addCasEditorInputListener(this);
     }
 
     public Object[] getElements(Object inputElement) {
@@ -112,9 +109,7 @@ public final class FeatureStructureBrows
 
     public void dispose() {
       mDocument.removeChangeListener(this);
-      if(mEditor instanceof AnnotationEditor) {
-        ((AnnotationEditor)mEditor).removeCasEditorInputListener(this);
-      }
+      mEditor.removeCasEditorInputListener(this);
     }
 
     public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {


Reply via email to