kirk.gui.dialog
Class SingleInputRetriever

java.lang.Object
  extended bykirk.gui.dialog.SingleInputRetriever
All Implemented Interfaces:
Retriever

public class SingleInputRetriever
extends Object
implements Retriever

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

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

Field Summary
protected  String value
          The value retrieved from the InputDialog.
 
Constructor Summary
protected SingleInputRetriever(Frame owner, String message, int width, int height, int columns)
          Constructs a new SingleInputRetriever.
 
Method Summary
protected  String getValue()
          Returns the value retrieved from the SingleInputDialog.
static String getValue(Frame owner, String message, int width, int height, int columns)
          Creates an SingleInputRetriever and retrieves its value.
 boolean retrieve(InputDialog inputdialog)
          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

SingleInputRetriever

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

Method Detail

retrieve

public boolean retrieve(InputDialog inputdialog)
Sets the input value to the passed value. Only the InputDialog that was constructed by this class should use this method.

Specified by:
retrieve in interface Retriever
Parameters:
inputdialog - The value from the InputDialog.
Returns:
true if the InputDialog should close, false if it should stay open.

getValue

protected String getValue()
Returns the value retrieved from the SingleInputDialog.

Returns:
The value retrieved from the SingleInputDialog.

getValue

public static String getValue(Frame owner,
                              String message,
                              int width,
                              int height,
                              int columns)
Creates an SingleInputRetriever 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, or null if the input was canceled.