Revision: 18793
          http://sourceforge.net/p/gate/code/18793
Author:   johann_p
Date:     2015-06-19 15:32:17 +0000 (Fri, 19 Jun 2015)
Log Message:
-----------
Attempt to fix #202 (Filepicker sometimes uses original and sometimes real 
path).
Avoid using the canonical path when storing the last used path for a resource 
type
in XJFileChooser and use absolute path instead.

Modified Paths:
--------------
    gate/trunk/src/main/gate/gui/MainFrame.java
    gate/trunk/src/main/gate/gui/NameBearerHandle.java
    gate/trunk/src/main/gate/swing/XJFileChooser.java

Modified: gate/trunk/src/main/gate/gui/MainFrame.java
===================================================================
--- gate/trunk/src/main/gate/gui/MainFrame.java 2015-06-19 13:40:30 UTC (rev 
18792)
+++ gate/trunk/src/main/gate/gui/MainFrame.java 2015-06-19 15:32:17 UTC (rev 
18793)
@@ -3654,9 +3654,9 @@
             Map<String, String> locations = fileChooser.getLocations();
             Resource res = (Resource) resource;
             // save also the location of the application with its name
-            
locations.put("application."+res.getName(),file.getCanonicalPath());
+            locations.put("application."+res.getName(),file.getAbsolutePath());
             locations.put("application.zip."+res.getName(),
-              file.getCanonicalPath().replaceFirst("\\.[^.]{3,5}$", ".zip"));
+              file.getAbsolutePath().replaceFirst("\\.[^.]{3,5}$", ".zip"));
             // add this application to the list of recent applications
             String list = locations.get("applications");
             if (list == null) { list = ""; }

Modified: gate/trunk/src/main/gate/gui/NameBearerHandle.java
===================================================================
--- gate/trunk/src/main/gate/gui/NameBearerHandle.java  2015-06-19 13:40:30 UTC 
(rev 18792)
+++ gate/trunk/src/main/gate/gui/NameBearerHandle.java  2015-06-19 15:32:17 UTC 
(rev 18793)
@@ -683,7 +683,7 @@
                       file, true, true);
               // save also the location of the application as last
               // application
-              locations.put("lastapplication", file.getCanonicalPath());
+              locations.put("lastapplication", file.getAbsolutePath());
               // add this application to the list of recent applications
               String list = locations.get("applications");
               if(list == null) {

Modified: gate/trunk/src/main/gate/swing/XJFileChooser.java
===================================================================
--- gate/trunk/src/main/gate/swing/XJFileChooser.java   2015-06-19 13:40:30 UTC 
(rev 18792)
+++ gate/trunk/src/main/gate/swing/XJFileChooser.java   2015-06-19 15:32:17 UTC 
(rev 18793)
@@ -162,13 +162,10 @@
   @Override
   public void approveSelection() {
     if (resource != null && getSelectedFile() != null) {
-      try {
-        String filePath = getSelectedFile().getCanonicalPath();
-        locations.put(resource, filePath);
-        setLocations(locations);
-      } catch (IOException e) {
-        e.printStackTrace();
-      }
+      //String filePath = getSelectedFile().getCanonicalPath();
+      String filePath = getSelectedFile().getAbsolutePath();
+      locations.put(resource, filePath);
+      setLocations(locations);
     }
     super.approveSelection();
   }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to