From: jprocter Date: Thu, 7 Apr 2011 22:18:22 +0000 (+0000) Subject: allow groovy scripts to be run when in headless mode - pass startupAlFrame as context X-Git-Tag: Release_2_7~226 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=71437ea48fd9a83b59da4dc722f66ab30ae77257;p=jalview.git allow groovy scripts to be run when in headless mode - pass startupAlFrame as context --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index ba2d3bd..80f3722 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -670,7 +670,7 @@ public class Jalview * = new Binding(); binding.setVariable("input", "world"); * gse.run("hello.groovy", binding); */ - 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);