Class
zebkit.ui.TextField
extends <zebkit.ui.Label> |
<zebkit.ui> |
Text field UI component. The component is designed to enter single line, multi lines or password text. The component implement text field functionality from the scratch. It supports the following features
- Text selection
- Redu/Undo actions
- Native WEB clipboard
- Basic text navigation
- Read-only mode
- Left or right text alignment
zebkit.ui.TextField
([txt], [maxCol]
)
Parameters:
-
[txt]
<String | zebkit.data.TextModel | zebkit.draw.TextRender>a text the text field component has to be filled. The parameter can be a simple string, text model or text render class instance.
-
[maxCol]
<Integer>a maximal size of entered text. -1 means the size of the edited text has no length limit.
public | void | clearSelection ( ) |
public | <String> | cut ( ) |
protected
|
void | drawCursor (g) |
protected
|
<Object> | findNextWord (t, line, col, d) |
public | <Array> | getEndSelection ( ) |
public | <String> | getSelectedText ( ) |
public | <Array> | getStartSelection ( ) |
public | <Object> | getTextRowColAt (x, y) |
public | <Boolean> | hasSelection ( ) |
protected
|
<Boolean> | isFiltered (e) |
public | void | redo ( ) |
public | void | remove (pos, size) |
public | void | removeSelected ( ) |
protected
|
void | repaintCursor ( ) |
public | void | select (startOffset, endOffset) |
public | void | selectAll ( ) |
public | void | setBlinking ([period]) |
public | void | setCursorSize (w, h) |
public | void | setCursorView (v) |
public | void | setCursorWidth (w) |
public | void | setEditable (b) |
public | void | setHint (hint) |
public | void | setPosition (p) |
public | void | setPSByRowsCols (r, c) |
public | void | setSelectView (c) |
public | void | setTextAlignment (a) |
public | void | setValue (s) |
public | void | shortcutFired (e) |
protected
|
void | startSelection ( ) |
public | void | undo ( ) |
public | <Boolean> | write (pos, s) |
public
chainable
clearSelection ( )
Clear a text selection. |
protected
void
drawCursor (g )
Draw the text field cursor. Parameters:
|
protected
<Object>
findNextWord (t, line, col, d )
Find the next or previous word in the given text model starting from the given line and column. Parameters:
Returns:
<Object>
a structure with the next or previous word location:
The method returns null if the next or previous word cannot be found. |
protected
<Boolean>
isFiltered (e )
Test if the given key pressed event has to be processed Parameters:
Returns:
<Boolean>
true if the given key pressed event doesn't have be processed |
public
chainable
redo ( )
Performs redo operation |
@Override
zebkit.layout.Layoutable
public void remove (pos, size )
Remove the specified part of edited text Parameters:
|
public
chainable
removeSelected ( )
Remove selected text |
protected
void
repaintCursor ( )
Force text field cursor repainting. |
public
chainable
select (startOffset, endOffset )
Select the specified part of the edited text Parameters:
|
public
chainable
selectAll ( )
Select all text. |
public
chainable
setBlinking ([period] )
Set the specified blinking period of the text field cursor Parameters:
|
public
chainable
setCursorSize (w, h )
Set cursor size. Parameters:
|
public
chainable
setCursorView (v )
Set the cursor view. The view defines rendering of the text field cursor. Parameters:
|
public
chainable
setCursorWidth (w )
Set cursor width. Parameters:
|
public
chainable
setEditable (b )
Control the text field editable state Parameters:
|
public
chainable
setHint (hint )
Set the specified hint text to be drawn with the given font and color. The hint is not-editable text that is shown in empty text field to help a user to understand which input the text field expects. Parameters:
|
public
chainable
setPosition (p )
Set the specified cursor position controller Parameters:
|
public
chainable
setPSByRowsCols (r, c )
Adjust the size of the text field component to be enough to place the given number of rows and columns. Parameters:
|
public
chainable
setSelectView (c )
Set selection color or view Parameters:
|
public
chainable
setTextAlignment (a )
Set the text algnment. Parameters:
|
@Override
zebkit.ui.Label
public chainable setValue (s )
Set the text content of the text field component Parameters:
|
public
void
shortcutFired (e )
Shortcut event handler Parameters:
|
protected
chainable
startSelection ( )
Start selection. |
public
chainable
undo ( )
Performs undo operation |













public
![]() blinkigPeriod
Specify the text field cursor blinking period in milliseconds. -1 means no blinkable cursor |
public
![]() cursorHeight
Cursor height |
public
![]() cursorWidth
Cursor width |
public
![]() cursorX
Cursor x loacation |
public
![]() cursorY
Cursor y loacation |
posChanged
Fire when a cursor position has been changed.
Parameters:
|
selected
Fire when a text field content has been selected.
Parameters:
|
updated
Fire when a text field content has been updated.
Parameters:
|