public interface ScriptManager extends XULScriptManagerContext
| Modifier and Type | Field and Description |
|---|---|
static short |
LOADING_GLOBAL
The default type when scripts defined for a XUL script are global for all XUL files.
|
static short |
LOADING_LOCAL
The default type when scripts defined for a XUL script are local to this XUL file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addManagerListener(ScriptManagerListener listener)
Add a listener to the Script manager.
|
default boolean |
addScript(java.lang.String mime,
java.net.URL script)
Add a script on all documents.
|
default boolean |
addScript(java.lang.String mime,
java.net.URL script,
ScriptFactory fac)
Add a script on all documents.
|
default boolean |
addScript(java.lang.String mime,
java.net.URL script,
XULDocument xuldoc)
Add a script only for a XULDocument.
|
boolean |
addScript(java.lang.String mime,
java.net.URL script,
XULDocument xuldoc,
ScriptFactory fac)
Add a script only for a XULDocument.
|
default boolean |
addScript(java.net.URL script)
Add a script on all documents.
|
default boolean |
addScript(java.net.URL script,
XULDocument xuldoc)
Add a script on all documents.
|
XULDocument |
addXULScript(java.io.File file)
Add a new XUL Script initialized with the content of a XUL XML File.
|
default XULDocument |
addXULScript(java.lang.String name,
java.io.File xulscript)
Add a new XUL Script initialized with the content of a XUL XML File.
|
XULDocument |
addXULScript(java.lang.String name,
java.net.URL xulscript)
Add a new XUL Script initialized with the content of a XUL XML File.
|
XULDocument |
addXULScript(java.net.URL xulscript)
Add a new XUL Script initialized with the content of a XUL XML File.
|
default java.lang.Object |
evalScript(java.lang.String scriptMethod)
Evaluate a Script method without an argument.
|
java.lang.Object |
evalScript(java.lang.String scriptMethod,
java.lang.Object... args)
Evaluate a Script method.
|
java.util.Map<java.lang.String,java.util.Map<org.scripthelper.model.CachedMethodKey,org.scripthelper.model.ScriptWrapper<?>>> |
getCallSites()
Return the call sites.
|
XULDocument |
getCurrentDocument()
Return the document from which the last user event originates.
|
XULWidget |
getCurrentWidget()
Return the widget from which the last user event originates.
|
default XULWindow |
getCurrentWindow()
Return the window from which the last user event originates.
|
java.util.Map<java.net.URL,ScriptHandle> |
getGlobalScripts()
Return the Map of global scripts.
|
java.util.List<ScriptManagerListener> |
getListeners()
Return the list of manager listeners.
|
javax.swing.JMenuBar |
getMenuBar()
Return the Menubar.
|
ParserErrorReporter |
getParserErrorReporter()
Return the XUL parser error reporter.
|
java.lang.Object |
getPropertyValue(java.lang.String key)
Return a property value.
|
default boolean |
getPropertyValueAsBoolean(java.lang.String key)
Return a property value as a boolean.
|
XULScriptContext |
getScriptContext()
Return the script context.
|
org.scripthelper.exceptions.ScriptExceptionListener |
getScriptExceptionListener()
Return the script exception listener.
|
ScriptFactory |
getScriptFactory()
Return the script factory.
|
ScriptListener |
getScriptListener()
Return the script listener.
|
org.scripthelper.context.ScriptLogger |
getScriptLogger()
Return the script logger.
|
java.util.Map<org.scripthelper.model.ScriptSource,ScriptHandle> |
getScripts()
Return the scripts.
|
short |
getScriptsLoadingType()
Return the scripts loading type
|
java.util.List<javax.swing.JToolBar> |
getToolBars()
Return the toolbars.
|
java.util.Map<java.lang.String,XULDocument> |
getXULScripts()
Return the XUL Scripts managed by the manager.
|
default boolean |
hasGlobalScript(java.net.URL url)
Return true if the manager has the script for the specified URL as a global script.
|
boolean |
hasXULScript(java.lang.String scriptName)
Return true if it exist a XUL script of the defined name.
|
boolean |
isActive()
Return true if the manager is active.
|
boolean |
isListingAllScriptTypes()
Return true if all script methods are returned by the
XULDocument.getFunctionNames() method. |
boolean |
isValidatingXULSchemas()
Return true if the XUL scripts schemas must be validated.
|
void |
listAllScriptTypes(boolean listAllScripts)
Set if all script methods are returned by the
XULDocument.getFunctionNames() method. |
void |
removeManagerListener(ScriptManagerListener listener)
Remove a listener from the Script manager.
|
void |
removeXULScript(java.lang.String name)
Remove a script.
|
void |
setActive(boolean active)
Set the activation of the manager.
|
void |
setClassLoader(java.lang.ClassLoader classLoader)
Set the classLoader to use to load the script classes
|
void |
setCurrentWidget(XULWidget widget)
Set the widget from which the last user event originates.
|
void |
setParserErrorReporter(ParserErrorReporter errorReporter)
Set the XUL parser error reporter.
|
boolean |
setProperty(java.lang.String key,
java.lang.Object value)
Set the value of a Script manager property.
|
void |
setScriptContext(XULScriptContext context)
Set the script context.
|
void |
setScriptExceptionListener(org.scripthelper.exceptions.ScriptExceptionListener exceptionListener)
Set the script exception listener.
|
void |
setScriptFactory(ScriptFactory factory)
Set the script factory.
|
void |
setScriptListener(ScriptListener listener)
Set the script listener.
|
void |
setScriptLogger(org.scripthelper.context.ScriptLogger scriptLogger)
Set the script logger.
|
void |
setScriptsLoadingType(short type)
Set the scripts loading type.
|
void |
validateXULSchema(boolean isValidating)
Set if the XUL scripts schemas must be validated.
|
evalScript, evalScript, evalScript, getXULScriptstatic final short LOADING_LOCAL
static final short LOADING_GLOBAL
void setScriptFactory(ScriptFactory factory)
factory - the script factoryScriptFactory getScriptFactory()
void setClassLoader(java.lang.ClassLoader classLoader)
classLoader - the classLoaderboolean setProperty(java.lang.String key,
java.lang.Object value)
ScriptManagerProperties.ALLOW_FILE_ACCESS allows files access (read and write) by scripts. Default is
trueScriptManagerProperties.ALLOW_DISPOSE allows dispose of the current window access by scriprs. Default is falseScriptManagerProperties.ALLOW_EXIT allows System.exist(0) by scriprs. Default is falsekey - the property keyvalue - the property valuejava.lang.Object getPropertyValue(java.lang.String key)
key - the property keydefault boolean getPropertyValueAsBoolean(java.lang.String key)
key - the property keyvoid validateXULSchema(boolean isValidating)
isValidating - true if the XUL scripts schemas must be validatedboolean isValidatingXULSchemas()
void listAllScriptTypes(boolean listAllScripts)
XULDocument.getFunctionNames() method. By default
only Javascript functions are listed.listAllScripts - true if all script methods are returnedboolean isListingAllScriptTypes()
XULDocument.getFunctionNames() method. By default
only Javascript functions are listed.XULDocument.getFunctionNames() methodvoid setScriptsLoadingType(short type)
type - the scripts loading typeshort getScriptsLoadingType()
default boolean hasGlobalScript(java.net.URL url)
getScriptsLoadingType() is LOADING_LOCAL.url - the URLjava.util.Map<java.net.URL,ScriptHandle> getGlobalScripts()
void addManagerListener(ScriptManagerListener listener)
listener - the listenerjava.util.List<ScriptManagerListener> getListeners()
void removeManagerListener(ScriptManagerListener listener)
listener - the listenervoid setActive(boolean active)
active - true if the manager is activatedboolean isActive()
javax.swing.JMenuBar getMenuBar()
java.util.List<javax.swing.JToolBar> getToolBars()
default boolean addScript(java.net.URL script)
script - the script URLdefault boolean addScript(java.net.URL script,
XULDocument xuldoc)
script - the script URLxuldoc - the XUL document on which the script must be addeddefault boolean addScript(java.lang.String mime,
java.net.URL script)
mime - the MIME typescript - the script URLdefault boolean addScript(java.lang.String mime,
java.net.URL script,
ScriptFactory fac)
mime - the MIME typescript - the script URLfac - the ScriptFactorydefault boolean addScript(java.lang.String mime,
java.net.URL script,
XULDocument xuldoc)
mime - the MIME typescript - the script URLxuldoc - the XUL document on which the script must be addedboolean addScript(java.lang.String mime,
java.net.URL script,
XULDocument xuldoc,
ScriptFactory fac)
mime - the MIME typescript - the script URLxuldoc - the XUL document on which the script must be addedfac - the script factorydefault java.lang.Object evalScript(java.lang.String scriptMethod)
scriptMethod - the Script method namejava.lang.Object evalScript(java.lang.String scriptMethod,
java.lang.Object... args)
scriptMethod - the Script method nameargs - the argumentsjava.util.Map<org.scripthelper.model.ScriptSource,ScriptHandle> getScripts()
XULWidget getCurrentWidget()
default XULWindow getCurrentWindow()
void setCurrentWidget(XULWidget widget)
widget - the widget from which the last user event originatesXULDocument getCurrentDocument()
java.util.Map<java.lang.String,java.util.Map<org.scripthelper.model.CachedMethodKey,org.scripthelper.model.ScriptWrapper<?>>> getCallSites()
void setScriptListener(ScriptListener listener)
listener - the script listenerScriptListener getScriptListener()
XULDocument addXULScript(java.io.File file)
file - the XUL FileXULDocument addXULScript(java.net.URL xulscript)
xulscript - the XUL Filedefault XULDocument addXULScript(java.lang.String name, java.io.File xulscript)
name - the script namexulscript - the XUL FileXULDocument addXULScript(java.lang.String name, java.net.URL xulscript)
name - the script namexulscript - the XUL Filejava.util.Map<java.lang.String,XULDocument> getXULScripts()
boolean hasXULScript(java.lang.String scriptName)
scriptName - the script namevoid removeXULScript(java.lang.String name)
name - the script namevoid setScriptContext(XULScriptContext context)
context - the script contextXULScriptContext getScriptContext()
void setScriptExceptionListener(org.scripthelper.exceptions.ScriptExceptionListener exceptionListener)
exceptionListener - the script exception listenerorg.scripthelper.exceptions.ScriptExceptionListener getScriptExceptionListener()
void setScriptLogger(org.scripthelper.context.ScriptLogger scriptLogger)
scriptLogger - the script loggerorg.scripthelper.context.ScriptLogger getScriptLogger()
void setParserErrorReporter(ParserErrorReporter errorReporter)
errorReporter - the parser error reporterParserErrorReporter getParserErrorReporter()
Copyright © 2008-2020 Herve Girod. All Rights Reserved. Documentation and source under the LGPL licence