|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 java.lang.String[] |
messages
|
protected boolean |
multiline_mode
|
protected java.lang.String |
preentered_text
|
protected UIInputReceiverListener |
receiver_listener
|
protected java.lang.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()
|
java.lang.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 java.lang.String |
localise(java.lang.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(java.lang.String input)
|
void |
setInputValidator(UIInputValidator validator)
Sets the UIInputValidator for this object. |
void |
setLocalisedMessage(java.lang.String message)
Sets the message to display for the text entry input. |
void |
setLocalisedMessages(java.lang.String[] messages)
Sets the message to display for the text entry input. |
void |
setLocalisedTitle(java.lang.String title)
Sets the title for the text entry input. |
void |
setMessage(java.lang.String message)
Sets the message to display for the text entry input. |
void |
setMessages(java.lang.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(java.lang.String text,
boolean as_suggested)
This sets a value to be displayed as pre-entered text for the input. |
void |
setTitle(java.lang.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 java.lang.String[] messages
protected java.lang.String title
protected boolean multiline_mode
protected java.lang.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(java.lang.String message)
UIInputReceiver
For multiple lines, see UIInputReceiver.setLocalisedMessages(java.lang.String[])
.
setLocalisedMessage
in interface UIInputReceiver
public void setLocalisedMessages(java.lang.String[] messages)
UIInputReceiver
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.
setLocalisedMessages
in interface UIInputReceiver
public void setLocalisedTitle(java.lang.String title)
UIInputReceiver
setLocalisedTitle
in interface UIInputReceiver
public void setMessage(java.lang.String message)
UIInputReceiver
For multiple lines, see UIInputReceiver.setMessages(java.lang.String[])
.
setMessage
in interface UIInputReceiver
public void setMessages(java.lang.String[] messages)
UIInputReceiver
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.
setMessages
in interface UIInputReceiver
public void setMultiLine(boolean multiline)
UIInputReceiver
setMultiLine
in interface UIInputReceiver
public void setPreenteredText(java.lang.String text, boolean as_suggested)
UIInputReceiver
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.
setPreenteredText
in interface UIInputReceiver
text
- 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(java.lang.String title)
UIInputReceiver
setTitle
in interface UIInputReceiver
public void setInputValidator(UIInputValidator validator)
UIInputReceiver
By default, there is no input validator associated with a UIInputReceiver, meaning all input is allowed.
setInputValidator
in interface UIInputReceiver
UIInputValidator
public final void prompt()
UIInputReceiver
prompt
in interface UIInputReceiver
protected boolean isResultRecorded()
public final void prompt(UIInputReceiverListener receiver_listener)
UIInputReceiver
UIInputReceiverListener
will
be triggered
prompt
in interface UIInputReceiver
public final void triggerReceiverListener()
protected abstract void promptForInput()
protected final void recordUserInput(java.lang.String input)
protected final void recordUserAbort()
public boolean hasSubmittedInput()
UIInputReceiver
hasSubmittedInput
in interface UIInputReceiver
public java.lang.String getSubmittedInput()
UIInputReceiver
UIInputReceiver.hasSubmittedInput()
first.
getSubmittedInput
in interface UIInputReceiver
public void maintainWhitespace(boolean keep_whitespace)
UIInputReceiver
maintainWhitespace
in interface UIInputReceiver
public void allowEmptyInput(boolean empty_input)
UIInputReceiver
allowEmptyInput
in interface UIInputReceiver
protected final java.lang.String localise(java.lang.String key)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |