abstract class fwt::TextWidget
sys::Obj fwt::Widget fwt::TextWidget
@Js
TextWidget is the base class for Text
and RichText
.
- border
-
const Bool border := true
Draw a border around the text field. Default is true. This field cannot be changed once the widget is constructed.
- caretOffset
-
virtual Int caretOffset
The caret position as zero based offset from start of text. Note that SWT doesn't allow setting of caret position for native widgets.
- copy
-
virtual Void copy()
Copy the selected text to clipboard.
- cut
-
virtual Void cut()
Cuts the selected text to clipboard.
- editable
-
const Bool editable := true
False to make the text widget read only. Default is true. This field cannot be changed once the widget is constructed.
- font
-
virtual Font? font
Font for text. Defaults to null (system default).
- hscroll
-
const Bool hscroll := true
True use a horizontal scrollbar for multiLine text widget. Default is true. This field cannot be changed once the widget is constructed.
- modify
-
abstract Void modify(Int start, Int replaceLen, Str newText)
Replace the text with
newText
starting at positionstart
for a length ofreplaceLen
. - multiLine
-
const Bool multiLine := this
False for text fields and true for multiline text areas. Default is false for
Text
widgets and true forRichText
widgets. This field cannot be changed once the widget is constructed. - paste
-
virtual Void paste()
Paste the selected text to clipboard.
- prefCols
-
Int prefCols := 20
The preferred number of character columns to use in calculating prefSize.
- prefRows
-
Int prefRows := 10
The preferred number of character rows to use in calculating prefSize if multiLine, otherwise this field is ignored.
- prefSize
- select
-
virtual Void select(Int startOffset, Int size)
Set the selection range.
- selectAll
-
virtual Void selectAll()
Select the entire document.
- selectClear
-
virtual Void selectClear()
Clear the selection.
- selectSize
-
virtual Int selectSize()
Get the number of chars in the current selection.
- selectStart
-
virtual Int selectStart()
Get the starting offset of the current selection.
- selectText
-
virtual Str selectText()
Get the selected text or "" if nothing selected.
- text
-
abstract Str text
The widget's current text
- vscroll
-
const Bool vscroll := true
True use a vertical scrollbar for multiLine text widget. Default is true. This field cannot be changed once the widget is constructed.
- wrap
-
const Bool wrap := false
True to make wrap the text of a multiLine text widget. Default is false. This field cannot be changed once the widget is constructed.