Top Description Inners Fields Constructors Methods
org.eclipse.swt.custom

public Class StyledText

extends Canvas
Class Inheritance
Imports
java.util.*, java.util.stream.*, org.eclipse.swt.*, org.eclipse.swt.accessibility.*, org.eclipse.swt.dnd.*, org.eclipse.swt.events.*, org.eclipse.swt.graphics.*, org.eclipse.swt.internal.*, org.eclipse.swt.printing.*, org.eclipse.swt.widgets.*

A StyledText is an editable user interface object that displays lines of text. The following style attributes can be defined for the text:

In addition to text style attributes, the background color of a line may be specified.

There are two ways to use this widget when specifying text style information. You may use the API that is defined for StyledText or you may define your own LineStyleListener. If you define your own listener, you will be responsible for maintaining the text style information for the widget. IMPORTANT: You may not define your own listener and use the StyledText API. The following StyledText API is not supported if you have defined a LineStyleListener:

There are two ways to use this widget when specifying line background colors. You may use the API that is defined for StyledText or you may define your own LineBackgroundListener. If you define your own listener, you will be responsible for maintaining the line background color information for the widget. IMPORTANT: You may not define your own listener and use the StyledText API. The following StyledText API is not supported if you have defined a LineBackgroundListener:

The content implementation for this widget may also be user-defined. To do so, you must implement the StyledTextContent interface and use the StyledText API setContent(StyledTextContent) to initialize the widget.

Styles:
FULL_SELECTION, MULTI, READ_ONLY, SINGLE, WRAP
Events:
ExtendedModify, LineGetBackground, LineGetSegments, LineGetStyle, Modify, Selection, Verify, VerifyKey, OrientationChange

Important Note

This class is not intended to be subclassed.

See Also
StyledText snippets, SWT Examples: CustomControlExample, TextEditor, Sample code and further information

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
StyledText.Printing

The Printing class implements printing of a range of text.

Field Summary

Modifier and TypeField and Description
pack-priv Accessible
pack-priv AccessibleAdapter
pack-priv AccessibleAttributeAdapter
pack-priv int
pack-priv AccessibleControlAdapter
pack-priv AccessibleEditableTextListener
pack-priv AccessibleTextExtendedAdapter
pack-priv int
pack-priv int
pack-priv boolean
pack-priv int
pack-priv int
pack-priv Color
pack-priv static final int
pack-priv boolean
pack-priv boolean
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int[]
pack-priv Caret[]
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv Clipboard
pack-priv Point
pack-priv int
pack-priv StyledTextContent
pack-priv Cursor
pack-priv boolean
customBackground

True if a non-default background color is set

pack-priv boolean
customForeground

True if a non-default foreground color is set

pack-priv static final int
pack-priv static final int
pack-priv Caret
pack-priv boolean
pack-priv Point
pack-priv boolean
pack-priv boolean
pack-priv boolean
enabled

False iff the widget is disabled

pack-priv Color
pack-priv static final int
pack-priv boolean
pack-priv boolean
pack-priv int
pack-priv int
pack-priv IME
pack-priv int
pack-priv boolean
insideSetEnableCall

True iff the widget is in the midst of being enabled or disabled

pack-priv static final boolean
pack-priv static final boolean
pack-priv boolean
pack-priv Map<Integer, Integer>
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv Image
pack-priv int
pack-priv int
pack-priv Listener
pack-priv Color
pack-priv boolean
pack-priv MouseNavigator
pack-priv int
pack-priv static final int
pack-priv boolean
pack-priv static final String
pack-priv static final int
pack-priv StyledTextRenderer
pack-priv Image
pack-priv int
pack-priv Point[]
pack-priv static final Comparator<Point>
pack-priv int[]
pack-priv Color
pack-priv Color
pack-priv static final String
pack-priv static final char
pack-priv int
pack-priv int[]
pack-priv TextChangeListener
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv boolean
pack-priv static final int
pack-priv int
pack-priv boolean
pack-priv boolean
pack-priv int

Constructor Summary

AccessConstructor and Description
public
StyledText(Composite
a widget which will be the parent of the new instance (cannot be null)
parent
,
int
the style of widget to construct
style
)

Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

Method Summary

Modifier and TypeMethod and Description
pack-priv char
public void
addBidiSegmentListener(BidiSegmentListener
the listener
listener
)

Adds a bidirectional segment listener.

public void
addCaretListener(CaretListener
the listener
listener
)

Adds a caret listener.

public void
addExtendedModifyListener(ExtendedModifyListener
the listener
extendedModifyListener
)

Adds an extended modify listener.

public void
addLineBackgroundListener(LineBackgroundListener
the listener
listener
)

Adds a line background listener.

public void
addLineStyleListener(LineStyleListener
the listener
listener
)

Adds a line style listener.

public void
addModifyListener(ModifyListener
the listener
modifyListener
)

Adds a modify listener.

public void
addPaintObjectListener(PaintObjectListener
the listener
listener
)

Adds a paint object listener.

pack-priv void
addSelection(int offset, int length)

public void
addSelectionListener(SelectionListener
the listener which should be notified when the user changes the receiver's selection
listener
)

Adds a selection listener.

public void
addVerifyKeyListener(VerifyKeyListener
the listener
listener
)

Adds a verify key listener.

public void
addVerifyListener(VerifyListener
the listener
verifyListener
)

Adds a verify listener.

public void
addWordMovementListener(MovementListener
the listener
movementListener
)

Adds a word movement listener.

public void
append(String
the string to be appended
string
)

Appends a string to the text at the end of the widget.

pack-priv void
calculateScrollBars()

Calculates the scroll bars

pack-priv void
calculateTopIndex(int delta)

Calculates the top index based on the current vertical scroll offset.

pack-priv boolean
pack-priv static int
checkStyle(int style)

Hides org.eclipse.swt.widgets.Composite.checkStyle.

Hides the scroll bars if widget is created in single line mode.
pack-priv void
claimBottomFreeSpace()

Scrolls down the text to use new space made available by a resize or by deleted lines.

pack-priv void
claimRightFreeSpace()

Scrolls text to the right to use new space made available by a resize.

pack-priv void
clearBlockSelection(boolean reset, boolean sendEvent)

pack-priv void
clearSelection(boolean
a Selection event is sent when set to true and when the selection is actually reset.
sendEvent
)

