public class XULDocument extends AbstractJSScriptContext implements XULExecutorListener, XULScript, XULConstants
It is also able to process external beanshell scripts.
compToNames, currentScript, isActive, listener, PAT_FUNCTION, scriptsCONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTALIGN, CHECKED, CLASS, COLS, CURPOS, CURRENTINDEX, CURRENTITEM, DECIMALPLACES, DIALOGTYPE, DIRECTORY, DISABLED, DOCUMENT, EDITABLE, EDITING_COLUMN, EDITING_ROW, EXTENSIONS, HEIGHT, HIDDEN, HORIZONTAL, ID, IMAGE, INCREMENT, ITEMCOUNT, LABEL, LEFT, MAX, MAX_HEIGHT, MAX_WIDTH, MAXPOS, MIN, MIN_HEIGHT, MIN_WIDTH, MODE, MULTILINE, ORIENT, PAGEINCREMENT, RESIZABLE, ROWS, SCREENX, SCREENY, SELECTED, SELECTEDINDEX, SRC, STYLE, TITLE, TOOLTIPTEXT, TOP, TYPE, VALUE, VERTICAL, VIEW, WIDTH, WINDOW, WRAP| Constructor and Description |
|---|
XULDocument() |
XULDocument(java.lang.String name,
java.net.URL url) |
XULDocument(java.lang.String name,
java.net.URL url,
org.w3c.dom.Document doc) |
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(java.lang.String widgetID,
XULActionListener listener)
Add an action listener on a XUL widget ID.
|
void |
addActionListener(XULActionListener listener)
Add a XULActionListener to the underlying root component.
|
void |
addWidget(XULWidget widget)
Add a widget to the document.
|
void |
alert(java.lang.String arg)
The "print(String)" builtin Javascript function.
|
int |
countScripts()
Count the number of scripts in the document.
|
javax.swing.JMenuBar |
createMenuBar()
Create a menubar for the window.
|
java.util.List<javax.swing.JToolBar> |
createToolBars()
Create the list of toolbars for the window.
|
java.lang.Object |
execute(java.lang.String functionName,
java.lang.Object arg)
Execute a Javascript method for this XULDocument, with only one argument.
|
java.lang.Object |
execute(java.lang.String functionName,
java.lang.Object[] args)
Execute a Javascript method for this XULDocument, with two arguments.
|
java.lang.Object |
execute(java.lang.String functionName,
XULWidget parent,
XULWidget child)
Execute a Javascript method for this XULDocument, with only one argument.
|
protected void |
fireListeners(XULWidget widget,
XULActionEvent event)
Fire the listeners for an action event.
|
java.lang.Object |
get(java.lang.String property)
Return a live property value at the Javascript level.
|
java.net.URL |
getBaseDir() |
java.util.Map<java.lang.String,java.util.Map<org.scripthelper.model.CachedMethodKey,org.scripthelper.model.ScriptWrapper<?>>> |
getCallSites()
Return the call sites for this document.
|
java.lang.String |
getClassName() |
CSSManager |
getCSS()
Return the CSS manager.
|
XULWidget |
getCurrentWidget()
Return the current widget.
|
XULWindow |
getCurrentWindow()
Return the current window.
|
org.w3c.dom.Document |
getDocument()
Return the associated DOM document.
|
java.lang.Class<? extends org.mozilla.javascript.ScriptableObject> |
getExecutorClass() |
java.io.File |
getFile()
Return the associated file.
|
java.util.Map<java.lang.String,ScriptHandle> |
getFunctionNames()
Return the function names which can be executed in the document.
|
java.lang.String[] |
getFunctionProperties()
Define the two builtin Javascript functions.
|
java.lang.String |
getName()
Return the script name.
|
java.util.Map<java.net.URL,java.lang.String> |
getNotExistingScripts() |
java.lang.String[] |
getObjectNames() |
XULSwingPanel |
getRootComponent()
Return the root component.
|
ScriptManager |
getScriptManager()
Return the script manager.
|
java.net.URL |
getURL()
Return the document URL.
|
XULWidget |
getWidget(java.lang.String elementId)
Return the widget of the corresponding Id.
|
java.util.Map<org.w3c.dom.Element,XULWidget> |
getWidgets()
Return the widgets which have an ID in the XUL Document.
|
XULWindow |
getWindow()
Return the window.
|
XULExecutor |
getXULExecutor()
Return the document-level executor for all Javascript methods on the
"document" prototype.
|
boolean |
hasNotExistingScripts() |
void |
print(java.lang.String arg)
The "print(String)" builtin Javascript function.
|
void |
removeActionListener(java.lang.String widgetID,
XULActionListener listener)
Remove an action listener on a XUL widget ID.
|
void |
removeActionListener(XULActionListener listener)
Remove an XULActionListener from the underlying root component.
|
java.lang.Object |
runExternalMethod(java.lang.String name,
java.lang.Object args) |
void |
set(java.lang.String property,
java.lang.Object value)
Set a live property value at the Javascript level.
|
void |
setActive(boolean isActive)
Set the context as active or inactive.
|
void |
setCountScripts(int countScripts)
Set the number of scripts in the document.
|
void |
setCSS(CSSManager css)
Set the CSS manager.
|
void |
setDocument(org.w3c.dom.Document doc)
Set the associated DOM.
|
void |
setNotExistingScripts(java.util.Map<java.net.URL,java.lang.String> notExistingScripts) |
void |
setRootComponent(XULSwingPanel root)
Set the root Swing component associated with this document.
|
void |
setScriptManager(ScriptManager scriptManager)
Set the script manager.
|
void |
setupScripts()
Setup the scripts.
|
void |
setWidgets(java.util.Map<org.w3c.dom.Element,XULWidget> widgets)
Set widgets which have an ID in the XUL Document.
|
void |
setWindow(XULWindow window)
Set the window.
|
addScript, alert, getCurrentScript, getScriptListener, getScripts, getScriptsForClass, handleComponentAdjust, handleComponentChange, handleComponentChange, handleComponentCommand, handleComponentHover, handleComponentOut, handleComponentSelected, handleWindowLoad, isActive, removeScript, runFunction, setComponentsToNames, setScriptListeneraddExternalFunction, createJSContext, defineBuiltIntFunctions, defineExternalFunctions, defineFunctionProperties, getDefinedClasses, getExecutorInstance, getExecutorInstancesMap, getJSContext, jsFunction_call, runScriptMethod, setContext, setDefinedClassesapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizepublic XULDocument()
public XULDocument(java.lang.String name,
java.net.URL url)
public XULDocument(java.lang.String name,
java.net.URL url,
org.w3c.dom.Document doc)
public void setScriptManager(ScriptManager scriptManager)
scriptManager - the script managerpublic ScriptManager getScriptManager()
getScriptManager in class AbstractJSScriptContextpublic void setCSS(CSSManager css)
css - the CSS managerpublic CSSManager getCSS()
public void setDocument(org.w3c.dom.Document doc)
doc - the associated DOMpublic void setRootComponent(XULSwingPanel root)
root - the root componentpublic void setWindow(XULWindow window)
window - the windowpublic XULWindow getWindow()
public int countScripts()
public void setCountScripts(int countScripts)
countScripts - the number of scriptspublic javax.swing.JMenuBar createMenuBar()
public java.util.List<javax.swing.JToolBar> createToolBars()
public java.lang.String getName()
public java.lang.Class<? extends org.mozilla.javascript.ScriptableObject> getExecutorClass()
getExecutorClass in interface org.scripthelper.js.JSScriptablepublic org.w3c.dom.Document getDocument()
public java.net.URL getURL()
public java.util.Map<java.lang.String,ScriptHandle> getFunctionNames()
public void setActive(boolean isActive)
setActive in class AbstractJSScriptContextisActive - true if the context must be activepublic void addActionListener(java.lang.String widgetID,
XULActionListener listener)
widgetID - the widget IDlistener - the listenerpublic void addActionListener(XULActionListener listener)
listener - the listenerpublic void removeActionListener(XULActionListener listener)
listener - the listenerpublic void removeActionListener(java.lang.String widgetID,
XULActionListener listener)
widgetID - the widget IDlistener - the listenerprotected void fireListeners(XULWidget widget, XULActionEvent event)
fireListeners in class AbstractJSScriptContextwidget - the widgetevent - the eventpublic java.util.Map<java.lang.String,java.util.Map<org.scripthelper.model.CachedMethodKey,org.scripthelper.model.ScriptWrapper<?>>> getCallSites()
public void setupScripts()
public java.io.File getFile()
public void addWidget(XULWidget widget)
widget - the widgetpublic XULExecutor getXULExecutor()
public java.net.URL getBaseDir()
public void setNotExistingScripts(java.util.Map<java.net.URL,java.lang.String> notExistingScripts)
public java.util.Map<java.net.URL,java.lang.String> getNotExistingScripts()
public boolean hasNotExistingScripts()
public java.lang.String getClassName()
getClassName in interface org.mozilla.javascript.ScriptablegetClassName in class org.scripthelper.js.AbstractJSScriptablepublic java.lang.String[] getFunctionProperties()
print(String), which prints in the loggeralert(String), which shows an alert popupgetFunctionProperties in interface org.scripthelper.js.JSScriptablegetFunctionProperties in class AbstractJSScriptContextpublic void print(java.lang.String arg)
print in class AbstractJSScriptContextarg - the String argumentpublic void alert(java.lang.String arg)
arg - the String argumentpublic java.lang.String[] getObjectNames()
getObjectNames in interface org.scripthelper.js.JSScriptablepublic XULSwingPanel getRootComponent()
getRootComponent in class AbstractJSScriptContextpublic XULWindow getCurrentWindow()
public XULWidget getCurrentWidget()
public void setWidgets(java.util.Map<org.w3c.dom.Element,XULWidget> widgets)
widgets - the widgetspublic java.util.Map<org.w3c.dom.Element,XULWidget> getWidgets()
public XULWidget getWidget(java.lang.String elementId)
public java.lang.Object get(java.lang.String property)
XULExecutor enclosing
class.get in interface XULExecutorListenerproperty - the property namepublic void set(java.lang.String property,
java.lang.Object value)
XULExecutor enclosing
class.set in interface XULExecutorListenerproperty - the property namevalue - the property valuepublic java.lang.Object execute(java.lang.String functionName,
java.lang.Object[] args)
execute in interface org.scripthelper.js.JSScriptableexecute in interface XULExecutorListenerfunctionName - the function nameargs - the argumentspublic java.lang.Object runExternalMethod(java.lang.String name,
java.lang.Object args)
public java.lang.Object execute(java.lang.String functionName,
java.lang.Object arg)
execute("jsFunction_getElementById", String)execute in interface XULExecutorListenerfunctionName - the javascript function name, with the prefixarg - the argumentXULExecutor enclosed in this XULDocumentpublic java.lang.Object execute(java.lang.String functionName,
XULWidget parent,
XULWidget child)
execute("jsFunction_getElementById", String)functionName - the javascript function name, with the prefixparent - the parentchild - the childXULExecutor enclosed in this XULDocumentCopyright © 2008-2020 Herve Girod. All Rights Reserved. Documentation and source under the LGPL licence