JFrame
JComponent
ScriptWrapper<Script> wrapper = new GroovyScriptWrapper() { } ... DefaultSwingScriptLogger() logger = new DefaultSwingScriptLogger(); wrapper.setScriptLogger(logger);
int i = 0; public void process(TreeElement element) { i++; String linkID = >the link ID generated from the element> logger.appendLink("the element " + i, linkID); }It is also possible to show more than one link for one message. For example:
public void process(TreeElement element1, TreeElement element2) { HyperlinkElement linkElt1 = new HyperlinkElement(element1.name, element1); HyperlinkElement linkElt2 = new HyperlinkElement(element2.name, element2); logger.appendObjectLinks("The elements are %1 and %2", linkElt1, linkElt2); }
 
) for the logger area before the messages. You don't need to use the ScriptLogger.getTab() method to use the tabs. For example in the following code the tabs will beScriptWrapper<Script> wrapper = new GroovyScriptWrapper() { } ... DefaultSwingScriptLogger() logger = new DefaultSwingScriptLogger(); wrapper.setScriptLogger(logger); // set the Swing script logger wrapper.installScript(file); // install the script logger.append("Parent"); logger.setTab(1); logger.append("Child 1"); logger.append("Child 2"); logger.setTab(2); logger.append("Grandchild");
Copyright 2019-2020 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence