From: ishmal Date: Tue, 1 Apr 2008 19:31:19 +0000 (+0000) Subject: Improve script engine listing X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=81f3ec56e994ab1929d00267f5d391a9926cad6f;p=inkscape.git Improve script engine listing --- diff --git a/src/bind/java/org/inkscape/script/ScriptConsole.java b/src/bind/java/org/inkscape/script/ScriptConsole.java index 890d78189..c7d71b575 100644 --- a/src/bind/java/org/inkscape/script/ScriptConsole.java +++ b/src/bind/java/org/inkscape/script/ScriptConsole.java @@ -133,10 +133,13 @@ public boolean setEngine(String langName) { for (ScriptEngine engine : engines) { - if (langName.equalsIgnoreCase(engine.getFactory().getLanguageName())) - { - setEngine(engine); - return true; + for(String name: engine.getFactory().getNames()) + { + if (langName.equalsIgnoreCase(name)) + { + setEngine(engine); + return true; + } } } return false; @@ -326,18 +329,19 @@ private void initScripts() trace("ScriptEngineFactory Info"); String engName = factory.getEngineName(); String engVersion = factory.getEngineVersion(); + String fullEngName = engName + " (" + engVersion + ")"; String langName = factory.getLanguageName(); String langVersion = factory.getLanguageVersion(); - trace("\tScript Engine: %s (%s)", engName, engVersion); + String fullLangName = langName + " (" + langVersion + ")"; + trace("\t" + fullEngName); List engNames = factory.getNames(); for(String name: engNames) { - trace("\tEngine Alias: %s", name); + trace("\tEngine Alias: " + name); } - trace("\tLanguage: %s (%s)", langName, langVersion); + trace("\t" + fullLangName); engines.add(factory.getScriptEngine()); - //JLabel item = new JLabel(langName); - engineBox.addItem(langName); + engineBox.addItem(fullLangName + " / " + fullEngName); } if (engineBox.getItemCount()>0) {