|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EditBox
Interface for single-line edit boxes.
EditArea
Nested Class Summary | |
---|---|
static interface |
EditBox.TabCompletion
Handler interface to be implemented by anything that provides completion. |
Field Summary | |
---|---|
static int |
FLAG_DIM
Display dim text, indicating editfield value is presently unimportant |
static int |
FLAG_ERROR
Display text in error colour, indicating that value must be corrected |
static int |
FLAG_NORMAL
Display normal text |
static int |
LINEBYTES_NOLIMIT
If no limit on line characters |
Method Summary | |
---|---|
void |
focus()
Focuses this edit |
int |
getFlag()
|
java.lang.String |
getValue()
|
java.lang.String[] |
getValueLines()
|
boolean |
isEnabled()
|
void |
selectAll()
Selects everything |
void |
setEnabled(boolean enabled)
|
void |
setFlag(int flag)
Sets the display to indicate a particular situation. |
void |
setLineBytes(int max)
Sets the maximum number of bytes (UTF-8). |
void |
setLineWrap(boolean allowWrap)
Sets line wrapping (doesn't actually wrap, just indicates where lines would wrap) |
void |
setOnChange(java.lang.String callback)
Sets the action method called when user types or does anything else that changes the value. |
void |
setOnEnter(java.lang.String callback)
Sets the action method called when user presses Return. |
void |
setOnFocus(java.lang.String callback)
Sets the action method called when the control is focused. |
void |
setOnMultiLine(java.lang.String callback)
Sets the action method called when multiple lines are pasted. |
void |
setRemember(java.lang.String category,
java.lang.String memoryId)
Sets details used to remember the command history between sessions. |
void |
setRequire(java.lang.String require)
Sets a required regular expression which is applied to automatically set state to FLAG_ERROR or FLAG_NORMAL. |
void |
setTabCompletion(EditBox.TabCompletion tc)
Enables/disables tab-completion handling. |
void |
setTextView(java.lang.String id)
Sets a linked textview which will be handle some keyboard input from this control. |
void |
setUseFontSettings(boolean useFontSettings)
|
void |
setValue(java.lang.String s)
|
void |
setWidth(int width)
Sets preferred width |
Methods inherited from interface com.leafdigital.ui.api.Widget |
---|
getID, getOwner, informClosed, isVisible, setOwner, setVisible |
Methods inherited from interface com.leafdigital.ui.api.SupportsBaseGroup |
---|
setBaseGroup |
Field Detail |
---|
static final int LINEBYTES_NOLIMIT
static final int FLAG_NORMAL
static final int FLAG_DIM
static final int FLAG_ERROR
Method Detail |
---|
java.lang.String getValue()
java.lang.String[] getValueLines()
void setValue(java.lang.String s)
s
- New textvoid setUseFontSettings(boolean useFontSettings)
useFontSettings
- If true, uses user-selected font rather than OS defaultvoid setTextView(java.lang.String id)
id
- ID of textview
BugException
- If the textview doesn't exist or hasn't been constructed
yet@UICallback void setOnEnter(java.lang.String callback)
callback
- Name of method
BugException
- If method doesn't exist etc.@UICallback void setOnChange(java.lang.String callback)
callback
- Name of method
BugException
- If method doesn't exist etc.@UICallback void setOnFocus(java.lang.String callback)
callback
- Name of method
BugException
- If method doesn't exist etc.@UICallback void setOnMultiLine(java.lang.String callback)
callback
- Name of method or null for none.void setRemember(java.lang.String category, java.lang.String memoryId)
category
- Category of editbox (must follow the rules for preferences
tokens, i.e. must start with a letter, all characters must be letters,
digits, - or _)memoryId
- ID of editbox (should be unique within category; may be null
if there is never more than one window of that category; can include
any characters; does not have to match the 'real' ID assigned to the box)void setFlag(int flag)
flag
- One of the FLAG_xx constantsint getFlag()
void setRequire(java.lang.String require)
require
- Regular expression following Java conventions e.g. "[0-9]+"void setEnabled(boolean enabled)
enabled
- True to enable, false to disableboolean isEnabled()
void focus()
void setLineBytes(int max)
max
- Max characters per line or LINEBYTES_NOLIMIT (default)void setLineWrap(boolean allowWrap)
allowWrap
- If true, allows word-wrapping to a second line (default false)void setWidth(int width)
width
- Width in pixels.void setTabCompletion(EditBox.TabCompletion tc)
tc
- Tab completion handler, or null for nonevoid selectAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |