Author: pkluegl Date: Tue May 20 14:58:53 2014 New Revision: 1596279 URL: http://svn.apache.org/r1596279 Log: no jira - depend on uima 2.6.0 release, not snapshot - fixed duplicate types in selection dialogs - avoid exception of handlers in testing view
Modified: uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/check/SelectTypesHandler.java uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/ExportTabelHandler.java uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/RerunActionHandler.java uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedExcludedTypesHandler.java uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedIncludedTypesHandler.java uima/ruta/trunk/ruta-parent/pom.xml Modified: uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/check/SelectTypesHandler.java URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/check/SelectTypesHandler.java?rev=1596279&r1=1596278&r2=1596279&view=diff ============================================================================== --- uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/check/SelectTypesHandler.java (original) +++ uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/check/SelectTypesHandler.java Tue May 20 14:58:53 2014 @@ -23,7 +23,9 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.uima.UIMAFramework; import org.apache.uima.resource.metadata.TypeDescription; @@ -64,9 +66,11 @@ public class SelectTypesHandler implemen new XMLInputSource(new File(composite.getTypeSystem()))); tsd.resolveImports(); TypeDescription[] systemTypes = tsd.getTypes(); + Set<String> set = new HashSet<String>(); for (TypeDescription typeDescription : systemTypes) { - types.add(typeDescription.getName()); + set.add(typeDescription.getName()); } + types.addAll(set); Collections.sort(types); Display display = Display.getDefault(); Modified: uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/ExportTabelHandler.java URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/ExportTabelHandler.java?rev=1596279&r1=1596278&r2=1596279&view=diff ============================================================================== --- uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/ExportTabelHandler.java (original) +++ uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/ExportTabelHandler.java Tue May 20 14:58:53 2014 @@ -30,6 +30,7 @@ import org.apache.uima.ruta.testing.ui.v import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.handlers.HandlerUtil; @@ -39,6 +40,9 @@ public class ExportTabelHandler extends public Object execute(ExecutionEvent event) throws ExecutionException { TestPageBookView debugView = (TestPageBookView) HandlerUtil.getActivePart(event); + if(!(debugView.getCurrentPage() instanceof TestViewPage)) { + return Status.CANCEL_STATUS; + } TestViewPage debugPage = (TestViewPage) debugView.getCurrentPage(); TableViewer viewer = debugPage.getViewer(); Modified: uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/RerunActionHandler.java URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/RerunActionHandler.java?rev=1596279&r1=1596278&r2=1596279&view=diff ============================================================================== --- uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/RerunActionHandler.java (original) +++ uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/RerunActionHandler.java Tue May 20 14:58:53 2014 @@ -587,8 +587,10 @@ public class RerunActionHandler implemen } public Object execute(ExecutionEvent event) throws ExecutionException { - TestPageBookView debugView = (TestPageBookView) HandlerUtil.getActivePart(event); + if(!(debugView.getCurrentPage() instanceof TestViewPage)) { + return Status.CANCEL_STATUS; + } TestViewPage debugPage = (TestViewPage) debugView.getCurrentPage(); String viewCasName = debugPage.getSelectedViewCasName(); Modified: uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedExcludedTypesHandler.java URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedExcludedTypesHandler.java?rev=1596279&r1=1596278&r2=1596279&view=diff ============================================================================== --- uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedExcludedTypesHandler.java (original) +++ uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedExcludedTypesHandler.java Tue May 20 14:58:53 2014 @@ -23,7 +23,9 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.commons.lang3.StringUtils; import org.apache.uima.UIMAFramework; @@ -62,6 +64,9 @@ public class SelectedExcludedTypesHandle public Object execute(ExecutionEvent event) throws ExecutionException { TestPageBookView debugView = (TestPageBookView) HandlerUtil.getActivePart(event); + if(!(debugView.getCurrentPage() instanceof TestViewPage)) { + return Status.CANCEL_STATUS; + } TestViewPage activePage = (TestViewPage) debugView.getCurrentPage(); IResource resource = activePage.getResource(); IPath location = resource.getLocation(); @@ -81,9 +86,11 @@ public class SelectedExcludedTypesHandle new XMLInputSource(new File(tsDesc))); defaultTypeSystemDescription.resolveImports(); TypeDescription[] systemTypes = defaultTypeSystemDescription.getTypes(); + Set<String> set = new HashSet<String>(); for (TypeDescription typeDescription : systemTypes) { - types.add(typeDescription.getName()); + set.add(typeDescription.getName()); } + types.addAll(set); Collections.sort(types); } catch (InvalidXMLException e) { RutaAddonsPlugin.error(e); Modified: uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedIncludedTypesHandler.java URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedIncludedTypesHandler.java?rev=1596279&r1=1596278&r2=1596279&view=diff ============================================================================== --- uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedIncludedTypesHandler.java (original) +++ uima/ruta/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/testing/ui/handlers/SelectedIncludedTypesHandler.java Tue May 20 14:58:53 2014 @@ -23,7 +23,9 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.commons.lang3.StringUtils; import org.apache.uima.UIMAFramework; @@ -62,6 +64,9 @@ public class SelectedIncludedTypesHandle public Object execute(ExecutionEvent event) throws ExecutionException { TestPageBookView debugView = (TestPageBookView) HandlerUtil.getActivePart(event); + if(!(debugView.getCurrentPage() instanceof TestViewPage)) { + return Status.CANCEL_STATUS; + } TestViewPage activePage = (TestViewPage) debugView.getCurrentPage(); IResource resource = activePage.getResource(); IPath location = resource.getLocation(); @@ -76,14 +81,15 @@ public class SelectedIncludedTypesHandle try { String tsDesc = RutaProjectUtils.getTypeSystemDescriptorPath(location, resource.getProject()).toPortableString(); - defaultTypeSystemDescription = UIMAFramework.getXMLParser().parseTypeSystemDescription( new XMLInputSource(new File(tsDesc))); defaultTypeSystemDescription.resolveImports(); TypeDescription[] systemTypes = defaultTypeSystemDescription.getTypes(); + Set<String> set = new HashSet<String>(); for (TypeDescription typeDescription : systemTypes) { - types.add(typeDescription.getName()); + set.add(typeDescription.getName()); } + types.addAll(set); Collections.sort(types); } catch (InvalidXMLException e) { RutaAddonsPlugin.error(e); Modified: uima/ruta/trunk/ruta-parent/pom.xml URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-parent/pom.xml?rev=1596279&r1=1596278&r2=1596279&view=diff ============================================================================== --- uima/ruta/trunk/ruta-parent/pom.xml (original) +++ uima/ruta/trunk/ruta-parent/pom.xml Tue May 20 14:58:53 2014 @@ -137,7 +137,7 @@ This product contains icons developed by (http://www.famfamfam.com/lab/icons/silk/), licensed under the Creative Commons Attribution 3.0 License. </postNoticeText> - <uimaVersion>2.6.0-SNAPSHOT</uimaVersion> + <uimaVersion>2.6.0</uimaVersion> </properties> <build>