Pasted file doesnt have title and not reloadable
authoramwaterhouse <Andrew Waterhouse>
Thu, 5 Apr 2007 11:22:05 +0000 (11:22 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 5 Apr 2007 11:22:05 +0000 (11:22 +0000)
src/jalview/io/FileLoader.java

index 86c1cf4..4177eab 100755 (executable)
@@ -125,6 +125,9 @@ public class FileLoader
 \r
   public void run()\r
   {\r
+    String title = protocol.equals(AppletFormatAdapter.PASTE)\r
+        ? "Copied From Clipboard" : file;\r
+\r
     try\r
     {\r
       if (Desktop.instance != null)\r
@@ -172,10 +175,12 @@ public class FileLoader
                                         AlignFrame.DEFAULT_WIDTH,\r
                                         AlignFrame.DEFAULT_HEIGHT);\r
 \r
-            alignFrame.statusBar.setText("Successfully loaded file " + file);\r
-            alignFrame.setFileName(file, format);\r
+            alignFrame.statusBar.setText("Successfully loaded file " + title);\r
+\r
+            if (!protocol.equals(AppletFormatAdapter.PASTE))\r
+              alignFrame.setFileName(file, format);\r
 \r
-            Desktop.addInternalFrame(alignFrame, file,\r
+            Desktop.addInternalFrame(alignFrame, title,\r
                                      AlignFrame.DEFAULT_WIDTH,\r
                                      AlignFrame.DEFAULT_HEIGHT);\r
 \r
@@ -196,7 +201,7 @@ public class FileLoader
             Desktop.instance.stopLoading();\r
           }\r
 \r
-          final String errorMessage = "Couldn't load file " + file + "\n" +\r
+          final String errorMessage = "Couldn't load file " + title + "\n" +\r
               error;\r
 \r
           javax.swing.SwingUtilities.invokeLater(new Runnable()\r