Removes the widget selection.

private SortedSet<Integer>
computeModifiedLines(int[]
former ranges, sorted by order and without overlapping, typically returned getRanges(int, int)
referenceRanges
,
StyleRange[] referenceStyles, int[]
former ranges, sorted by order and without overlapping
newRanges
,
StyleRange[] newStyles)

public Point
computeSize(int
the width hint (can be SWT.DEFAULT)
wHint
,
int
the height hint (can be SWT.DEFAULT)
hHint
,
boolean
true if the control's contents have changed, and false otherwise
changed
)

Overrides org.eclipse.swt.widgets.Control.computeSize.

Returns the preferred size (in points) of the receiver.
public void
copy()

Copies the selected text to the DND.CLIPBOARD clipboard.

public void
copy(int
indicates the type of clipboard
clipboardType
)

Copies the selected text to the specified clipboard.

pack-priv boolean
copySelection(int type)

pack-priv void
createCaretBitmaps()

Create the bitmaps to use for the caret in bidi mode.

pack-priv void
createKeyBindings()

Creates default key bindings.

private int[]
createRanges(StyleRange[] referenceStyles)

public void
cut()

Moves the selected text to the clipboard.

pack-priv void
doAutoScroll(Event event)

A mouse move event has occurred.

pack-priv void
doAutoScroll(int
SWT.UP, SWT.DOWN, SWT.COLUMN_NEXT, SWT.COLUMN_PREVIOUS
direction
,
int distance)

Initiates autoscrolling.

pack-priv void
doBackspace()

Deletes the previous character.

pack-priv void
doBlockColumn(boolean next)

pack-priv void
pack-priv void
doBlockLineHorizontal(boolean end)

pack-priv void
doBlockLineVertical(boolean up)

pack-priv void
doBlockSelection(boolean sendEvent)

pack-priv void
doBlockWord(boolean next)

pack-priv void
doContent(final char
the character typed by the user
key
)

Replaces the selection with the character or insert the character at the current caret position if no selection exists.

pack-priv void
doContentEnd()

Moves the caret after the last character of the widget content.

pack-priv void
doContentStart()

Moves the caret in front of the first character of the widget content.

pack-priv void
doCursorNext()

Moves the caret to the end of the selection if a selection exists.

pack-priv void
doCursorPrevious()

Moves the caret to the start of the selection if a selection exists.

pack-priv void
doDelete()

Deletes the next character.

pack-priv void
doDeleteWordNext()

Deletes the next word.

pack-priv void
doDeleteWordPrevious()

Deletes the previous word.

pack-priv void
doLineDown(boolean select)

Moves the caret one line down and to the same character offset relative to the beginning of the line.

pack-priv void
doLineEnd()

Moves the caret to the end of the line.

pack-priv void
doLineStart()

Moves the caret to the beginning of the line.

pack-priv void
doLineUp(boolean select)

Moves the caret one line up and to the same character offset relative to the beginning of the line.

pack-priv void
pack-priv void
doMouseLinkCursor(int x, int y)

pack-priv void
doMouseLocationChange(int
x location of the new caret position
x
,
int
y location of the new caret position
y
,
boolean
the location change is a selection operation. include the line delimiter in the selection
select
)

Moves the caret to the specified location.

pack-priv void
doMouseSelection()

Updates the selection based on the caret position

pack-priv int
doMouseWordSelect(int
mouse x location
x
,
int
caret offset of the mouse cursor location
newCaretOffset
,
int
line index of the mouse cursor location
line
)

Returns the offset of the word at the specified offset.

pack-priv void
doPageDown(boolean
whether or not to select the page
select
,
int height)

Scrolls one page down so that the last line (truncated or whole) of the current page becomes the fully visible top line.

pack-priv void
doPageEnd()

Moves the cursor to the end of the last fully visible line.

pack-priv void
doPageStart()

Moves the cursor to the beginning of the first fully visible line.

pack-priv void
doPageUp(boolean select, int height)

Scrolls one page up so that the first line (truncated or whole) of the current page becomes the fully visible last line.

pack-priv void
doSelection(int direction)

Updates the selection to extend to the current caret position.

pack-priv void
doSelectionCursorNext()

Moves the caret to the next character or to the beginning of the next line if the cursor is at the end of a line.

pack-priv void
doSelectionCursorPrevious()

Moves the caret to the previous character or to the end of the previous line if the cursor is at the beginning of a line.

pack-priv void
doSelectionLineDown()

Moves the caret one line down and to the same character offset relative to the beginning of the line.

pack-priv void
doSelectionLineUp()

Moves the caret one line up and to the same character offset relative to the beginning of the line.

pack-priv void
doSelectionPageDown(int pixels)

Scrolls one page down so that the last line (truncated or whole) of the current page becomes the fully visible top line.

pack-priv void
doSelectionPageUp(int pixels)

Scrolls one page up so that the first line (truncated or whole) of the current page becomes the fully visible last line.

pack-priv void
doSelectionWordNext()

Moves the caret to the end of the next word .

pack-priv void
doSelectionWordPrevious()

Moves the caret to the start of the previous word.

pack-priv void
doVisualNext()

Moves the caret one character to the right.

pack-priv void
doVisualPrevious()

Moves the caret one character to the left.

pack-priv void
doWordNext()

Moves the caret to the end of the next word.

pack-priv void
doWordPrevious()

Moves the caret to the start of the previous word.

pack-priv void
endAutoScroll()

Ends the autoscroll process.

private int
endRangeOffset(int[] ranges, int styleIndex)

The offset on which the range ends (excluded)

public int

Returns:

the alignment
getAlignment
()

Returns the alignment of the widget.

public boolean

Returns:

the Always Show Scrollbars flag value
getAlwaysShowScrollBars
()

Returns the Always Show Scrollbars flag.

pack-priv String
pack-priv int
pack-priv int
public Color
getBackground()

Overrides org.eclipse.swt.widgets.Control.getBackground.

Returns the receiver's background color.
public int

Returns:

baseline the baseline
getBaseline
()

Returns the baseline, in points.

public int

Returns:

baseline the baseline
getBaseline
(int
the offset
offset
)

Returns the baseline at the given offset, in points.

public boolean

Returns:

the current coloring mode
getBidiColoring
()

