FileDocCategorySizeDatePackage
UIInputReceiver.javaAPI DocAzureus 3.0.3.46737Wed Nov 15 11:23:58 GMT 2006org.gudy.azureus2.plugins.ui

UIInputReceiver

public interface UIInputReceiver
This interface provides a mechanism to get some textual input from a user.

There are various methods which allow you to customise the appearance of the prompt that the user receives - subclasses may provide additional methods to customise the interface too.

Once the object has been set up, you then call the {@link #prompt}method. This will ask the user for some input based on the values previously given. It will only return once the user has either given some validated input, or has indicated they don't want to give any input (like pressing a Cancel button).

The {@link #hasSubmittedText()} and {@link #getSubmittedText()} methods can then be invoked to retrieve the input (if the user has submitted any).

There are various methods which have a setXXX and setLocalisedXXX counterparts. The setXXX methods will attempt to translate the given string to a localised representation of it - the setLocalisedXXX method will assume that the localisation has already been done, and leave it intact.

Fields Summary
Constructors Summary
Methods Summary
public voidallowEmptyInput(boolean empty_input)
Indicates whether blank input can be entered.

public java.lang.StringgetSubmittedInput()
Returns the string if the user submitted any data - you should check for this by calling {@link #hasSubmittedInput()} first.

public booleanhasSubmittedInput()
Returns true if the user submitted any data.

public voidmaintainWhitespace(boolean keep_whitespace)
Indicates whether to keep whitespace are kept when input is entered, or whether to strip it out. Default behaviour is to strip whitespace.

public voidprompt()
This prompts the user for input. This method will not return until the user has either entered valid input, or signalled they want to cancel entering any data.

public voidsetInputValidator(UIInputValidator validator)
Sets the UIInputValidator for this object. This allows an external object to validate or reject input submitted by the user.

By default, there is no input validator associated with a UIInputReceiver, meaning all input is allowed.

see
UIInputValidator

public voidsetLocalisedMessage(java.lang.String message)
Sets the message to display for the text entry input. This will normally be displayed near the position where the text will be entered - this method is usually used to present the user with an indication of what to enter.

For multiple lines, see {@link #setLocalisedMessages}.

public voidsetLocalisedMessages(java.lang.String[] messages)
Sets the message to display for the text entry input. This will normally be displayed near the position where the text will be entered - this method is usually used to present the user with an indication of what to enter.

The value passed here will be an array of strings - each string will be usually outputted on its own line. The last value in the array will usually be the message displayed closest to the users prompt.

public voidsetLocalisedTitle(java.lang.String title)
Sets the title for the text entry input. For some interfaces, this means that a window will be presented, and the title of the window will be the value passed here.

public voidsetMessage(java.lang.String message)
Sets the message to display for the text entry input. This will normally be displayed near the position where the text will be entered - this method is usually used to present the user with an indication of what to enter.

For multiple lines, see {@link #setMessages}.

public voidsetMessages(java.lang.String[] messages)
Sets the message to display for the text entry input. This will normally be displayed near the position where the text will be entered - this method is usually used to present the user with an indication of what to enter.

The value passed here will be an array of strings - each string will be usually outputted on its own line. The last value in the array will usually be the message displayed closest to the users prompt.

public voidsetMultiLine(boolean multiline)
Indicates whether to allow multi-line input. Default behaviour is to not allow multiple lines.

public voidsetPreenteredText(java.lang.String text, boolean as_suggested)
This sets a value to be displayed as pre-entered text for the input. This may be called if the caller wants to suggest a value for the user to use, or if the caller wants to provide a previous value (for example).

The text may appear in the same location as the text should be entered (allowing it to be directly overwritten or submitted immediately) - but some interfaces may not support this.

A flag should be passed indicating whether the pre-entered text is being entered as a suggestion for a value, or whether it is an old value being currently stored. Some interfaces may choose to differentiate between the two.

param
text The text to pre-enter.
param
as_suggested true if the value is a suggested input value, false if it is an old value.

public voidsetTitle(java.lang.String title)
Sets the title for the text entry input. For some interfaces, this means that a window will be presented, and the title of the window will be the value passed here.