ch.aplu.util
Class InputDialog

java.lang.Object
  extended by ch.aplu.util.InputDialog

public class InputDialog
extends java.lang.Object

Modal input dialog.

If the user enters a value with wrong type, the dialog is displayed again.

All methods run in the Event Dispatch Thread (EDT).


Constructor Summary
InputDialog()
          Construct dialog with default title and prompt.
InputDialog(java.lang.String title, java.lang.String prompt)
          Construct dialog with given title and prompt.
 
Method Summary
static java.lang.Boolean getBoolean()
          Show the dialog with a yes/no button pair to get a boolean.
static java.lang.Double getDouble()
          Show the dialog to get a double value.
static java.lang.Integer getInt()
          Show the dialog to get an integer value.
static java.lang.Long getLong()
          Show the dialog to get a long value.
static java.lang.String getString()
          Show the dialog to get a string value (same as readString()).
static boolean readBoolean()
          Show the dialog with a yes/no button pair to get a boolean.
static double readDouble()
          Show the dialog to read a double value.
static int readInt()
          Show the dialog to read an integer value.
static long readLong()
          Show the dialog to read a long value.
static java.lang.String readString()
          Show the dialog to get a string value (same as getString()).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputDialog

public InputDialog()
Construct dialog with default title and prompt.


InputDialog

public InputDialog(java.lang.String title,
                   java.lang.String prompt)
Construct dialog with given title and prompt.

Method Detail

getString

public static java.lang.String getString()
Show the dialog to get a string value (same as readString()).

Returns:
null, if the title bar's cancel button is pressed

readString

public static java.lang.String readString()
Show the dialog to get a string value (same as getString()).

Returns:
null, if the title bar's cancel button is pressed

getInt

public static java.lang.Integer getInt()
Show the dialog to get an integer value.

Returns:
null, if the title bar's cancel button is pressed

readInt

public static int readInt()
Show the dialog to read an integer value. Redraw the dialog with empty field, wrong data type or if title bar's cancel button is pressed.

Returns:
the integer value

getDouble

public static java.lang.Double getDouble()
Show the dialog to get a double value.

Returns:
null, if the title bar's cancel button is pressed

readDouble

public static double readDouble()
Show the dialog to read a double value. Redraw the dialog with empty field, wrong data type or if title bar's cancel button is pressed.

Returns:
the double value

getLong

public static java.lang.Long getLong()
Show the dialog to get a long value.

Returns:
null, if the title bar's cancel button is pressed

readLong

public static long readLong()
Show the dialog to read a long value. Redraw the dialog with empty field, wrong data type or if title bar's cancel button is pressed.

Returns:
the long value

getBoolean

public static java.lang.Boolean getBoolean()
Show the dialog with a yes/no button pair to get a boolean.

Returns:
Boolean.TRUE or BOOLEAN.FALSE depending the button that is hit; null if the title bar's cancel button is pressed

readBoolean

public static boolean readBoolean()
Show the dialog with a yes/no button pair to get a boolean. Redraw the dialog, if title bar's cancel button is pressed.

Returns:
true or false depending the button that is hit