Deprecated use BidiSegmentListener instead.
Gets the BIDI coloring mode.
pack-priv StyledTextEvent
getBidiSegments(int lineOffset, String line)

pack-priv int[]
getBidiSegmentsCompatibility(String line, int lineOffset)

public boolean

Returns:

true if widget is in block selection mode, false otherwise
getBlockSelection
()

Returns whether the widget is in block selection mode.

public Rectangle

Returns:

the block selection bounds
getBlockSelectionBounds
()

Returns the block selection bounds.

pack-priv Rectangle
pack-priv Rectangle
pack-priv String
pack-priv int

Returns:

index of the last fully visible line.
getBottomIndex
()

Returns the index of the last fully visible line.

public int

Returns:

the bottom margin.
getBottomMargin
()

Returns the bottom margin.

pack-priv Rectangle
getBoundsAtOffset(int offset)

pack-priv int
public int

Returns:

the caret position relative to the start of the text.
getCaretOffset
()

Returns the caret position relative to the start of the text.

pack-priv int

Returns:

the caret width, 0 if caret is null.
getCaretWidth
()

Returns the caret width.

public int

Returns:

number of characters in the widget
getCharCount
()

Gets the number of characters.

pack-priv Object
getClipboardContent(int clipboardType)

pack-priv int
getClusterNext(int offset, int lineIndex)

pack-priv int
getClusterPrevious(int offset, int lineIndex)

public StyledTextContent

Returns:

content the user defined content implementation that is used for text storage or the default content implementation if no user defined content implementation has been set.
getContent
()

Returns the content implementation that is used for text storage.

public boolean

Returns:

true if double clicking a word selects the word, false if double clicks have the same effect as regular mouse clicks
getDoubleClickEnabled
()

Returns whether the widget implements double click mouse behavior.

public boolean
getDragDetect()

Overrides org.eclipse.swt.widgets.Control.getDragDetect.

Returns true if the receiver is detecting drag gestures, and false otherwise.
public boolean

Returns:

true if content can be edited, false otherwise
getEditable
()

Returns whether the widget content can be edited.

pack-priv int
public Color
getForeground()

Overrides org.eclipse.swt.widgets.Control.getForeground.

Returns the foreground color that the receiver will use to draw.
pack-priv int

Returns:

horizontal scroll increment.
getHorizontalIncrement
()

Returns the horizontal scroll increment.

public int

Returns:

horizontal scroll offset relative to the start of the line, measured in character increments starting at 0, if > 0 the content is scrolled
getHorizontalIndex
()

Returns the horizontal scroll offset relative to the start of the line.

public int

Returns:

the horizontal scroll offset relative to the start of the line, measured in SWT logical point starting at 0, if > 0 the content is scrolled.
getHorizontalPixel
()

Returns the horizontal scroll offset relative to the start of the line.

public int

Returns:

the line indentation
getIndent
()

Returns the line indentation of the widget.

public boolean

Returns:

whether lines are justified
getJustify
()

Returns whether the widget justifies lines.

public int

Returns:

one of the predefined actions defined in ST.java or SWT.NULL if there is no action associated with the key.
getKeyBinding
(int
a key code defined in SWT.java or a character. Optionally ORd with a state mask. Preferred state masks are one or more of SWT.MOD1, SWT.MOD2, SWT.MOD3, since these masks account for modifier platform differences. However, there may be cases where using the specific state masks (i.e., SWT.CTRL, SWT.SHIFT, SWT.ALT, SWT.COMMAND) makes sense.
key
)

Returns the action assigned to the key.

public int

Returns:

the left margin.
getLeftMargin
()

Returns the left margin.

public String

Returns:

the line text without delimiters
getLine
(int
index of the line to return.
lineIndex
)

Returns the line at the given line index without delimiters.

public int

Returns:

the line alignment
getLineAlignment
(int
the index of the line
index
)

Returns the alignment of the line at the given index.

public int

Returns:

line at the specified offset in the text
getLineAtOffset
(int
offset relative to the start of the content. 0 <= offset <= getCharCount()
offset
)

Returns the line at the specified offset in the text where 0 < offset < getCharCount() so that getLineAtOffset(getCharCount()) returns the line of the insert location.

public Color

Returns:

the background color of the line at the given index.
getLineBackground
(int
the index of the line
index
)

Returns the background color of the line at the given index.

pack-priv StyledTextEvent

Returns:

line background data for the given line.
getLineBackgroundData
(int
offset of the line start relative to the start of the content.
lineOffset
,
String
line to get line background data for
line
)

Returns the line background data for the given line or null if there is none.

public Bullet

Returns:

the line bullet
getLineBullet
(int
the index of the line
index
)

Returns the bullet of the line at the given index.

public int

Returns:

the number of lines in the widget
getLineCount
()

Gets the number of text lines.

pack-priv int

Returns:

number of lines that can be completely displayed in the widget client area.
getLineCountWhole
()

Returns the number of lines that can be completely displayed in the widget client area.

public String

Returns:

line delimiter used for entering new lines by key down or paste operation.
getLineDelimiter
()

Returns the line delimiter used for entering new lines by key down or paste operation.

public int

Returns:

line height in points.
getLineHeight
()

Returns the line height.

public int

Returns:

line height in points
getLineHeight
(int
the offset
offset
)

Returns the line height at the given offset.

public int

Returns:

the line indentation
getLineIndent
(int
the index of the line
index
)

Returns the indentation of the line at the given index.

public int

Returns:

the line index for a given y-coordinate point
getLineIndex
(int
the y-coordinate point
y
)

Returns the line index for a y, relative to the client area.

public boolean

Returns:

whether the line is justified
getLineJustify
(int
the index of the line
index
)

Returns whether the line at the given index is justified.

public int

Returns:

the top SWT logical point of a given line index
getLinePixel
(int
the line index, the max value is lineCount. If lineIndex == lineCount it returns the bottom SWT logical point of the last line. It means this function can be used to retrieve the bottom SWT logical point of any line.
lineIndex
)

Returns the top SWT logical point, relative to the client area, of a given line.

public int

Returns:

the line spacing
getLineSpacing
()

Returns the line spacing of the widget.

pack-priv StyledTextEvent

Returns:

line style data for the given line. Styles may start before line start and end after line end
getLineStyleData
(int
offset of the line start relative to the start of the content.
lineOffset
,
String
line to get line styles for
line
)

