abstract class fwt::TextWidget
sys::Obj fwt::Widget fwt::TextWidget
@Js
TextWidget is the base class for Text and RichText.
- border
-
const Bool border := trueDraw a border around the text field. Default is true. This field cannot be changed once the widget is constructed.
- caretOffset
-
virtual Int caretOffsetThe 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 := trueFalse to make the text widget read only. Default is true. This field cannot be changed once the widget is constructed.
- font
-
virtual Font? fontFont for text. Defaults to null (system default).
- hscroll
-
const Bool hscroll := trueTrue 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
newTextstarting at positionstartfor a length ofreplaceLen. - multiLine
-
const Bool multiLine := this is RichTextFalse for text fields and true for multiline text areas. Default is false for
Textwidgets and true forRichTextwidgets. This field cannot be changed once the widget is constructed. - paste
-
virtual Void paste()Paste the selected text to clipboard.
- prefCols
-
Int prefCols := 20The preferred number of character columns to use in calculating prefSize.
- prefRows
-
Int prefRows := 10The 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 textThe widget's current text
- vscroll
-
const Bool vscroll := trueTrue 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 := falseTrue to make wrap the text of a multiLine text widget. Default is false. This field cannot be changed once the widget is constructed.