| java.lang.Object org.directwebremoting.proxy.io.Context jsx3.lang.Object jsx3.gui.Interactive
Interactive | public class Interactive extends jsx3.lang.Object (Code) | | Mixin interface. Provides functionality to subclasses of jsx3.gui.Painted that allows them to publish model
events.
Note that this class requires that implementors of this class extends the jsx3.gui.Painted class and
implement the jsx3.util.EventDispatcher interface
author: Joe Walker [joe at getahead dot org] author: DRAPGEN - Dwr Reverse Ajax Proxy GENerator |
Method Summary | |
public jsx3.lang.Object | doEvent(String strType, jsx3.lang.Object objContext) Publishes a model event. | public T | doEvent(String strType, jsx3.lang.Object objContext, Class<T> returnType) Publishes a model event. | public void | getCanDrag(org.directwebremoting.proxy.Callback<Integer> callback) Returns whether is object supports programmatic drag, meanining it will allow any contained item to be
dragged and dropped on another container supporting drop. | public void | getCanDrop(org.directwebremoting.proxy.Callback<Integer> callback) Returns whether this object can be the target of a drop event. | public void | getCanMove(org.directwebremoting.proxy.Callback<Integer> callback) Returns whether is object can be moved around the screen (this is not the same as drag/drop). | public void | getCanSpy(org.directwebremoting.proxy.Callback<Integer> callback) Returns whether is object can be spyglassed. | public void | getEvent(String strType, org.directwebremoting.proxy.Callback<String> callback) Returns the event script registered for the given event type. | public jsx3.lang.Object | getEvents() Returns the associative array containing all the registered event script of this object. | public T | getEvents(Class<T> returnType) Returns the associative array containing all the registered event script of this object. | public void | getMenu(org.directwebremoting.proxy.Callback<String> callback) Returns the name of the jsx3.gui.Menu instance to display (as a context menu) when a user
clicks on this object with the right button. | public void | hasEvent(String strType, org.directwebremoting.proxy.Callback<String> callback) Returns true if there is a event script registered for the given event type. | public jsx3.gui.HotKey | registerHotKey(org.directwebremoting.proxy.CodeBlock vntCallback, String vntKey, boolean bShift, boolean bControl, boolean bAlt) Registers a hot key with this JSX model node. | public jsx3.gui.HotKey | registerHotKey(jsx3.gui.HotKey vntCallback, String vntKey, boolean bShift, boolean bControl, boolean bAlt) Registers a hot key with this JSX model node. | public jsx3.gui.HotKey | registerHotKey(jsx3.gui.HotKey vntCallback, int vntKey, boolean bShift, boolean bControl, boolean bAlt) Registers a hot key with this JSX model node. | public jsx3.gui.HotKey | registerHotKey(org.directwebremoting.proxy.CodeBlock vntCallback, int vntKey, boolean bShift, boolean bControl, boolean bAlt) Registers a hot key with this JSX model node. | public jsx3.gui.HotKey | registerHotKey(String vntCallback, int vntKey, boolean bShift, boolean bControl, boolean bAlt) Registers a hot key with this JSX model node. | public jsx3.gui.HotKey | registerHotKey(String vntCallback, String vntKey, boolean bShift, boolean bControl, boolean bAlt) Registers a hot key with this JSX model node. | public jsx3.gui.Interactive | removeEvent(String strType) Removes an event script registered for the given model event type. | public T | removeEvent(String strType, Class<T> returnType) Removes an event script registered for the given model event type. | public jsx3.gui.Interactive | removeEvents() Removes all events scripts registered with this object. | public T | removeEvents(Class<T> returnType) Removes all events scripts registered with this object. | public jsx3.gui.Interactive | setCanDrag(int bDrag) Sets whether is object supports programmatic drag, meanining it will allow any contained item to be dragged/dropped. | public jsx3.gui.Interactive | setCanDrop(int bDrop) Sets whether this object can be the target of a drop event. | public jsx3.gui.Interactive | setCanMove(int bMovable) Sets whether is object can be moved around the screen (this is not the same as drag/drop). | public jsx3.gui.Interactive | setCanSpy(int bSpy) Sets whether is object can be spyglassed. | public jsx3.gui.Interactive | setEvent(String strScript, String strType) Programmatically sets an event of this instance. | public jsx3.gui.Interactive | setMenu(String strMenu) Sets the name of the jsx3.gui.Menu instance to display when a user
clicks on this object with the right button. | public void | setSpyStyles(String strCSS) Sets the CSS definition to apply to an HTML element when a spyglass is shown for that element
Parameters: strCSS - valid CSS. | public void | showSpy(String strHTML, jsx3.gui.Event intLeft, int intTop) called by 'window.setTimeout()' to display the spyglass hover for a given object;
Parameters: strHTML - HTML/text to display in the spyglass; as the spyglass does not define a height/width, this content willhave improved layout if it specifies a preferred width in its in-line-style or referenced-css rule. Parameters: intLeft - use an integer to specify an on-screen location; otherwise, use a jsx3.gui.Event instance to have the system automatically calculate the x/y position. Parameters: intTop - use an integer if intLeft also uses an integer. | public void | showSpy(String strHTML, int intLeft, int intTop) called by 'window.setTimeout()' to display the spyglass hover for a given object;
Parameters: strHTML - HTML/text to display in the spyglass; as the spyglass does not define a height/width, this content willhave improved layout if it specifies a preferred width in its in-line-style or referenced-css rule. Parameters: intLeft - use an integer to specify an on-screen location; otherwise, use a jsx3.gui.Event instance to have the system automatically calculate the x/y position. Parameters: intTop - use an integer if intLeft also uses an integer. |
AFTER_RESIZE_VIEW | final public static String AFTER_RESIZE_VIEW(Code) | | |
JSXDOUBLECLICK | final public static String JSXDOUBLECLICK(Code) | | |
Interactive | public Interactive(Context context, String extension, ScriptProxy scriptProxy)(Code) | | All reverse ajax proxies need context to work from
Parameters: scriptProxy - The place we are writing scripts to Parameters: context - The script that got us to where we are now |
doEvent | public jsx3.lang.Object doEvent(String strType, jsx3.lang.Object objContext)(Code) | | Publishes a model event. This method both evaluates any registered event script for the given event type
and publishes the event through the EventDispatcher interface. This method ensures that any
registered event script is executed in isolation to prevent most side effects.
Parameters: strType - the event type, one of the model event types defined as static fields in this class Parameters: objContext - JavaScript object array with name/value pairs that provide a localvariable stack for the execution of the event script. This argument is also passed as the context property of the event object that is published through the EventDispatcher interface. the result of evaluating the event script or null if not event script is registered |
doEvent | public T doEvent(String strType, jsx3.lang.Object objContext, Class<T> returnType)(Code) | | Publishes a model event. This method both evaluates any registered event script for the given event type
and publishes the event through the EventDispatcher interface. This method ensures that any
registered event script is executed in isolation to prevent most side effects.
Parameters: strType - the event type, one of the model event types defined as static fields in this class Parameters: objContext - JavaScript object array with name/value pairs that provide a localvariable stack for the execution of the event script. This argument is also passed as the context property of the event object that is published through the EventDispatcher interface. Parameters: returnType - The expected return type the result of evaluating the event script or null if not event script is registered |
getCanDrag | public void getCanDrag(org.directwebremoting.proxy.Callback<Integer> callback)(Code) | | Returns whether is object supports programmatic drag, meanining it will allow any contained item to be
dragged and dropped on another container supporting drop.
Parameters: callback - jsx3.Boolean.TRUE or jsx3.Boolean.FALSE |
getCanMove | public void getCanMove(org.directwebremoting.proxy.Callback<Integer> callback)(Code) | | Returns whether is object can be moved around the screen (this is not the same as drag/drop).
Parameters: callback - jsx3.Boolean.TRUE or jsx3.Boolean.FALSE |
getEvent | public void getEvent(String strType, org.directwebremoting.proxy.Callback<String> callback)(Code) | | Returns the event script registered for the given event type. This script could have been set by the
setEvent() method or during component deserialization.
Parameters: strType - the event type, one of the model event types defined as static fields in this class Parameters: callback - the JavaScript event script |
getEvents | public jsx3.lang.Object getEvents()(Code) | | Returns the associative array containing all the registered event script of this object. This method returns
the instance field itself and not a copy.
an associative array mapping event type to event script |
getEvents | public T getEvents(Class<T> returnType)(Code) | | Returns the associative array containing all the registered event script of this object. This method returns
the instance field itself and not a copy.
Parameters: returnType - The expected return type an associative array mapping event type to event script |
hasEvent | public void hasEvent(String strType, org.directwebremoting.proxy.Callback<String> callback)(Code) | | Returns true if there is a event script registered for the given event type.
Parameters: strType - the event type, one of the model event types defined as static fields in this class Parameters: callback - the JavaScript event script |
registerHotKey | public jsx3.gui.HotKey registerHotKey(org.directwebremoting.proxy.CodeBlock vntCallback, String vntKey, boolean bShift, boolean bControl, boolean bAlt)(Code) | | Registers a hot key with this JSX model node. All keydown events that bubble up to this object
will be checked against the hot key. If an event matches, the callback function will execute and the event
bubble will be canceled.
If the four parameters vntKey, bShift, bControl, and bAlt
match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
function (the most recently registered) will be executed by a single keydown event.
Parameters: vntCallback - either a function, or the name of a method bound to this object.When a keydown event bubbles up to this object that matches the hot key created by this method, this functionis called on this object. If this function returns false then this hot key will not cancel thekey event. This parameter can also be an instance of HotKey , in which case allother parameters are ignored. Parameters: vntKey - if this parameter is a String, the hot key matches that key (the keycode to match isdetermined by HotKey.keyDownCharToCode() ). If it is an integer, the hot key will match thatkeycode value. Parameters: bShift - if not null the shift key state of the keydown event must match this valueto invoke the hot key. Parameters: bControl - if not null the control key state of the keydown event must match this valueto invoke the hot key. Parameters: bAlt - if not null the alt key state of the keydown event must match this valueto invoke the hot key. the registered hot key. |
registerHotKey | public jsx3.gui.HotKey registerHotKey(jsx3.gui.HotKey vntCallback, String vntKey, boolean bShift, boolean bControl, boolean bAlt)(Code) | | Registers a hot key with this JSX model node. All keydown events that bubble up to this object
will be checked against the hot key. If an event matches, the callback function will execute and the event
bubble will be canceled.
If the four parameters vntKey, bShift, bControl, and bAlt
match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
function (the most recently registered) will be executed by a single keydown event.
Parameters: vntCallback - either a function, or the name of a method bound to this object.When a keydown event bubbles up to this object that matches the hot key created by this method, this functionis called on this object. If this function returns false then this hot key will not cancel thekey event. This parameter can also be an instance of HotKey , in which case allother parameters are ignored. Parameters: vntKey - if this parameter is a String, the hot key matches that key (the keycode to match isdetermined by HotKey.keyDownCharToCode() ). If it is an integer, the hot key will match thatkeycode value. Parameters: bShift - if not null the shift key state of the keydown event must match this valueto invoke the hot key. Parameters: bControl - if not null the control key state of the keydown event must match this valueto invoke the hot key. Parameters: bAlt - if not null the alt key state of the keydown event must match this valueto invoke the hot key. the registered hot key. |
registerHotKey | public jsx3.gui.HotKey registerHotKey(jsx3.gui.HotKey vntCallback, int vntKey, boolean bShift, boolean bControl, boolean bAlt)(Code) | | Registers a hot key with this JSX model node. All keydown events that bubble up to this object
will be checked against the hot key. If an event matches, the callback function will execute and the event
bubble will be canceled.
If the four parameters vntKey, bShift, bControl, and bAlt
match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
function (the most recently registered) will be executed by a single keydown event.
Parameters: vntCallback - either a function, or the name of a method bound to this object.When a keydown event bubbles up to this object that matches the hot key created by this method, this functionis called on this object. If this function returns false then this hot key will not cancel thekey event. This parameter can also be an instance of HotKey , in which case allother parameters are ignored. Parameters: vntKey - if this parameter is a String, the hot key matches that key (the keycode to match isdetermined by HotKey.keyDownCharToCode() ). If it is an integer, the hot key will match thatkeycode value. Parameters: bShift - if not null the shift key state of the keydown event must match this valueto invoke the hot key. Parameters: bControl - if not null the control key state of the keydown event must match this valueto invoke the hot key. Parameters: bAlt - if not null the alt key state of the keydown event must match this valueto invoke the hot key. the registered hot key. |
registerHotKey | public jsx3.gui.HotKey registerHotKey(org.directwebremoting.proxy.CodeBlock vntCallback, int vntKey, boolean bShift, boolean bControl, boolean bAlt)(Code) | | Registers a hot key with this JSX model node. All keydown events that bubble up to this object
will be checked against the hot key. If an event matches, the callback function will execute and the event
bubble will be canceled.
If the four parameters vntKey, bShift, bControl, and bAlt
match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
function (the most recently registered) will be executed by a single keydown event.
Parameters: vntCallback - either a function, or the name of a method bound to this object.When a keydown event bubbles up to this object that matches the hot key created by this method, this functionis called on this object. If this function returns false then this hot key will not cancel thekey event. This parameter can also be an instance of HotKey , in which case allother parameters are ignored. Parameters: vntKey - if this parameter is a String, the hot key matches that key (the keycode to match isdetermined by HotKey.keyDownCharToCode() ). If it is an integer, the hot key will match thatkeycode value. Parameters: bShift - if not null the shift key state of the keydown event must match this valueto invoke the hot key. Parameters: bControl - if not null the control key state of the keydown event must match this valueto invoke the hot key. Parameters: bAlt - if not null the alt key state of the keydown event must match this valueto invoke the hot key. the registered hot key. |
registerHotKey | public jsx3.gui.HotKey registerHotKey(String vntCallback, int vntKey, boolean bShift, boolean bControl, boolean bAlt)(Code) | | Registers a hot key with this JSX model node. All keydown events that bubble up to this object
will be checked against the hot key. If an event matches, the callback function will execute and the event
bubble will be canceled.
If the four parameters vntKey, bShift, bControl, and bAlt
match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
function (the most recently registered) will be executed by a single keydown event.
Parameters: vntCallback - either a function, or the name of a method bound to this object.When a keydown event bubbles up to this object that matches the hot key created by this method, this functionis called on this object. If this function returns false then this hot key will not cancel thekey event. This parameter can also be an instance of HotKey , in which case allother parameters are ignored. Parameters: vntKey - if this parameter is a String, the hot key matches that key (the keycode to match isdetermined by HotKey.keyDownCharToCode() ). If it is an integer, the hot key will match thatkeycode value. Parameters: bShift - if not null the shift key state of the keydown event must match this valueto invoke the hot key. Parameters: bControl - if not null the control key state of the keydown event must match this valueto invoke the hot key. Parameters: bAlt - if not null the alt key state of the keydown event must match this valueto invoke the hot key. the registered hot key. |
registerHotKey | public jsx3.gui.HotKey registerHotKey(String vntCallback, String vntKey, boolean bShift, boolean bControl, boolean bAlt)(Code) | | Registers a hot key with this JSX model node. All keydown events that bubble up to this object
will be checked against the hot key. If an event matches, the callback function will execute and the event
bubble will be canceled.
If the four parameters vntKey, bShift, bControl, and bAlt
match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
function (the most recently registered) will be executed by a single keydown event.
Parameters: vntCallback - either a function, or the name of a method bound to this object.When a keydown event bubbles up to this object that matches the hot key created by this method, this functionis called on this object. If this function returns false then this hot key will not cancel thekey event. This parameter can also be an instance of HotKey , in which case allother parameters are ignored. Parameters: vntKey - if this parameter is a String, the hot key matches that key (the keycode to match isdetermined by HotKey.keyDownCharToCode() ). If it is an integer, the hot key will match thatkeycode value. Parameters: bShift - if not null the shift key state of the keydown event must match this valueto invoke the hot key. Parameters: bControl - if not null the control key state of the keydown event must match this valueto invoke the hot key. Parameters: bAlt - if not null the alt key state of the keydown event must match this valueto invoke the hot key. the registered hot key. |
removeEvent | public jsx3.gui.Interactive removeEvent(String strType)(Code) | | Removes an event script registered for the given model event type.
Parameters: strType - the event type, one of the model event types defined as static fields in this class this object |
removeEvent | public T removeEvent(String strType, Class<T> returnType)(Code) | | Removes an event script registered for the given model event type.
Parameters: strType - the event type, one of the model event types defined as static fields in this class Parameters: returnType - The expected return type this object |
removeEvents | public T removeEvents(Class<T> returnType)(Code) | | Removes all events scripts registered with this object.
Parameters: returnType - The expected return type this object |
setCanDrag | public jsx3.gui.Interactive setCanDrag(int bDrag)(Code) | | Sets whether is object supports programmatic drag, meanining it will allow any contained item to be dragged/dropped.
Implementing classes can decide whether to consult this value or ignore it.
Parameters: bDrag - jsx3.Boolean.TRUE or jsx3.Boolean.FALSE this object |
setCanDrop | public jsx3.gui.Interactive setCanDrop(int bDrop)(Code) | | Sets whether this object can be the target of a drop event. Implementing classes can decide whether to consult
this value or ignore it.
Parameters: bDrop - jsx3.Boolean.TRUE or jsx3.Boolean.FALSE this object |
setCanMove | public jsx3.gui.Interactive setCanMove(int bMovable)(Code) | | Sets whether is object can be moved around the screen (this is not the same as drag/drop). Implementing classes
can decide whether to consult this value or ignore it.
Parameters: bMovable - jsx3.Boolean.TRUE or jsx3.Boolean.FALSE this object |
setCanSpy | public jsx3.gui.Interactive setCanSpy(int bSpy)(Code) | | Sets whether is object can be spyglassed. Implementing classes can decide whether to consult
this value or ignore it.
Parameters: bSpy - jsx3.Boolean.TRUE or jsx3.Boolean.FALSE this object |
setEvent | public jsx3.gui.Interactive setEvent(String strScript, String strType)(Code) | | Programmatically sets an event of this instance. Sets the script that will execute when this object publishes
a model event. The script value will be saved in the serialization file of a component. Not all classes that
implement this interface will publish events of every type. Consult the documentation of a class for a
description of the events it publishes.
For programmatic registering of event handlers when persistence in a serialization file is not required,
consider using jsx3.util.EventDispatcher.subscribe() instead of this method. Whenever a model
event is published, it is published using the EventDispatcher interface as well as by executing
any registered event script.
Parameters: strScript - the actual JavaScript code that will execute when the given event is published.For example: obj.setEvent("alert('hello.');", jsx3.gui.Interactive.EXECUTE); Parameters: strType - the event type. Must be one of the model event types defined as static fields in this class reference to this |
setMenu | public jsx3.gui.Interactive setMenu(String strMenu)(Code) | | Sets the name of the jsx3.gui.Menu instance to display when a user
clicks on this object with the right button. The name is a pointer by-name to a JSX object in the same server.
Parameters: strMenu - name or id (jsxname or jsxid) of the context menu this object |
setSpyStyles | public void setSpyStyles(String strCSS)(Code) | | Sets the CSS definition to apply to an HTML element when a spyglass is shown for that element
Parameters: strCSS - valid CSS. For example, text-decoration:underline;color:red; |
showSpy | public void showSpy(String strHTML, jsx3.gui.Event intLeft, int intTop)(Code) | | called by 'window.setTimeout()' to display the spyglass hover for a given object;
Parameters: strHTML - HTML/text to display in the spyglass; as the spyglass does not define a height/width, this content willhave improved layout if it specifies a preferred width in its in-line-style or referenced-css rule. Parameters: intLeft - use an integer to specify an on-screen location; otherwise, use a jsx3.gui.Event instance to have the system automatically calculate the x/y position. Parameters: intTop - use an integer if intLeft also uses an integer. Otherwise, use null. |
showSpy | public void showSpy(String strHTML, int intLeft, int intTop)(Code) | | called by 'window.setTimeout()' to display the spyglass hover for a given object;
Parameters: strHTML - HTML/text to display in the spyglass; as the spyglass does not define a height/width, this content willhave improved layout if it specifies a preferred width in its in-line-style or referenced-css rule. Parameters: intLeft - use an integer to specify an on-screen location; otherwise, use a jsx3.gui.Event instance to have the system automatically calculate the x/y position. Parameters: intTop - use an integer if intLeft also uses an integer. Otherwise, use null. |
Methods inherited from jsx3.lang.Object | public void ignoreReturn()(Code)(Java Doc)
|
|
|