Returns the line style data for the given line or null if there is none.

public int[]

Returns:

the tab stops for the line
getLineTabStops
(int
the index of the line
index
)

Returns the tab stops of the line at the given index.

public int

Returns:

the line vertical indentation
getLineVerticalIndent
(int
the index of the line
index
)

Returns the vertical indentation of the line at the given index.

public int

Returns:

the wrap indentation
getLineWrapIndent
(int
the index of the line
index
)

Returns the wrap indentation of the line at the given index.

public Point

Returns:

x, y location of the upper left corner of the character bounding box at the specified offset in the text.
getLocationAtOffset
(int
offset relative to the start of the content. 0 <= offset <= getCharCount()
offset
)

Returns the x, y location of the upper left corner of the character bounding box at the specified offset in the text.

public Color

Returns:

the color of the margins.
getMarginColor
()

Returns the color of the margins.

pack-priv String

Returns:

the converted text that only uses the line delimiter specified by the model. Returns only the first line if the widget has the SWT.SINGLE style.
getModelDelimitedText
(String
the text that may have line delimiters that don't match the model line delimiter. Possible line delimiters are CR ('\r'), LF ('\n'), CR/LF ("\r\n")
text
)

Returns a string that uses only the line delimiter specified by the StyledTextContent implementation.

public boolean

Returns:

the mouse navigator's enabled state
getMouseNavigatorEnabled
()

Returns true if the mouse navigator is enabled.

public int

Returns:

offset offset of the first character of the line, relative to the beginning of the document. The first character of the document is at offset 0. When there are not any lines, getOffsetAtLine(0) is a valid call that answers 0.
getOffsetAtLine
(int
index of the line, 0 based relative to the first line in the content. 0 <= lineIndex < getLineCount(), except lineIndex may always be 0
lineIndex
)

Returns the character offset of the first character of the given line.

public int

Returns:

offset of the character at the given location relative to the first character in the document.
getOffsetAtLocation
(Point
the origin of character bounding box relative to the origin of the widget client area.
point
)

Deprecated Use getOffsetAtPoint(Point) instead for better performance
Returns the offset of the character at the given location relative to the first character in the document.
public int

Returns:

offset of the character at the given point relative to the first character in the document. -1 when there is no character at the specified location.
getOffsetAtPoint
(Point
the origin of character bounding box relative to the origin of the widget client area.
point
)

Returns the offset of the character at the given point relative to the first character in the document.

pack-priv int
getOffsetAtPoint(int x, int y, int[] alignment)

pack-priv int
getOffsetAtPoint(int x, int y, int lineIndex, int[] alignment)

pack-priv int
getOffsetAtPoint(int x, int y, int[] trailing, boolean inTextOnly)

public int

Returns:

the orientation style
getOrientation
()

Overrides org.eclipse.swt.widgets.Control.getOrientation.

Returns the orientation of the receiver.
pack-priv int

Returns:

index of the last partially visible line.
getPartialBottomIndex
()

Returns the index of the last partially visible line.

pack-priv int

Returns:

index of the first partially visible line.
getPartialTopIndex
()

Returns the index of the first partially visible line.

pack-priv String

Returns:

the content in the specified range using the platform line delimiter to separate lines as written by the specified TextWriter.
getPlatformDelimitedText
(TextWriter
the TextWriter to write line text into
writer
)

Returns the content in the specified range using the platform line delimiter to separate lines.

pack-priv Point

Returns:

location of the character at the given offset in the line.
getPointAtOffset
(int offset)

Returns the location of the given offset.

public int[]

Returns:

the ranges or an empty array if a LineStyleListener has been set.
getRanges
()

Returns all the ranges of text that have an associated StyleRange.

public int[]

Returns:

the ranges or an empty array if a LineStyleListener has been set.
getRanges
(int
the start offset of the style ranges to return
start
,
int
the number of style ranges to return
length
)

Returns the ranges of text that have an associated StyleRange.

public int

Returns:

the right margin.
getRightMargin
()

Returns the right margin.

public Point

Returns:

start and end of the selection, x is the offset of the first selected character, y is the offset after the last selected character. The selection values returned are visual (i.e., x will always always be <= y). To determine if a selection is right-to-left (RtoL) vs. left-to-right (LtoR), compare the caretOffset to the start and end of the selection (e.g., caretOffset == start of selection implies that the selection is RtoL).
getSelection
()

Returns the selection.

public Color

Returns:

the selection background color
getSelectionBackground
()

Returns the receiver's selection background color.

public int

Returns:

the number of selected characters.
getSelectionCount
()

Gets the number of selected characters.

public Color

Returns:

the selection foreground color
getSelectionForeground
()

Returns the receiver's selection foreground color.

public Point

Returns:

start and length of the selection, x is the offset of the first selected character, relative to the first character of the widget content. y is the length of the selection. The selection values returned are visual (i.e., length will always always be positive). To determine if a selection is right-to-left (RtoL) vs. left-to-right (LtoR), compare the caretOffset to the start and end of the selection (e.g., caretOffset == start of selection implies that the selection is RtoL).
getSelectionRange
()

Returns the selection.

public int[]

Returns:

the ranges array
getSelectionRanges
()

Returns the selected ranges of text.

public String

Returns:

selected text, or an empty String if there is no selection.
getSelectionText
()

Returns the selected text.

public StyleRange

Returns:

a StyleRange with start == offset and length == 1, indicating the style at the given offset. null if a LineStyleListener has been set or if a style is not set for the given offset.
getStyleRangeAtOffset
(int
the offset to return the style for. 0 <= offset < getCharCount() must be true.
offset
)

Returns the style range at the given offset.

public StyleRange[]

Returns:

the styles or an empty array if a LineStyleListener has been set.
getStyleRanges
()

Returns the styles.

public StyleRange[]

Returns:

the styles or an empty array if a LineStyleListener has been set.
getStyleRanges
(boolean
whether the start and length field of the StyleRanges should be set.
includeRanges
)

Returns the styles.

public StyleRange[]

Returns:

the styles or an empty array if a LineStyleListener has been set. The returned styles will reflect the given range. The first returned StyleRange will have a starting offset >= start and the last returned StyleRange will have an ending offset <= start + length - 1
getStyleRanges
(int
the start offset of the style ranges to return
start
,
int
the number of style ranges to return
length
)

