Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

XUL Script context



A global context is available in all the XUL scripts.

The context is available through the context field in your script. For example:
      public void clicked() {
         context.echo("Hello World");
      }

Context interface

The context have at least the following interface:

public class ScriptContext


Modifier and Type Method and Description
void abort(String message)
Abort the current script. The Scripting engine will use the throwable exception to stop the execution
void echo(String message)
Echo a message
void echo(Number number)
Echo a numeric value
void error(String message)
Error a message
XULScriptHelper getHelper()
Return the script helper
File getPath(String path)
Return the absolute path of a file defined relative to the script file
File getScriptFile()
Return the script file
ScriptLogger getScriptLogger()
Return the associated ScriptLogger

Note that abort(String message) will abort the script.

Using the context

The context is available as a context field in the script.

For example to show a message on the framework logger:
      public void clicked() {
        context.echo("My value:" + value);
      }

See also


Categories: builtin-applis

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence