abstract class fwt::TextWidget

sys::Obj
  fwt::Widget
    fwt::TextWidget

@Js

Source

TextWidget is the base class for Text and RichText.

border

const Bool border := true

Source

Draw a border around the text field. Default is true. This field cannot be changed once the widget is constructed.

caretOffset

virtual Int caretOffset

Source

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()

Source

Copy the selected text to clipboard.

cut

virtual Void cut()

Source

Cuts the selected text to clipboard.

editable

const Bool editable := true

Source

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

Source

Font for text. Defaults to null (system default).

hscroll

const Bool hscroll := true

Source

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)

Source

Replace the text with newText starting at position start for a length of replaceLen.

multiLine

const Bool multiLine := this

Source

False for text fields and true for multiline text areas. Default is false for Text widgets and true for RichText widgets. This field cannot be changed once the widget is constructed.

paste

virtual Void paste()

Source

Paste the selected text to clipboard.

prefCols

Int prefCols := 20

Source

The preferred number of character columns to use in calculating prefSize.

prefRows

Int prefRows := 10

Source

The preferred number of character rows to use in calculating prefSize if multiLine, otherwise this field is ignored.

prefSize

virtual override Size prefSize(Hints hints := Hints.defVal)

Source

Return the preferred size based on prefCols and prefRows.

select

virtual Void select(Int startOffset, Int size)

Source

Set the selection range.

selectAll

virtual Void selectAll()

Source

Select the entire document.

selectClear

virtual Void selectClear()

Source

Clear the selection.

selectSize

virtual Int selectSize()

Source

Get the number of chars in the current selection.

selectStart

virtual Int selectStart()

Source

Get the starting offset of the current selection.

selectText

virtual Str selectText()

Source

Get the selected text or "" if nothing selected.

text

abstract Str text

Source

The widget's current text

vscroll

const Bool vscroll := true

Source

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

Source

True to make wrap the text of a multiLine text widget. Default is false. This field cannot be changed once the widget is constructed.