Returns the styles for the given text range.

public StyleRange[]

Returns:

the styles or an empty array if a LineStyleListener has been set. The returned styles will reflect the given range. The first returned StyleRange will have a starting offset >= start and the last returned StyleRange will have an ending offset >= start + length - 1
getStyleRanges
(int
the start offset of the style ranges to return
start
,
int
the number of style ranges to return
length
,
boolean
whether the start and length field of the StyleRanges should be set.
includeRanges
)

Returns the styles for the given text range.

public int

Returns:

tab width measured in characters
getTabs
()

Returns the tab width measured in characters.

public int[]

Returns:

the tab list
getTabStops
()

Returns the tab list of the receiver.

public String

Returns:

copy of the widget content
getText
()

Returns a copy of the widget content.

public String

Returns:

widget content starting at start and ending at end
getText
(int
offset of the first character in the returned String
start
,
int
offset of the last character in the returned String
end
)

Returns the widget content between the two offsets.

public Rectangle

Returns:

bounding box of the text between start and end
getTextBounds
(int
offset of the first character included in the bounding box
start
,
int
offset of the last character included in the bounding box
end
)

Returns the smallest bounding rectangle that includes the characters between two offsets.

public int

Returns:

the text limit
getTextLimit
()

Returns the maximum number of characters that the receiver is capable of holding.

public String

Returns:

widget content starting at start and extending length characters.
getTextRange
(int
offset of the first character in the returned String
start
,
int
number of characters to return
length
)

Returns the widget content starting at start for length characters.

public int

Returns:

the index of the top line
getTopIndex
()

Gets the top index.

public int

Returns:

the top margin.
getTopMargin
()

Returns the top margin.

public int

Returns:

SWT logical point position of the top line
getTopPixel
()

Gets the top SWT logical point.

pack-priv int

Returns:

vertical scroll increment.
getVerticalIncrement
()

Returns the vertical scroll increment.

pack-priv int
pack-priv int
getVisualLineIndex(TextLayout layout, int offsetInLine)

pack-priv int
getWordNext(int offset, int movement)

pack-priv int
getWordNext(int offset, int movement, boolean ignoreListener)

pack-priv int
getWordPrevious(int offset, int movement)

pack-priv int
getWordPrevious(int offset, int movement, boolean ignoreListener)

public boolean

Returns:

true if widget wraps lines, false otherwise
getWordWrap
()

Returns whether the widget wraps lines.

public int

Returns:

the wrap indentation
getWrapIndent
()

Returns the wrap indentation of the widget.

pack-priv int
private static int
pack-priv void
pack-priv void
pack-priv void
pack-priv void
handleDispose(Event event)

Frees resources.

pack-priv void
handleHorizontalScroll(Event event)

Scrolls the widget horizontally.

pack-priv void
handleKey(Event
keyboard event
event
)

If an action has been registered for the key stroke execute the action.

pack-priv void
handleKeyDown(Event
keyboard event
event
)

If a VerifyKey listener exists, verify that the key that was entered should be processed.

pack-priv void
handleKeyUp(Event
keyboard event
event
)

Update the Selection Clipboard.

pack-priv void
handleMenuDetect(Event
menu detect event
event
)

Update the event location for focus-based context menu triggers.

pack-priv void
handleMouseDown(Event event)

Updates the caret location and selection if mouse button 1 has been pressed.

pack-priv void
handleMouseMove(Event event)

Updates the caret location and selection if mouse button 1 is pressed during the mouse move.

pack-priv void
handleMouseUp(Event event)

Autoscrolling ends when the mouse button is released.

pack-priv void
handlePaint(Event
paint event
event
)

Renders the invalidated area specified in the paint event.

pack-priv void
handleResize(Event
resize event
event
)

Recalculates the scroll bars.

pack-priv void
handleTextChanged(TextChangedEvent event)

Updates the caret position and selection and the scroll bars to reflect the content change.

pack-priv void
handleTextChanging(TextChangingEvent
  • .start the start offset of the change
  • .newText text that is going to be inserted or empty String if no text will be inserted
  • .replaceCharCount length of text that is going to be replaced
  • .newCharCount length of text that is going to be inserted
  • .replaceLineCount number of lines that are going to be replaced
  • .newLineCount number of new lines that are going to be inserted
event
)

Updates the screen to reflect a pending content change.

pack-priv void
handleTextSet(TextChangedEvent
text change event.
event
)

Called when the widget content is set programmatically, overwriting the old content.

pack-priv void
handleTraverse(Event
the event
event
)

Called when a traversal key is pressed.

pack-priv void
handleVerticalScroll(Event event)

Scrolls the widget vertically.

private boolean
pack-priv void
initializeAccessible()

Add accessibility support for the widget.

public void
insert(String
the string
string
)

Inserts a string.

pack-priv int
insertBlockSelectionText(String text, boolean fillWithSpaces)

pack-priv void
insertBlockSelectionText(char key, int action)

private void
pack-priv void
installDefaultContent()

Creates content change listeners and set the default content model.

pack-priv void
installListeners()

Adds event listeners

pack-priv void
internalRedrawRange(int start, int length)

public void
invokeAction(int
one of the actions defined in ST.java
action
)

Executes the action.

pack-priv boolean
invokeBlockAction(int action)

Returns true if an action should not be performed when block selection in active

pack-priv boolean
pack-priv boolean
private boolean
isInRange(int[] ranges, int styleIndex, int offset)

pack-priv boolean

Returns:

true if the given offset is inside a multi byte line delimiter. false if the given offset is before or after a line delimiter.
isLineDelimiter
(int offset)

Returns whether the given offset is inside a multi byte line delimiter.

pack-priv boolean

Returns:

isMirrored true=the widget is right oriented, false=the widget is left oriented
isMirrored
()

Returns whether the widget is mirrored (right oriented/right to left writing order).

pack-priv boolean

Returns:

true if widget can have only one line, false if widget can have multiple lines
isSingleLine
()

Returns whether the widget can have only one line.

public boolean

Returns:

the text selection state
isTextSelected
()

Returns true if any text in the widget is selected, and false otherwise.

pack-priv boolean

Returns:

true if StyledText is in word wrap mode and false otherwise.
isWordWrap
()

