Class AbstractUISWTInputReceiver
java.lang.Object
com.biglybt.pifimpl.local.ui.AbstractUIInputReceiver
com.biglybt.ui.swt.pifimpl.AbstractUISWTInputReceiver
- All Implemented Interfaces:
UIInputReceiver, UISWTInputReceiver
- Direct Known Subclasses:
SimpleTextEntryWindow
public abstract class AbstractUISWTInputReceiver
extends AbstractUIInputReceiver
implements UISWTInputReceiver
Extended abstract class which implements the bulk of logic required for the
UISWTInputReceiver interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]protected booleanprotected intprotected intprotected intprotected booleanprotected int[]protected intFields inherited from class AbstractUIInputReceiver
allow_empty_input, maintain_whitespace, messages, multiline_mode, preentered_text, receiver_listener, title, validator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidselectPreenteredText(boolean select) Indicates whether you want the preentered text to be selected (highlighted) or not.voidselectPreenteredTextRange(int[] range) voidsetHeightHint(int height) voidsetLineHeight(int line_height) Indicates how many lines by default to show the user to enter input.voidsetPreenteredText(String text, boolean as_suggested) This sets a value to be displayed as pre-entered text for the input.voidsetSelectableItems(String[] choices, int default_choice, boolean allow_edit) Changes the entry box to be a combo box, where the values passed are selectable.voidsetWidthHint(int width) Indicates how wide you want the text entry window to be.Methods inherited from class AbstractUIInputReceiver
allowEmptyInput, assertPostPrompt, assertPrePrompt, getSubmittedInput, hasSubmittedInput, isResultRecorded, localise, maintainWhitespace, prompt, promptForInput, recordUserAbort, recordUserInput, setInputValidator, setLocalisedMessage, setLocalisedMessages, setLocalisedTitle, setMessage, setMessages, setMultiLine, setTitle, triggerReceiverListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface UIInputReceiver
allowEmptyInput, getSubmittedInput, hasSubmittedInput, maintainWhitespace, prompt, setEnableSpecialEscapeHandling, setInputValidator, setLocalisedMessage, setLocalisedMessages, setLocalisedTitle, setMessage, setMessages, setMultiLine, setTextLimit, setTitle, userHitEscape
-
Field Details
-
select_preentered_text
protected boolean select_preentered_text -
select_preentered_text_range
protected int[] select_preentered_text_range -
line_height
protected int line_height -
width_hint
protected int width_hint -
height_hint
protected int height_hint -
choices
-
choices_allow_edit
protected boolean choices_allow_edit -
choices_default
protected int choices_default
-
-
Constructor Details
-
AbstractUISWTInputReceiver
public AbstractUISWTInputReceiver()
-
-
Method Details
-
selectPreenteredText
public void selectPreenteredText(boolean select) Description copied from interface:UISWTInputReceiverIndicates whether you want the preentered text to be selected (highlighted) or not. Default istrue.- Specified by:
selectPreenteredTextin interfaceUISWTInputReceiver- Parameters:
select-
-
selectPreenteredTextRange
public void selectPreenteredTextRange(int[] range) -
setLineHeight
public void setLineHeight(int line_height) Description copied from interface:UISWTInputReceiverIndicates how many lines by default to show the user to enter input.- Specified by:
setLineHeightin interfaceUISWTInputReceiver- Parameters:
line_height-
-
setWidthHint
public void setWidthHint(int width) Description copied from interface:UISWTInputReceiverIndicates how wide you want the text entry window to be.- Specified by:
setWidthHintin interfaceUISWTInputReceiver- Parameters:
width-
-
setHeightHint
public void setHeightHint(int height) - Specified by:
setHeightHintin interfaceUISWTInputReceiver
-
setPreenteredText
Description copied from interface:UIInputReceiverThis 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.
- Specified by:
setPreenteredTextin interfaceUIInputReceiver- Overrides:
setPreenteredTextin classAbstractUIInputReceiver- Parameters:
text- The text to pre-enter.as_suggested- true if the value is a suggested input value, false if it is an old value.
-
setSelectableItems
Description copied from interface:UISWTInputReceiverChanges the entry box to be a combo box, where the values passed are selectable.- Specified by:
setSelectableItemsin interfaceUISWTInputReceiver- Parameters:
choices- The list of options to be made available.default_choice- Index of the option to present by default.allow_edit- true if you still want to allow the user to enter their own text, false if you want to restrict them to the choices here.
-