allow groovy scripts to be run when in headless mode - pass startupAlFrame as context
authorjprocter <Jim Procter>
Thu, 7 Apr 2011 22:18:22 +0000 (22:18 +0000)
committerjprocter <Jim Procter>
Thu, 7 Apr 2011 22:18:22 +0000 (22:18 +0000)
src/jalview/bin/Jalview.java

index ba2d3bd..80f3722 100755 (executable)
@@ -670,7 +670,7 @@ public class Jalview
        * = new Binding(); binding.setVariable("input", "world");
        * gse.run("hello.groovy", binding); </code>
        */
-      ClassLoader cl = jalviewContext.getClass().getClassLoader();
+      ClassLoader cl = (jalviewContext[0]!=null ? jalviewContext[0] : jalviewContext[1]).getClass().getClassLoader();
       Class gbindingc = cl.loadClass("groovy.lang.Binding");
       Constructor gbcons = gbindingc.getConstructor(null);
       Object gbinding = gbcons.newInstance(null);