kirk.gui.dialog
Class InputRetriever

java.lang.Object
  |
  +--kirk.gui.dialog.InputRetriever
All Implemented Interfaces:
InputAcceptor

public class InputRetriever
extends Object
implements InputAcceptor

This class retrieves the value inputted in an InputDialog. You retrieve the String with InputRetriever.getInputValue(Frame owner, String message, int columns) .

Version:
1
Author:
Berend "Kirk" Wouda
See Also:
InputDialog

Field Summary
protected  String value
          The value retrieved from the InputDialog.
 
Constructor Summary
protected InputRetriever(Frame owner, String message, int width, int height, int columns)
          Constructs a new InputRetriever.
 
Method Summary
protected  String getInputValue()
          Returns the value retrieved from the InputDialog.
static String getInputValue(Frame owner, String message, int width, int height, int columns)
          Creates an InputRetriever and retrieves its value.
 void setInputValue(Object value)
          Sets the input value to the passed value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected String value
The value retrieved from the InputDialog.

Constructor Detail

InputRetriever

protected InputRetriever(Frame owner,
                         String message,
                         int width,
                         int height,
                         int columns)
Constructs a new InputRetriever.

Method Detail

setInputValue

public void setInputValue(Object value)
Sets the input value to the passed value. Only the InputDialog that was constructed by this class should use this method.

Specified by:
setInputValue in interface InputAcceptor
Parameters:
value - The value from the InputDialog.

getInputValue

protected String getInputValue()
Returns the value retrieved from the InputDialog.

Returns:
The value retrieved from the InputDialog.

getInputValue

public static String getInputValue(Frame owner,
                                   String message,
                                   int width,
                                   int height,
                                   int columns)
Creates an InputRetriever and retrieves its value.

Parameters:
owner - The Frame a Dialog has to be popped up on.
message - The message to be displayed on the popup.
columns - The amount of characters that have to fit in the input field.
Returns:
A String that contains the contents of the input field.