Ascent Phase Corp.

org.ascentphase.suit
Class InputPopup

java.lang.Object
  |
  +--Canvas
        |
        +--org.ascentphase.suit.Panel
              |
              +--org.ascentphase.suit.InputPopup
Direct Known Subclasses:
KeyboardPopup, ListPopup

public abstract class InputPopup
extends Panel

An InputPopup is an abstract class that acts like a popup form. The Popup usually queries the user for some input and then returns the previous form. An InputPopup usually will have an "OK" and "Cancel" button which the user can click to close the popup. Once closed, the manner in which the popup was closed can be queried using the getCloseState() method. Typically, if the "OK" button is pressed, the input the user provided can be queried from the getText() method. Otherwise if "Cancel" was clicked, the input can be ignored. Subclasses can add more states if necessary to indicate alternate closed states.

Version:
Author:
huyd
See Also:
Serialized Form

Field Summary
static int CLOSE_CANCEL
          Indicates that Popup was closed with Cancel state
static int CLOSE_OK
          Indicates that Popup was closed with OK state
protected  Command closeCmd
          The command event indicating the popup has closed
protected  int closeState
          The state of the popup when closed
 
Fields inherited from class org.ascentphase.suit.Panel
clearReq
 
Constructor Summary
InputPopup()
           
 
Method Summary
 int getCloseState()
          Returns the state of the Popup indicating how it was closed.
abstract  java.lang.String getText()
          Returns the input the user specified in the Popup.
protected  void handleCommandEvent(Command evt)
          Notifies any listeners when a Command event occurs.
 void setCloseCommand(Command c)
          Sets the Command event to indicate that the Popup has closed.
 
Methods inherited from class org.ascentphase.suit.Panel
add, add, keyPressed, keyReleased, keyRepeated, paint, pointerDragged, pointerPressed, pointerReleased, remove, setCommandListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLOSE_OK

public static final int CLOSE_OK
Indicates that Popup was closed with OK state

See Also:
Constant Field Values

CLOSE_CANCEL

public static final int CLOSE_CANCEL
Indicates that Popup was closed with Cancel state

See Also:
Constant Field Values

closeCmd

protected Command closeCmd
The command event indicating the popup has closed


closeState

protected int closeState
The state of the popup when closed

Constructor Detail

InputPopup

public InputPopup()
Method Detail

setCloseCommand

public void setCloseCommand(Command c)
Sets the Command event to indicate that the Popup has closed.

Parameters:
c - the Command event.

getCloseState

public int getCloseState()
Returns the state of the Popup indicating how it was closed.

Returns:
the state value.

getText

public abstract java.lang.String getText()
Returns the input the user specified in the Popup.

Returns:
the text input.

handleCommandEvent

protected void handleCommandEvent(Command evt)
Description copied from class: Panel
Notifies any listeners when a Command event occurs.

Overrides:
handleCommandEvent in class Panel
Parameters:
evt - the Command evt to pass to listeners.

Ascent Phase Corp.

Copyright © 2002 Ascent Phase Corp. All Rights Reserved.