|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectice.storm.CallbackAdapter
Default implementation of ViewportCallback and ScripterCallback interfaces. If new methods would be added to ViewportCallback or ScripterCallback, this class would provide a default implementation for them.
ViewportCallback,
ScripterCallback| Constructor Summary | |
CallbackAdapter()
|
|
| Method Summary | |
boolean |
allowScriptClose(Viewport vp,
boolean openedByScript)
Query application if script should be able to close top-level window. |
static BoxedCode |
box_allowScriptClose(ScripterCallback sc,
Viewport vp,
boolean openedByScript)
|
static BoxedCode |
box_createTopLevelContainer(ViewportCallback viewportCallback,
Viewport vp)
|
static BoxedCode |
box_disposeTopLevelContainer(ViewportCallback viewportCallback,
Viewport vp)
|
static BoxedCode |
box_getMaxScriptRunningTime(ScripterCallback sc)
|
static BoxedCode |
box_interruptLongRunningScript(ScripterCallback sc,
Viewport vp,
long scriptRunTime)
|
static BoxedCode |
box_reportScriptError(ScripterCallback sc,
Viewport vp,
boolean justWarning,
String errorMessage,
String url,
int lineNumber,
String lineSource,
int lineOffset)
|
static BoxedCode |
box_scriptAlert(ScripterCallback sc,
Viewport vp,
String msg)
|
static BoxedCode |
box_scriptConfirm(ScripterCallback sc,
Viewport vp,
String msg)
|
static BoxedCode |
box_scriptPrint(ScripterCallback sc,
Viewport vp)
|
static BoxedCode |
box_scriptPrompt(ScripterCallback sc,
Viewport vp,
String msg,
String defVal)
|
Container |
createTopLevelContainer(Viewport vp)
Create a new top-level browser window and return an awt container that can be used by StormBase for placing pilots. |
void |
disposeTopLevelContainer(Viewport vp)
When the StormBase wants to close the viewport, the application is notified about this so it can terminate the browser window associated with this viewport. |
long |
getMaxScriptRunningTime()
Maximum time in milliseconds for script to run on the event thread. |
void |
init(StormBase base)
When the callback is given to StormBase, it initializes the callback with this call. |
boolean |
interruptLongRunningScript(Viewport vp,
long scriptRunTime)
Notify about long running script that blocks user input. |
void |
processViewportMessage(Viewport view,
String messageName,
Object addArg,
Object value)
|
void |
registerWith(StormBase storm)
Register with storm as viewport and scripter callback. |
void |
reportScriptError(Viewport vp,
boolean justWarning,
String errorMessage,
String url,
int lineNumber,
String lineSource,
int lineOffset)
Notify about errors during script execution. |
void |
scriptAlert(Viewport vp,
String msg)
Implement script alert method |
boolean |
scriptConfirm(Viewport vp,
String msg)
Implement script confirm method |
void |
scriptPrint(Viewport vp)
Implement script print method |
String |
scriptPrompt(Viewport vp,
String msg,
String defVal)
Implement script prompt method |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CallbackAdapter()
| Method Detail |
public void init(StormBase base)
ViewportCallback
init in interface ViewportCallbackViewportCallback.init(ice.storm.StormBase)public Container createTopLevelContainer(Viewport vp)
ViewportCallback
createTopLevelContainer in interface ViewportCallbackvp - the viewport that will be associated
with this awt container. The viewport object may contain
some parameters describing how the new browser window should
look like (for example, from window.open() in JavaScript)
ViewportCallback.createTopLevelContainer(ice.storm.Viewport)public void disposeTopLevelContainer(Viewport vp)
ViewportCallback
disposeTopLevelContainer in interface ViewportCallbackViewportCallback.disposeTopLevelContainer(ice.storm.Viewport)
public void processViewportMessage(Viewport view,
String messageName,
Object addArg,
Object value)
processViewportMessage in interface ViewportCallbackViewportCallback.processViewportMessage(ice.storm.Viewport, java.lang.String, java.lang.Object, java.lang.Object)public long getMaxScriptRunningTime()
ScripterCallback
getMaxScriptRunningTime in interface ScripterCallbackinterruptLongRunningScript. If returns 0, monitoring of long running scripts would be disabled.ScripterCallback.getMaxScriptRunningTime()
public boolean interruptLongRunningScript(Viewport vp,
long scriptRunTime)
ScripterCallbackgetMaxScriptRunningTime. The script would be terminated if the method returns true. A possible way to implement the method is to present to a user a dialog asking to terminate or continue the long running script.
interruptLongRunningScript in interface ScripterCallbackvp - Viewport with code for long running scriptscriptRunTime - Total time in milliseconds since scrip was started
ScripterCallback.interruptLongRunningScript(ice.storm.Viewport, long)
public boolean allowScriptClose(Viewport vp,
boolean openedByScript)
ScripterCallback
allowScriptClose in interface ScripterCallbackopenedByScript - specify whether viewport was created by script.
public boolean allowScriptClose(Viewport view, boolean openedByScript) {
return openedByScript;
}
ScripterCallback.allowScriptClose(ice.storm.Viewport, boolean)
public void reportScriptError(Viewport vp,
boolean justWarning,
String errorMessage,
String url,
int lineNumber,
String lineSource,
int lineOffset)
ScripterCallback
reportScriptError in interface ScripterCallbackvp - Viewport containing error triggering scriptjustWarning - True if the reported problem does not prevent father execution of the script.errorMessage - Text of error messageurl - Point to url containing error triggering script codelineNumber - If non-negative, gives number for line with errorlineSource - If not null, contains error line textlineOffset - Offset in characters from line start for error-triggering codeScripterCallback.reportScriptError(ice.storm.Viewport, boolean, java.lang.String, java.lang.String, int, java.lang.String, int)
public String scriptPrompt(Viewport vp,
String msg,
String defVal)
ScripterCallback
scriptPrompt in interface ScripterCallbackScripterCallback.scriptPrompt(ice.storm.Viewport, java.lang.String, java.lang.String)
public boolean scriptConfirm(Viewport vp,
String msg)
ScripterCallback
scriptConfirm in interface ScripterCallbackScripterCallback.scriptConfirm(ice.storm.Viewport, java.lang.String)
public void scriptAlert(Viewport vp,
String msg)
ScripterCallback
scriptAlert in interface ScripterCallbackScripterCallback.scriptAlert(ice.storm.Viewport, java.lang.String)public void scriptPrint(Viewport vp)
ScripterCallback
scriptPrint in interface ScripterCallbackScripterCallback.scriptPrint(ice.storm.Viewport)public final void registerWith(StormBase storm)
StormBase.setViewportCallback(ice.storm.ViewportCallback),
StormBase.setScripterCallback(ice.storm.ScripterCallback)
public static BoxedCode box_createTopLevelContainer(ViewportCallback viewportCallback,
Viewport vp)
public static BoxedCode box_disposeTopLevelContainer(ViewportCallback viewportCallback,
Viewport vp)
public static BoxedCode box_getMaxScriptRunningTime(ScripterCallback sc)
public static BoxedCode box_interruptLongRunningScript(ScripterCallback sc,
Viewport vp,
long scriptRunTime)
public static BoxedCode box_allowScriptClose(ScripterCallback sc,
Viewport vp,
boolean openedByScript)
public static BoxedCode box_reportScriptError(ScripterCallback sc,
Viewport vp,
boolean justWarning,
String errorMessage,
String url,
int lineNumber,
String lineSource,
int lineOffset)
public static BoxedCode box_scriptPrompt(ScripterCallback sc,
Viewport vp,
String msg,
String defVal)
public static BoxedCode box_scriptConfirm(ScripterCallback sc,
Viewport vp,
String msg)
public static BoxedCode box_scriptAlert(ScripterCallback sc,
Viewport vp,
String msg)
public static BoxedCode box_scriptPrint(ScripterCallback sc,
Viewport vp)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||