|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gudy.azureus2.pluginsimpl.local.ui.AbstractUIInputReceiver
public abstract class AbstractUIInputReceiver
Abstract class to make it easy for class to implement UIInputReceiver classes. The common convention is that it has all the necessary set methods needed, and all settings passed are accessible through protected attributes. Checks are made to ensure only certain methods are called at the right time.
| Field Summary | |
|---|---|
protected boolean |
allow_empty_input
|
protected boolean |
maintain_whitespace
|
protected String[] |
messages
|
protected boolean |
multiline_mode
|
protected String |
preentered_text
|
protected UIInputReceiverListener |
receiver_listener
|
protected String |
title
|
protected UIInputValidator |
validator
|
| Constructor Summary | |
|---|---|
AbstractUIInputReceiver()
|
|
| Method Summary | |
|---|---|
void |
allowEmptyInput(boolean empty_input)
Indicates whether blank input can be entered. |
protected void |
assertPostPrompt()
|
protected void |
assertPrePrompt()
|
String |
getSubmittedInput()
Returns the string if the user submitted any data - you should check for this by calling UIInputReceiver.hasSubmittedInput() first. |
boolean |
hasSubmittedInput()
Returns true if the user submitted any data. |
protected boolean |
isResultRecorded()
|
protected String |
localise(String key)
|
void |
maintainWhitespace(boolean keep_whitespace)
Indicates whether to keep whitespace are kept when input is entered, or whether to strip it out. |
void |
prompt()
This prompts the user for input. |
void |
prompt(UIInputReceiverListener receiver_listener)
This prompts the user for input and returns immediately. |
protected abstract void |
promptForInput()
Subclasses must override this method to receive input from the user. |
protected void |
recordUserAbort()
|
protected void |
recordUserInput(String input)
|
void |
setInputValidator(UIInputValidator validator)
Sets the UIInputValidator for this object. |
void |
setLocalisedMessage(String message)
Sets the message to display for the text entry input. |
void |
setLocalisedMessages(String[] messages)
Sets the message to display for the text entry input. |
void |
setLocalisedTitle(String title)
Sets the title for the text entry input. |
void |
setMessage(String message)
Sets the message to display for the text entry input. |
void |
setMessages(String[] messages)
Sets the message to display for the text entry input. |
void |
setMultiLine(boolean multiline)
Indicates whether to allow multi-line input. |
void |
setPreenteredText(String text,
boolean as_suggested)
This sets a value to be displayed as pre-entered text for the input. |
void |
setTitle(String title)
Sets the title for the text entry input. |
void |
triggerReceiverListener()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.gudy.azureus2.plugins.ui.UIInputReceiver |
|---|
setTextLimit |
| Field Detail |
|---|
protected String[] messages
protected String title
protected boolean multiline_mode
protected String preentered_text
protected UIInputValidator validator
protected UIInputReceiverListener receiver_listener
protected boolean maintain_whitespace
protected boolean allow_empty_input
| Constructor Detail |
|---|
public AbstractUIInputReceiver()
| Method Detail |
|---|
protected final void assertPrePrompt()
protected final void assertPostPrompt()
public void setLocalisedMessage(String message)
UIInputReceiver
For multiple lines, see UIInputReceiver.setLocalisedMessages(java.lang.String[]).
setLocalisedMessage in interface UIInputReceiverpublic void setLocalisedMessages(String[] messages)
UIInputReceiverThe 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.
setLocalisedMessages in interface UIInputReceiverpublic void setLocalisedTitle(String title)
UIInputReceiver
setLocalisedTitle in interface UIInputReceiverpublic void setMessage(String message)
UIInputReceiver
For multiple lines, see UIInputReceiver.setMessages(java.lang.String[]).
setMessage in interface UIInputReceiverpublic void setMessages(String[] messages)
UIInputReceiverThe 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.
setMessages in interface UIInputReceiverpublic void setMultiLine(boolean multiline)
UIInputReceiver
setMultiLine in interface UIInputReceiver
public void setPreenteredText(String text,
boolean as_suggested)
UIInputReceiverThe 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.
setPreenteredText in interface UIInputReceivertext - The text to pre-enter.as_suggested - true if the value is a suggested
input value, false if it is an old value.public void setTitle(String title)
UIInputReceiver
setTitle in interface UIInputReceiverpublic void setInputValidator(UIInputValidator validator)
UIInputReceiverBy default, there is no input validator associated with a UIInputReceiver, meaning all input is allowed.
setInputValidator in interface UIInputReceiverUIInputValidatorpublic final void prompt()
UIInputReceiver
prompt in interface UIInputReceiverprotected boolean isResultRecorded()
public final void prompt(UIInputReceiverListener receiver_listener)
UIInputReceiverUIInputReceiverListener will
be triggered
prompt in interface UIInputReceiverpublic final void triggerReceiverListener()
protected abstract void promptForInput()
protected final void recordUserInput(String input)
protected final void recordUserAbort()
public boolean hasSubmittedInput()
UIInputReceiver
hasSubmittedInput in interface UIInputReceiverpublic String getSubmittedInput()
UIInputReceiverUIInputReceiver.hasSubmittedInput() first.
getSubmittedInput in interface UIInputReceiverpublic void maintainWhitespace(boolean keep_whitespace)
UIInputReceiver
maintainWhitespace in interface UIInputReceiverpublic void allowEmptyInput(boolean empty_input)
UIInputReceiver
allowEmptyInput in interface UIInputReceiverprotected final String localise(String key)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||