Fan

 

abstract class

fwt::TextWidget

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

TextWidget is the base class for Text and RichText.

Slots

borderSource

const Bool border := true

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

caretOffsetSource

virtual native 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.

copySource

virtual native Void copy()

Copy the selected text to clipboard.

cutSource

virtual native Void cut()

Cuts the selected text to clipboard.

editableSource

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.

fontSource

virtual native Font? font

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

hscrollSource

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.

modifySource

abstract Void modify(Int start, Int replaceLen, Str newText)

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

multiLineSource

const Bool multiLine := this is RichText

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.

pasteSource

virtual native Void paste()

Paste the selected text to clipboard.

prefColsSource

Int prefCols := 20

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

prefRowsSource

Int prefRows := 10

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

prefSizeSource

override Size prefSize(Hints hints := Hints.def)

Overrides fwt::Widget.prefSize

Return the preferred size based on prefCols and prefRows.

selectSource

virtual native Void select(Int startOffset, Int size)

Set the selection range.

selectAllSource

virtual native Void selectAll()

Select the entire document.

selectClearSource

virtual native Void selectClear()

Clear the selection.

selectSizeSource

virtual native Int selectSize()

Get the number of chars in the current selection.

selectStartSource

virtual native Int selectStart()

Get the starting offset of the current selection.

selectTextSource

virtual native Str selectText()

Get the selected text or "" if nothing selected.

textSource

abstract Str text

The widget's current text

vscrollSource

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.

wrapSource

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.