From: jprocter Date: Fri, 8 Apr 2011 10:57:44 +0000 (+0000) Subject: allow groovy scripts to be run when in headless mode - pass startupAlFrame as context X-Git-Tag: Release_2_7~225 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8ee6aadb9d5ce7a1922a5b1e8a086d9031ad6a32;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 80f3722..9383656 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -670,15 +670,36 @@ public class Jalview * = new Binding(); binding.setVariable("input", "world"); * gse.run("hello.groovy", binding); */ - ClassLoader cl = (jalviewContext[0]!=null ? jalviewContext[0] : jalviewContext[1]).getClass().getClassLoader(); + Class[] bspec; + Object[] binding; + int blen=((jalviewContext[0]==null) ? 0 : 1) + ((jalviewContext[1]==null) ? 0 : 1); + String cnames[] = new String[] { "Jalview", "currentAlFrame"}; + bspec=new Class[blen*2]; + binding=new Object[blen*2]; + blen=0; + ClassLoader cl=null; + for (int jc=0;jc