Returns true if StyledText is in word wrap mode and false otherwise.

pack-priv void
modifyContent(Event
the text change event.
  • event.start - the replace start offset
  • event.end - the replace end offset
  • event.text - the new text
event
,
boolean
whether or not he caret should be set behind the new text
updateCaret
)

Sends the specified verify event, replace/insert text as defined by the event and send a modify event.

pack-priv void
paintObject(GC gc, int x, int y, int ascent, int descent, StyleRange style, Bullet bullet, int bulletIndex)

public void
paste()

Replaces the selection with the text on the DND.CLIPBOARD clipboard or, if there is no selection, inserts the text at the current caret offset.

private void
public void
redraw()

Overrides org.eclipse.swt.widgets.Control.redraw.

Causes the entire bounds of the receiver to be marked as needing to be redrawn.
public void
redraw(int
the x coordinate of the area to draw
x
,
int
the y coordinate of the area to draw
y
,
int
the width of the area to draw
width
,
int
the height of the area to draw
height
,
boolean
true if children should redraw, and false otherwise
all
)

Overrides org.eclipse.swt.widgets.Control.redraw.

Causes the rectangular area of the receiver specified by the arguments to be marked as needing to be redrawn.
pack-priv void
redrawLines(int startLine, int lineCount, boolean bottomChanged)

pack-priv void
redrawLinesBullet(int[] redrawLines)

pack-priv void
redrawMargins(int oldHeight, int oldWidth)

public void
redrawRange(int
offset of the first character to redraw
start
,
int
number of characters to redraw
length
,
boolean
true if the background should be cleared as part of the redraw operation. If true, the entire redraw range will be cleared before anything is redrawn. If the redraw range includes the last character of a line (i.e., the entire line is redrawn) the line is cleared all the way to the right border of the widget. The redraw operation will be faster and smoother if clearBackground is set to false. Whether or not the flag can be set to false depends on the type of change that has taken place. If font styles or background colors for the redraw range have changed, clearBackground should be set to true. If only foreground colors have changed for the redraw range, clearBackground can be set to false.
clearBackground
)

Redraws the specified text range.

public void
removeBidiSegmentListener(BidiSegmentListener
the listener which should no longer be notified
listener
)

Removes the specified bidirectional segment listener.

public void
removeCaretListener(CaretListener
the listener which should no longer be notified
listener
)

Removes the specified caret listener.

public void
removeExtendedModifyListener(ExtendedModifyListener
the listener which should no longer be notified
extendedModifyListener
)

Removes the specified extended modify listener.

public void
removeLineBackgroundListener(LineBackgroundListener
the listener which should no longer be notified
listener
)

Removes the specified line background listener.

public void
removeLineStyleListener(LineStyleListener
the listener which should no longer be notified
listener
)

Removes the specified line style listener.

public void
removeModifyListener(ModifyListener
the listener which should no longer be notified
modifyListener
)

Removes the specified modify listener.

public void
removePaintObjectListener(PaintObjectListener
the listener which should no longer be notified
listener
)

Removes the specified listener.

