From 8ee6aadb9d5ce7a1922a5b1e8a086d9031ad6a32 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 8 Apr 2011 10:57:44 +0000 Subject: [PATCH] allow groovy scripts to be run when in headless mode - pass startupAlFrame as context --- src/jalview/bin/Jalview.java | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) 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