| org.netbeans.microedition.lcdui.AbstractInfoScreen org.netbeans.microedition.lcdui.WaitScreen
WaitScreen | public class WaitScreen extends AbstractInfoScreen (Code) | | This component suits as a wait screen, which let the user to execute a blocking
background task (e.g. a network communication) and waits for it until finished.
The background task is being started immediately prior the component is being
shown on the screen.
When the background task is finished, this component calls commandAction method
on assigned CommandListener object. In the case of success, the commandAction method
is called with SUCCESS_COMMAND as parameter, in the case of failure, the commandAction
method is called with FAILURE_COMMAND as parameter.
The functionality from previous version, where the component automatically swiches
to another Displayable objects is still available, but has beeen
deprecated.
The deprecated behavior is the following - in the case of success (i.e. the
task finished successfully), it switches to displayable(s) supplied by
setNextDisplayable() methods, in the case of failure, it switched to displaybles(s)
supplied by setFailureDisplayable() methods. In the case there is not
set failure displayable, WaitScreen even in the
case of failure switches to displayables specified by the setNextDisplayable()
method. In the case there is even no next displayable specified, after the
task is finished, WaitScreen switches back to the screen it was
previously visible on the display.
author: breh |
Constructor Summary | |
public | WaitScreen(Display display) Creates a new instance of WaitScreen for given Display object. |
Method Summary | |
public CancellableTask | getTask() Gets the background task. | public void | setFailureDisplayable(Displayable failureDisplayble) Sets the displayable to be used to switch to in the case of the background
task failure. | public void | setFailureDisplayable(Alert failureAlert, Displayable failureDisplayble) Requests that the specified Alert is going to be shown in the case of
failure, and failureDisplayable be made current after the Alert is dismissed.
The failureDisplayable parameter cannot be Alert and in the case
failureAlert is not null, it also cannot be null.
Parameters: failureAlert - alert to be shown, or null if the component should always switch to nextDisplayable Parameters: failureDisplayble - a displayable to be shown after the alert is being dismissed. | public void | setTask(CancellableTask task) Sets the task to be run on the background. | protected void | showNotify() |
FAILURE_COMMAND | final public static Command FAILURE_COMMAND(Code) | | Command fired when the background task failed (threw exception)
|
SUCCESS_COMMAND | final public static Command SUCCESS_COMMAND(Code) | | Command fired when the background task was finished succesfully
|
getTask | public CancellableTask getTask()(Code) | | Gets the background task.
task being executed in background while this component is being shownon the screen |
setFailureDisplayable | public void setFailureDisplayable(Displayable failureDisplayble)(Code) | | Sets the displayable to be used to switch to in the case of the background
task failure.
Parameters: failureDisplayble - displayable, or null if the component should switch to nextDisplayable even in the case of failure. |
setFailureDisplayable | public void setFailureDisplayable(Alert failureAlert, Displayable failureDisplayble) throws IllegalArgumentException(Code) | | Requests that the specified Alert is going to be shown in the case of
failure, and failureDisplayable be made current after the Alert is dismissed.
The failureDisplayable parameter cannot be Alert and in the case
failureAlert is not null, it also cannot be null.
Parameters: failureAlert - alert to be shown, or null if the component should always switch to nextDisplayable Parameters: failureDisplayble - a displayable to be shown after the alert is being dismissed. This displayablecannot be null if the failureAlert is not null and it also cannot beAlert. throws: java.lang.IllegalArgumentException - If the failureAlert is not null and failureDisplay is null at the same time, orif the failureDisplayable is instance of Alert |
setTask | public void setTask(CancellableTask task)(Code) | | Sets the task to be run on the background.
Parameters: task - task to be executed |
showNotify | protected void showNotify()(Code) | | starts the supplied task
|
|
|