You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2011/04/18 15:53:45 UTC

svn commit: r1094575 - /uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java

Author: joern
Date: Mon Apr 18 13:53:45 2011
New Revision: 1094575

URL: http://svn.apache.org/viewvc?rev=1094575&view=rev
Log:
UIMA-2125 Improved selection handling when an annotation is updated

Modified:
    uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java

Modified: uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java?rev=1094575&r1=1094574&r2=1094575&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java (original)
+++ uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java Mon Apr 18 13:53:45 2011
@@ -328,20 +328,15 @@ public final class AnnotationEditor exte
     @Override
     public void updatedAnnotation(Collection<AnnotationFS> annotations) {
 
-      List<AnnotationFS> selectedFSes = getSelectedAnnotations();
+      // Remember old selection
+      ISelection oldSelection = mFeatureStructureSelectionProvider.getSelection();   
       
       // TODO: Improve update handling
       // Removing and adding is problematic because the selection goes away
       removedAnnotation(annotations);
       addedAnnotation(annotations);
-
-      List<ModelFeatureStructure> structures = new LinkedList<ModelFeatureStructure>();
-
-      for (AnnotationFS annotation : selectedFSes) {
-        structures.add(new ModelFeatureStructure(getDocument(), annotation));
-      }
-
-      mFeatureStructureSelectionProvider.setSelection(getDocument(), selectedFSes);
+      
+      mFeatureStructureSelectionProvider.setSelection(oldSelection);
     }
 
     public void changed() {