Methods Summary |
---|
public void | allowEmptyInput(boolean empty_input)
this.allow_empty_input = empty_input;
|
protected final void | assertPostPrompt()
if (!prompted) {
throw new RuntimeException("cannot before after prompt has been called");
}
|
protected final void | assertPrePrompt()
// Helper methods.
if (prompted) {
throw new RuntimeException("cannot invoke after prompt has been called");
}
|
public java.lang.String | getSubmittedInput()
assertPostPrompt();
return this.result_input;
|
public boolean | hasSubmittedInput()
assertPostPrompt();
return this.result_input_submitted;
|
protected final java.lang.String | localise(java.lang.String key)
return MessageText.getString(key);
|
public void | maintainWhitespace(boolean keep_whitespace)
this.maintain_whitespace = keep_whitespace;
|
public final void | prompt()
assertPrePrompt();
this.promptForInput();
if (!result_recorded) {
throw new RuntimeException(this.toString() + " did not record a result.");
}
this.prompted = true;
|
protected abstract void | promptForInput()Subclasses must override this method to receive input from the user.
This method must call either recordUserInput or recordUserAbort before
returning.
|
protected final void | recordUserAbort()
this.result_recorded = true;
this.result_input_submitted = false;
this.result_input = null;
|
protected final void | recordUserInput(java.lang.String input)
this.result_recorded = true;
this.result_input_submitted = true;
this.result_input = input;
// The subclass should strip the output before it sets
// the value here - but just in case they forget, we remember.
//
// Subclasses should do it that the validator can validate the stripped string.
if (!this.maintain_whitespace) {
this.result_input = input.trim();
}
|
public void | setInputValidator(org.gudy.azureus2.plugins.ui.UIInputValidator validator)
assertPrePrompt();
this.validator = validator;
|
public void | setLocalisedMessage(java.lang.String message)
this.setLocalisedMessages(new String[]{message});
|
public void | setLocalisedMessages(java.lang.String[] messages)
assertPrePrompt();
this.messages = messages;
|
public void | setLocalisedTitle(java.lang.String title)
assertPrePrompt();
this.title = title;
|
public void | setMessage(java.lang.String message)
this.setLocalisedMessage(this.localise(message));
|
public void | setMessages(java.lang.String[] messages)
String[] new_messages = new String[messages.length];
for (int i=0; i<new_messages.length; i++) {
new_messages[i] = this.localise(messages[i]);
}
this.setLocalisedMessages(new_messages);
|
public void | setMultiLine(boolean multiline)
assertPrePrompt();
this.multiline_mode = multiline;
|
public void | setPreenteredText(java.lang.String text, boolean as_suggested)
assertPrePrompt();
this.preentered_text = text;
this.preentered_text_is_old_value = !as_suggested;
|
public void | setTitle(java.lang.String title)
this.setLocalisedTitle(this.localise(title));
|