You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2008/02/21 14:51:52 UTC

svn commit: r629783 - /incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/FileAndShortName.java

Author: schor
Date: Thu Feb 21 05:51:51 2008
New Revision: 629783

URL: http://svn.apache.org/viewvc?rev=629783&view=rev
Log:
[UIMA-477] have FileAndShortName work for items which are just strings (returned by the picker for by-name elements)

Modified:
    incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/FileAndShortName.java

Modified: incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/FileAndShortName.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/FileAndShortName.java?rev=629783&r1=629782&r2=629783&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/FileAndShortName.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/FileAndShortName.java Thu Feb 21 05:51:51 2008
@@ -33,7 +33,11 @@
       IFile file = (IFile) o;
       fileName = file.getLocation().toString();
       shortName = file.getName();
-    } else {
+    } else if (o instanceof String) {
+        fileName = (String)o;
+        int lastSlash = fileName.lastIndexOf('/');
+        shortName = (lastSlash >= 0) ? fileName.substring(lastSlash + 1) : fileName;
+      } else {
       IPath path = (IPath) o;
       fileName = path.toString();
       shortName = path.toFile().getName();