public void
removeSelectionListener(SelectionListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection.

public void
removeVerifyKeyListener(VerifyKeyListener
the listener which should no longer be notified
listener
)

Removes the specified key verify listener.

public void
removeVerifyListener(VerifyListener
the listener which should no longer be notified
verifyListener
)

Removes the specified verify listener.

public void
removeWordMovementListener(MovementListener
the listener which should no longer be notified
listener
)

Removes the specified word movement listener.

public void
replaceStyleRanges(int
offset of first character where styles will be deleted
start
,
int
length of the range to delete styles in
length
,
StyleRange[]
StyleRange objects containing the new style information. The ranges should not overlap and should be within the specified start and length. The style rendering is undefined if the ranges do overlap or are ill-defined. Must not be null.
ranges
)

Replaces the styles in the given range with new styles.

public void
replaceTextRange(int
offset of first character to replace
start
,
int
number of characters to replace. Use 0 to insert text
length
,
String
new text. May be empty to delete text.
text
)

Replaces the given text range with new text.

pack-priv void
reset()

Resets the caret position, selection and scroll offsets.

pack-priv void
pack-priv void
pack-priv void
resetCache(int firstLine, int count)

pack-priv void
resetSelection()

Resets the selection.

public void
scroll(int
the x coordinate of the destination
destX
,
int
the y coordinate of the destination
destY
,
int
the x coordinate of the source
x
,
int
the y coordinate of the source
y
,
int
the width of the area
width
,
int
the height of the area
height
,
boolean
trueif children should be scrolled, and false otherwise
all
)

Overrides org.eclipse.swt.widgets.Canvas.scroll.

Scrolls a rectangular area of the receiver by first copying the source area to the destination and then causing the area of the source which is not covered by the destination to be repainted.
pack-priv boolean

Returns:

true=the widget was scrolled false=the widget was not scrolled, the given offset is not valid.
scrollHorizontal
(int
number of SWT logical points to scroll, > 0 = scroll left, < 0 scroll right
pixels
,
boolean
true= the scroll thumb will be moved to reflect the new scroll offset. false = the scroll thumb will not be moved
adjustScrollBar
)

Scrolls the widget horizontally.

pack-priv void
scrollText(int srcY, int destY)

pack-priv boolean

Returns:

true=the widget was scrolled false=the widget was not scrolled
scrollVertical
(int
the new vertical scroll offset
pixels
,
boolean
true= the scroll thumb will be moved to reflect the new scroll offset. false = the scroll thumb will not be moved
adjustScrollBar
)

Scrolls the widget vertically.

public void
selectAll()

Selects all the text.

pack-priv void
pack-priv void
sendAccessibleTextChanged(int start, int newCharCount, int replaceCharCount)

pack-priv void
sendKeyEvent(Event
the text change event.
  • event.start - the replace start offset
  • event.end - the replace end offset
  • event.text - the new text
event
)

Replaces/inserts text as defined by the event.

pack-priv StyledTextEvent

Returns:

StyledTextEvent that can be used to request line data for the given line.
sendLineEvent
(int eventType, int
offset of the line. This may be the offset of a visual line if the widget is in word wrap mode.
lineOffset
,
String
line text. This may be the text of a visual line if the widget is in word wrap mode.
line
)

Returns a StyledTextEvent that can be used to request data such as styles and background color for a line.

pack-priv void
sendSelectionEvent()

Sends the specified selection event.

pack-priv int
sendTextEvent(int left, int right, int lineIndex, String text, boolean fillWithSpaces)

pack-priv int
sendWordBoundaryEvent(int eventType, int movement, int offset, int newOffset, String lineText, int lineOffset)

pack-priv void
public void
setAlignment(int
the new alignment
alignment
)

Sets the alignment of the widget.

public void
setAlwaysShowScrollBars(boolean
true to show the scrollbars even when not required, false to show scrollbars only when required
show
)

Set the Always Show Scrollbars flag.

public void
setBackground(Color
the new color (or null)
color
)

Overrides org.eclipse.swt.widgets.Control.setBackground.

Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.
public void
setBidiColoring(boolean
the new coloring mode
mode
)

Deprecated use BidiSegmentListener instead.
Sets the BIDI coloring mode.
public void
setBlockSelection(boolean
true=enable block selection, false=disable block selection
blockSelection
)

Sets the block selection mode.

public void
setBlockSelectionBounds(Rectangle
the new bounds for the block selection
rect
)

Sets the block selection bounds.

public void
setBlockSelectionBounds(int
the new x coordinate for the block selection
x
,
int
the new y coordinate for the block selection
y
,
int
the new width for the block selection
width
,
int
the new height for the block selection
height
)

Sets the block selection bounds.

pack-priv void
setBlockSelectionLocation(int x, int y, boolean sendEvent)

pack-priv void
setBlockSelectionLocation(int anchorX, int anchorY, int x, int y, boolean sendEvent)

pack-priv void
setBlockSelectionOffset(int offset, boolean sendEvent)

pack-priv void
setBlockSelectionOffset(int anchorOffset, int offset, boolean sendEvent)

public void
setBottomMargin(int
the bottom margin.
bottomMargin
)

Sets the bottom margin.

public void
setCaret(Caret
the new caret for the receiver
caret
)

Overrides org.eclipse.swt.widgets.Canvas.setCaret.

Sets the receiver's caret.
pack-priv void
setCaretLocations()

Moves the Caret to the current caret offset.

pack-priv void
setCaretLocations(final Point[] locations, int direction)

public void
setCaretOffset(int
caret offset, relative to the first character in the text.
offset
)

Sets the caret offset.

pack-priv void
setCaretOffsets(int[] newOffsets, int alignment)

pack-priv void
setClipboardContent(int
start index of the text
start
,
int
length of text to place in clipboard
length
,
int clipboardType)

Copies the specified text range to the clipboard.

public void
setContent(StyledTextContent
StyledTextContent implementation to use for text storage.
newContent
)

Sets the content implementation to use for text storage.

public void
setCursor(Cursor
the new cursor (or null)
cursor
)

Overrides org.eclipse.swt.widgets.Control.setCursor.

Sets the receiver's cursor to the cursor specified by the argument.
public void
setDoubleClickEnabled(boolean
if true double clicking a word selects the word, if false double clicks have the same effect as regular mouse clicks.
enable
)

Sets whether the widget implements double click mouse behavior.

public void
setDragDetect(boolean
the new drag detect state
dragDetect
)

Overrides org.eclipse.swt.widgets.Control.setDragDetect.

Sets the receiver's drag detect state.
public void
setEditable(boolean
if true content can be edited, if false content can not be edited
editable
)

Sets whether the widget content can be edited.

public void
setEnabled(boolean
the new enabled state
enabled
)

Overrides org.eclipse.swt.widgets.Control.setEnabled.

Enables the receiver if the argument is true, and disables it otherwise.
public void
public boolean
setFocus()

Overrides org.eclipse.swt.widgets.Composite.setFocus.

Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.
public void
setFont(Font
new font
font
)

Overrides org.eclipse.swt.widgets.Canvas.setFont.

Sets a new font to render text with.
public void
setForeground(Color
the new color (or null)
color
)

Overrides org.eclipse.swt.widgets.Control.setForeground.

Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.
public void
setHorizontalIndex(int
horizontal scroll offset relative to the start of the line, measured in character increments starting at 0, if equal to 0 the content is not scrolled, if > 0 = the content is scrolled.
offset
)

Sets the horizontal scroll offset relative to the start of the line.

public void
setHorizontalPixel(int
horizontal SWT logical point offset relative to the start of the line.
pixel
)

Sets the horizontal SWT logical point offset relative to the start of the line.

public void
setIndent(int
the new indent
indent
)

Sets the line indentation of the widget.

public void
setJustify(boolean
whether lines should be justified
justify
)

Sets whether the widget should justify lines.

public void
setKeyBinding(int
a key code defined in SWT.java or a character. Optionally ORd with a state mask. Preferred state masks are one or more of SWT.MOD1, SWT.MOD2, SWT.MOD3, since these masks account for modifier platform differences. However, there may be cases where using the specific state masks (i.e., SWT.CTRL, SWT.SHIFT, SWT.ALT, SWT.COMMAND) makes sense.
key
,
int
one of the predefined actions defined in ST.java. Use SWT.NULL to remove a key binding.
action
)

Maps a key to an action.

public void
setLeftMargin(int
the left margin.
leftMargin
)

Sets the left margin.

public void
setLineAlignment(int
first line the alignment is applied to, 0 based
startLine
,
int
number of lines the alignment applies to.
lineCount
,
int
line alignment
alignment
)

Sets the alignment of the specified lines.

public void
setLineBackground(int
first line the color is applied to, 0 based
startLine
,
int
number of lines the color applies to.
lineCount
,
Color
line background color
background
)

Sets the background color of the specified lines.

public void
setLineBullet(int
first line the bullet is applied to, 0 based
startLine
,
int
number of lines the bullet applies to.
lineCount
,
Bullet
line bullet
bullet
)

Sets the bullet of the specified lines.

public void
setLineIndent(int
first line the indent is applied to, 0 based
startLine
,
int
number of lines the indent applies to.
lineCount
,
int
line indent
indent
)

Sets the indent of the specified lines.

public void
setLineJustify(int
first line the justify is applied to, 0 based
startLine
,
int
number of lines the justify applies to.
lineCount
,
boolean
true if lines should be justified
justify
)

Sets the justify of the specified lines.

public void
setLineSpacing(int
the line spacing
lineSpacing
)

Sets the line spacing of the widget.

public void
setLineSpacingProvider(StyledTextLineSpacingProvider
the line spacing provider (or null)
lineSpacingProvider
)

Sets the line spacing provider of the widget.

public void
setLineTabStops(int
first line the justify is applied to, 0 based
startLine
,
int
number of lines the justify applies to.
lineCount
,
int[]
tab stops
tabStops
)

Sets the tab stops of the specified lines.

public void
setLineVerticalIndent(int
line index the vertical indent is applied to, 0 based
lineIndex
,
int
vertical line indent
verticalLineIndent
)

Sets the vertical indent of the specified lines.

public void
setLineWrapIndent(int
first line the wrap indent is applied to, 0 based
startLine
,
int
number of lines the wrap indent applies to.
lineCount
,
int
line wrap indent
wrapIndent
)

Sets the wrap indent of the specified lines.

public void
setMarginColor(Color
the new color (or null)
color
)

Sets the color of the margins.

public void
setMargins(int
the left margin.
leftMargin
,
int
the top margin.
topMargin
,
int
the right margin.
rightMargin
,
int
the bottom margin.
bottomMargin
)

Sets the margins.

public void
setMouseNavigatorEnabled(boolean
if true, the mouse navigator is enabled, if false the mouse navigator is deactivated
enabled
)

Sets the enabled state of the mouse navigator.

pack-priv void
setMouseWordSelectionAnchor()

Flips selection anchor based on word selection direction.

public void
setOrientation(int
new orientation style
orientation
)

Overrides org.eclipse.swt.widgets.Control.setOrientation.

Sets the orientation of the receiver, which must be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.
public void
setRightMargin(int
the right margin.
rightMargin
)

Sets the right margin.

pack-priv void
setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin)

