Class Prompt


  extended by Object
      extended by Prompt

public class Prompt
extends Object

This class represents a simple popup with text, optional image and optional progress bar.


Constructor Summary
Prompt(Image icon, String message, MenuItem softOK, MenuItem softBack)
          Creates a new popup.
Prompt(Image icon, String message, MenuItem softOK, MenuItem softMiddle, MenuItem softBack)
          Creates a new popup.
 
Method Summary
 void pop()
          Removes this prompt from screen stack.
 void push()
          Push this prompt on top of screen stack.
 void setActionHandler(ActionCallback callback)
           Sets the action callback function for this Prompt.
 void setProgress(int current, int max)
           Sets current state of progress bar.
 
Methods inherited from class Object
toString, equals, hashCode
 
Methods inherited from
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Prompt

public Prompt(Image icon,
              String message,
              MenuItem softOK,
              MenuItem softBack)
Creates a new popup.

Parameters:
icon - Icon to show, may be null
message - Message to show
softOK - Action for OK soft key, may be null
softBack - Action for BACK soft key, may be null

Prompt

public Prompt(Image icon,
              String message,
              MenuItem softOK,
              MenuItem softMiddle,
              MenuItem softBack)
Creates a new popup.

Parameters:
icon - Icon to show, may be null
message - Message to show
softOK - Action for OK soft key, may be null
softMiddle - Action for MIDDLE soft key, may be null
softBack - Action for BACK soft key, may be null
Method Detail

setProgress

public void setProgress(int current,
                        int max)

Sets current state of progress bar. When this method is called for the first time the progress bar is added to the prompt.

Indefinitive, continuously running progress bar is created with setProgress(0,0) call.

Parameters:
current - Current progress between [0..max[
max - Maximum progress, use zero for indefinite progress

setActionHandler

public void setActionHandler(ActionCallback callback)

Sets the action callback function for this Prompt. The callback is used instead of generic Script.actionPerformed(Shell, Component, int).

Parameters:
callback - Callback to use or null to use the generic callback
See Also:
Callbacks

push

public void push()
Push this prompt on top of screen stack.


pop

public void pop()
Removes this prompt from screen stack.