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.
Important Note
This class is not intended to be subclassed.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | StyledText.
The Printing class implements printing of a range of text. |
| Modifier and Type | Field 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 | |
| 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 | |
| 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 |
| Access | Constructor 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. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv char | |
| public void | addBidiSegmentListener(BidiSegmentListener
the listener listener)Adds a bidirectional segment listener. |
| public void | |
| 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 | |
| public void | |
| public void | |
| pack-priv void | |
| 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 | |
| public void | |
| public void | addWordMovementListener(MovementListener
the listener movementListener)Adds a word movement listener. |
| public void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv boolean | |
| pack-priv static int | checkStyle(int style)
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 | |
| pack-priv void | |
| 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 | computeModifiedLines(int[]
former ranges, sorted by order and without overlapping, typically returned referenceRanges, StyleRange[] referenceStyles, int[] getRanges(int, int)former ranges, sorted by order and without overlapping newRanges, StyleRange[] newStyles)
|
| public Point | computeSize(int
the width hint (can be wHint, int SWT.DEFAULT)the height hint (can be hHint, boolean SWT.DEFAULT)true if the control's contents have changed, and false otherwiseOverrides org. |
| public void | |
| public void | copy(int
indicates the type of clipboard clipboardType)Copies the selected text to the specified clipboard. |
| pack-priv boolean | |
| pack-priv void | |
| pack-priv void | |
| private int[] | |
| public void | |
| pack-priv void | |
| pack-priv void | doAutoScroll(int
SWT.UP, SWT.DOWN, SWT.COLUMN_NEXT, SWT.COLUMN_PREVIOUS direction, int distance)Initiates autoscrolling. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| 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 | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| 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 | |
| pack-priv void | |
| 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 | |
| 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 | |
| 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 | |
| pack-priv void | |
| 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 | |
| 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 | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| private int | |
| public int | |
| public boolean | Returns: the Always Show Scrollbars flag valueReturns the Always Show Scrollbars flag. |
| pack-priv String | |
| pack-priv int | |
| pack-priv int | |
| public Color | getBackground()
Returns the receiver's background color.
|
| public int | |
| public int | Returns: baseline the baselinethe offset offset)Returns the baseline at the given offset, in points. |
| public boolean | Returns: the current coloring mode
Deprecated
use BidiSegmentListener instead.
Gets the BIDI coloring mode.
|
| pack-priv StyledTextEvent | |
| pack-priv int[] | |
| public boolean | Returns: true if widget is in block selection mode, false otherwiseReturns whether the widget is in block selection mode. |
| public Rectangle | |
| pack-priv Rectangle | |
| pack-priv Rectangle | |
| pack-priv String | |
| pack-priv int | Returns: index of the last fully visible line.Returns the index of the last fully visible line. |
| public int | |
| pack-priv Rectangle | |
| pack-priv int | |
| public int | Returns: the caret position relative to the start of the text.Returns the caret position relative to the start of the text. |
| pack-priv int | |
| public int | |
| pack-priv Object | |
| pack-priv int | |
| pack-priv int | |
| 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.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 clicksReturns whether the widget implements double click mouse behavior. |
| public boolean | getDragDetect()
Overrides org. true if the receiver is detecting
drag gestures, and false otherwise.
|
| public boolean | Returns: true if content can be edited, false otherwiseReturns whether the widget content can be edited. |
| pack-priv int | |
| public Color | getForeground()
Returns the foreground color that the receiver will use to draw.
|
| pack-priv int | Returns: horizontal scroll increment.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 scrolledReturns 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.Returns the horizontal scroll offset relative to the start of the line. |
| public int | |
| public boolean | |
| public int | Returns: one of the predefined actions defined in ST.java or SWT.NULL if there is no action associated with the key.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 | |
| public String | Returns: the line text without delimitersindex of the line to return. lineIndex)Returns the line at the given line index without delimiters. |
| public int | Returns: the line alignmentthe 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 textoffset 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.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.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 bulletthe index of the line index)Returns the bullet of the line at the given index. |
| public int | |
| pack-priv int | Returns: number of lines that can be completely displayed in the widget client area.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.Returns the line delimiter used for entering new lines by key down or paste operation. |
| public int | |
| public int | Returns: line height in pointsthe offset offset)Returns the line height at the given offset. |
| public int | Returns: the line indentationthe 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 pointthe y-coordinate point y)Returns the line index for a y, relative to the client area. |
| public boolean | Returns: whether the line is justifiedthe 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 indexthe 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 | |
| pack-priv StyledTextEvent | Returns: line style data for the given line. Styles may start before line start and end after line endoffset 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 linethe index of the line index)Returns the tab stops of the line at the given |
| public int | Returns: the line vertical indentationthe index of the line index)Returns the vertical indentation of the line at the given index. |
| public int | Returns: the wrap indentationthe index of the line index)Returns the wrap indentation of the line at the given |
| public Point | Returns: x, y location of the upper left corner of the character bounding box at the specified offset in the text.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 | |
| 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.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 stateReturns |
| 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.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.the origin of character bounding box relative to
the origin of the widget client area. point)
Deprecated
Use
Returns the offset of the character at the given location relative
to the first character in the document.
getOffsetAtPoint(Point) instead for better performance
|
| 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.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 | |
| pack-priv int | |
| pack-priv int | |
| public int | Returns: the orientation style |
| pack-priv int | Returns: index of the last partially visible line.Returns the index of the last partially visible line. |
| pack-priv int | Returns: index of the first partially visible line.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.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.Returns the location of the given offset. |
| public int[] | Returns: the ranges or an empty array if a LineStyleListener has been set.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.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 | |
| 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).Returns the selection. |
| public Color | Returns: the selection background colorReturns the receiver's selection background color. |
| public int | Returns: the number of selected characters.Gets the number of selected characters. |
| public Color | Returns: the selection foreground colorReturns 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).Returns the selection. |
| public int[] | |
| public String | Returns: selected text, or an empty String if there is no selection.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.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.Returns the styles. |
| public StyleRange[] | Returns: the styles or an empty array if a LineStyleListener has been set.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 returnedStyleRange will have a starting offset >= start
and the last returned StyleRange will have an ending
offset <= start + length - 1the 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 returnedStyleRange will have a starting offset >= start
and the last returned StyleRange will have an ending
offset >= start + length - 1the 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 | |
| public int[] | |
| public String | |
| public String | Returns: widget content starting at start and ending at endoffset 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 endoffset 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 limitReturns the maximum number of characters that the receiver is capable of holding. |
| public String | Returns: widget content starting at start and extending length characters.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 | |
| public int | |
| public int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| public boolean | Returns: true if widget wraps lines, false otherwiseReturns whether the widget wraps lines. |
| public int | |
| pack-priv int | |
| private static int | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| 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 | |
| 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 | |
| pack-priv void | |
| pack-priv void | |
| 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
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 | |
| pack-priv void | |
| private boolean | |
| pack-priv void | |
| public void | |
| pack-priv int | |
| pack-priv void | |
| private void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | |
| 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 | |
| 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.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 orientedReturns 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 linesReturns whether the widget can have only one line. |
| public boolean | Returns: the text selection stateReturns |
| pack-priv boolean | Returns: true if StyledText is in word wrap mode and false otherwise.Returns true if StyledText is in word wrap mode and false otherwise. |
| pack-priv void | modifyContent(Event
the text change event.
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 |
| private void | |
| public void | |
| public Runnable | |
| public Runnable | Returns: aRunnable for printing the receiver's textthe printer to print to printer, StyledTextPrintOptions print options to use during printing options)Returns a runnable that will print the widget's text to the specified printer. |
| public void | redraw()
Overrides org. |
| 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 otherwiseOverrides org. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| 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 | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| 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 otherwiseOverrides org. |
| pack-priv boolean | Returns: true=the widget was scrolled false=the widget was not scrolled, the given offset is not valid.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 | |
| pack-priv boolean | Returns: true=the widget was scrolled false=the widget was not scrolledthe 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 | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | sendKeyEvent(Event
the text change event.
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.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 | |
| pack-priv int | |
| pack-priv int | sendWordBoundaryEvent(int eventType, int movement, int offset, int newOffset, String lineText, int lineOffset)
|
| pack-priv void | |
| public void | |
| 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)
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 | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | |
| public void | setCaret(Caret
the new caret for the receiver caret)Overrides org. |
| pack-priv void | |
| pack-priv void | |
| public void | setCaretOffset(int
caret offset, relative to the first character in the text. offset)Sets the caret offset. |
| pack-priv void | |
| 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. |
| 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)
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. true,
and disables it otherwise.
|
| public void | |
| public boolean | setFocus()
Overrides org. |
| public void | setFont(Font
new font font)Overrides org. |
| public void | setForeground(Color
the new color (or null) color)
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 | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| public void | setOrientation(int
new orientation style orientation)Overrides org. SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.
|
| public void | |
| pack-priv void | |
| 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 | |
| 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 |
| 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 | |
| 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 | |
| public void | |
| public void | |
| public void | setTextDirection(int
the base text direction style textDirection)Overrides org. 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 | |
| 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 | |
| pack-priv void | |
| pack-priv boolean | |
| public void | |
| 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. |