pack-priv void
setScrollBars(boolean
indicates if the vertical scrollbar also needs to be set
vertical
)

Adjusts the maximum and the page size of the scroll bars to reflect content width/length changes.

public void
setSelection(int
new caret position
start
)

Sets the selection to the given position and scrolls it into view.

public void
setSelection(Point
x=selection start offset, y=selection end offset The caret will be placed at the selection start when x > y.
point
)

Sets the selection and scrolls it into view.

public void
setSelection(int
selection start offset. The caret will be placed at the selection start when start > end.
start
,
int
selection end offset
end
)

Sets the selection and scrolls it into view.

pack-priv void
setSelection(int[]
offset of the first selected character, start >= 0 must be true.
regions
,
boolean
a Selection event is sent when set to true and when the selection is reset.
sendEvent
,
boolean doBlock)

Sets the selection.

public void
setSelectionBackground(Color
the new color (or null)
color
)

Sets the receiver's selection background color to the color specified by the argument, or to the default system color for the control if the argument is null.

public void
setSelectionForeground(Color
the new color (or null)
color
)

Sets the receiver's selection foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.

public void
setSelectionRange(int
offset of the first selected character
start
,
int
number of characters to select
length
)

Sets the selection.

public void
setSelectionRanges(int[]
an array of offset/length pairs.
ranges
)

Sets the selected locations/ranges.

public void
setStyleRange(StyleRange
StyleRange object containing the style information. Overwrites the old style in the given range. May be null to delete all styles.
range
)

Adds the specified style.

public void
setStyleRanges(int
offset of first character where styles will be deleted
start
,
int
length of the range to delete styles in
length
,
int[]
the array of ranges. The ranges must not overlap and must be in order.
ranges
,
StyleRange[]
the array of StyleRanges. The range fields within the StyleRange are unused.
styles
)

Clears the styles in the range specified by start and length and adds the new styles.

public void
setStyleRanges(int[]
the array of ranges. The ranges must not overlap and must be in order.
ranges
,
StyleRange[]
the array of StyleRanges. The range fields within the StyleRange are unused.
styles
)

Sets styles to be used for rendering the widget content.

pack-priv void
setStyleRanges(int start, int length, int[] ranges, StyleRange[] styles, boolean reset)

public void
setStyleRanges(StyleRange[]
StyleRange objects containing the style information. The ranges should not overlap. The style rendering is undefined if the ranges do overlap. Must not be null. The styles need to be in order.
ranges
)

Sets styles to be used for rendering the widget content.

public void
setTabs(int
tab width measured in characters.
tabs
)

Sets the tab width.

public void
setTabStops(int[]
the new tab list (or null)
tabs
)

Sets the receiver's tab list.

public void
setText(String
new widget content. Replaces existing content. Line styles that were set using StyledText API are discarded. The current selection is also discarded.
text
)

Sets the widget content.

public void
setTextDirection(int
the base text direction style
textDirection
)

Overrides org.eclipse.swt.widgets.Control.setTextDirection.

Sets the base text direction (a.k.a. "paragraph direction") of the receiver, which must be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.
public void
setTextLimit(int
the new text limit.
limit
)

Sets the text limit to the specified number of characters.

public void
setTopIndex(int
new top index. Must be between 0 and getLineCount() - fully visible lines per page. If no lines are fully visible the maximum value is getLineCount() - 1. An out of range index will be adjusted accordingly.
topIndex
)

Sets the top index.

public void
setTopMargin(int
the top margin.
topMargin
)

Sets the top margin.

public void
setTopPixel(int
new top point offset. Must be between 0 and (getLineCount() - visible lines per page) / getLineHeight()). An out of range offset will be adjusted accordingly.
pixel
)

Sets the top SWT logical point offset.

public void
setWordWrap(boolean
true=widget wraps lines, false=widget does not wrap lines
wrap
)

Sets whether the widget wraps lines.

public void
setWrapIndent(int
the new wrap indent
wrapIndent
)

Sets the wrap line indentation of the widget.

pack-priv void
showCaret()

Sets the caret location and scrolls the caret offset into view.

pack-priv boolean
showLocation(Rectangle rect, boolean scrollPage)

public void
showSelection()

Scrolls the selection into view.

pack-priv String
pack-priv void
pack-priv void
updateSelection(int
offset of the text change
startOffset
,
int
length of text being replaced
replacedLength
,
int
length of new text
newLength
)

Updates the selection and caret position depending on the text change.

Inherited from org.eclipse.swt.widgets.Canvas:
drawBackgroundgetCaretgetIMEsetIME