JAL-3247 First attempt at getdown code to add macOS startup filenames to the appargs...
[jalview.git] / getdown / src / getdown / core / src / main / java / com / threerings / getdown / data / Application.java
index 0a49739..212e948 100644 (file)
@@ -767,6 +767,12 @@ public class Application
 
         // add the launch specific application arguments
         _appargs.addAll(_envc.appArgs);
+        
+        // add startupFiles
+        for (File f : startupFiles) {
+          _appargs.add("-open");
+          _appargs.add(f.getAbsolutePath());
+        }
 
         // look for custom arguments
         fillAssignmentListFromPairs("extra.txt", _txtJvmArgs);
@@ -1760,6 +1766,10 @@ public class Application
     {
         return new File(appdir, path);
     }
+    
+    public void addStartupFile (File f) {
+      startupFiles.add(f);
+    }
 
     protected final EnvConfig _envc;
     protected File _config;
@@ -1804,6 +1814,7 @@ public class Application
 
     protected List<String> _jvmargs = new ArrayList<>();
     protected List<String> _appargs = new ArrayList<>();
+    protected List<File> startupFiles = new ArrayList<>();
 
     protected String[] _optimumJvmArgs;