Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses. </p>
The Printing class : printing of a range of text. An instance of <code>Printing</code> is returned in the StyledText#print(Printer) API. The run() method may be invoked from any thread.
The <code>RTFWriter</code> class is used to write widget content as rich text. The implementation complies with the RTF specification version 1.5. <p> toString() is guaranteed to return a valid RTF string only after close() has been called. </p><p> Whole and partial lines and line breaks can be written. Lines will be formatted using the styles queried from the LineStyleListener, if set, or those set directly in the widget. All styles are applied to the RTF stream like they are rendered by the widget. In addition, the widget font name and size is used for the whole text. </p>
The <code>TextWriter</code> class is used to write widget content to a string. Whole and partial lines and line breaks can be written. To write partial lines, specify the start and length of the desired segment during object creation. <p> </b>NOTE:</b> <code>toString()</code> is guaranteed to return a valid string only after close() has been called. </p>
Adds a bidirectional segment listener. <p> A BidiSegmentEvent is sent whenever a line of text is measured or rendered. The user can specify text ranges in the line that should be treated as if they had a different direction than the surrounding text. This may be used when adjacent segments of right-to-left text should not be reordered relative to each other. E.g., Multiple Java string literals in a right-to-left language should generally remain in logical order to each other, that is, the way they are stored. </p>
Adds an extended modify listener. An ExtendedModify event is sent by the widget when the widget text has changed.
Adds a line background listener. A LineGetBackground event is sent by the widget to determine the background color for a line.
Adds a line style listener. A LineGetStyle event is sent by the widget to determine the styles for a line.
Adds a modify listener. A Modify event is sent by the widget when the widget text has changed.
Adds a paint object listener. A paint object event is sent by the widget when an object needs to be drawn.
Adds a selection listener. A Selection event is sent by the widget when the user changes the selection. <p> When <code>widgetSelected</code> is called, the event x and y fields contain the start and end caret indices of the selection. <code>widgetDefaultSelected</code> is not called for StyledTexts. </p>
Adds a verify key listener. A VerifyKey event is sent by the widget when a key is pressed. The widget ignores the key press if the listener sets the doit field of the event to false.
Adds a verify listener. A Verify event is sent by the widget when the widget text is about to change. The listener can set the event text and the doit field to change the text that is set in the widget or to force the widget to ignore the text change.
Adds a word movement listener. A movement event is sent when the boundary of a word is needed. For example, this occurs during word next and word previous actions.
Appends a string to the text at the end of the widget.
Calculates the scroll bars
Calculates the top index based on the current vertical scroll offset. The top index is the index of the topmost fully visible line or the topmost partially visible line if no line is fully visible. The top index starts at 0.
Scrolls down the text to use new space made available by a resize or by deleted lines.
Scrolls text to the right to use new space made available by a resize.
Removes the widget selection.
Copies the selected text to the <code>DND.CLIPBOARD</code> clipboard. <p> The text will be put on the clipboard in plain text format and RTF format. The <code>DND.CLIPBOARD</code> clipboard is used for data that is transferred by keyboard accelerator (such as Ctrl+C/Ctrl+V) or by menu action. </p>
Copies the selected text to the specified clipboard. The text will be put in the clipboard in plain text format and RTF format. <p> The clipboardType is one of the clipboard constants defined in class <code>DND</code>. The <code>DND.CLIPBOARD</code> clipboard is used for data that is transferred by keyboard accelerator (such as Ctrl+C/Ctrl+V) or by menu action. The <code>DND.SELECTION_CLIPBOARD</code> clipboard is used for data that is transferred by selecting text and pasting with the middle mouse button. </p>
Create the bitmaps to use for the caret in bidi mode. This method only needs to be called upon widget creation and when the font changes (the caret bitmap height needs to match font height).
Creates default key bindings.
Moves the selected text to the clipboard. The text will be put in the clipboard in plain text format and RTF format.
A mouse move event has occurred. See if we should start autoscrolling. If the move position is outside of the client area, initiate autoscrolling. Otherwise, we've moved back into the widget so end autoscrolling.
Initiates autoscrolling.
Deletes the previous character. Delete the selected text if any. Move the caret in front of the deleted text.
Replaces the selection with the character or insert the character at the current caret position if no selection exists. <p> If a carriage return was typed replace it with the line break character used by the widget on this platform. </p>
Moves the caret after the last character of the widget content.
Moves the caret in front of the first character of the widget content.
Moves the caret to the end of the selection if a selection exists. Otherwise, if no selection exists move the cursor according to the cursor selection rules.
Moves the caret to the start of the selection if a selection exists. Otherwise, if no selection exists move the cursor according to the cursor selection rules.
Deletes the next character. Delete the selected text if any.
Deletes the next word.
Deletes the previous word.
Moves the caret one line down and to the same character offset relative to the beginning of the line. Move the caret to the end of the new line if the new line is shorter than the character offset.
Moves the caret to the end of the line.
Moves the caret to the beginning of the line.
Moves the caret one line up and to the same character offset relative to the beginning of the line. Move the caret to the end of the new line if the new line is shorter than the character offset.
Moves the caret to the specified location.
Updates the selection based on the caret position
Returns the offset of the word at the specified offset. If the current selection extends from high index to low index (i.e., right to left, or caret is at left border of selection on non-bidi platforms) the start offset of the word preceding the selection is returned. If the current selection extends from low index to high index the end offset of the word following the selection is returned.
Scrolls one page down so that the last line (truncated or whole) of the current page becomes the fully visible top line. <p> The caret is scrolled the same number of lines so that its location relative to the top line remains the same. The exception is the end of the text where a full page scroll is not possible. In this case the caret is moved after the last character. </p>
Moves the cursor to the end of the last fully visible line.
Moves the cursor to the beginning of the first fully visible line.
Scrolls one page up so that the first line (truncated or whole) of the current page becomes the fully visible last line. The caret is scrolled the same number of lines so that its location relative to the top line remains the same. The exception is the beginning of the text where a full page scroll is not possible. In this case the caret is moved in front of the first character.
Updates the selection to extend to the current caret position.
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.
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.
Moves the caret one line down and to the same character offset relative to the beginning of the line. Moves the caret to the end of the new line if the new line is shorter than the character offset. Moves the caret to the end of the text if the caret already is on the last line. Adjusts the selection according to the caret change. This can either add to or subtract from the old selection, depending on the previous selection direction.
Moves the caret one line up and to the same character offset relative to the beginning of the line. Moves the caret to the end of the new line if the new line is shorter than the character offset. Moves the caret to the beginning of the document if it is already on the first line. Adjusts the selection according to the caret change. This can either add to or subtract from the old selection, depending on the previous selection direction.
Scrolls one page down so that the last line (truncated or whole) of the current page becomes the fully visible top line. <p> The caret is scrolled the same number of lines so that its location relative to the top line remains the same. The exception is the end of the text where a full page scroll is not possible. In this case the caret is moved after the last character. <p></p> Adjusts the selection according to the caret change. This can either add to or subtract from the old selection, depending on the previous selection direction. </p>
Scrolls one page up so that the first line (truncated or whole) of the current page becomes the fully visible last line. <p> The caret is scrolled the same number of lines so that its location relative to the top line remains the same. The exception is the beginning of the text where a full page scroll is not possible. In this case the caret is moved in front of the first character. </p><p> Adjusts the selection according to the caret change. This can either add to or subtract from the old selection, depending on the previous selection direction. </p>
Moves the caret to the end of the next word .
Moves the caret to the start of the previous word.
Moves the caret one character to the right. Do not go to the next line. When in a bidi locale and at a R2L character the caret is moved to the end of the R2L segment (visually left) and then one character to the right (visually right because it's now in a L2R segment).
Moves the caret one character to the left. Do not go to the previous line. When in a bidi locale and at a R2L character the caret is moved to the beginning of the R2L segment (visually right) and then one character to the left (visually left because it's now in a L2R segment).
Moves the caret to the end of the next word. If a selection exists, move the caret to the end of the selection and remove the selection.
Moves the caret to the start of the previous word. If a selection exists, move the caret to the start of the selection and remove the selection.
Ends the autoscroll process.
Returns the alignment of the widget.
Returns the baseline, in pixels.
Returns the baseline at the given offset, in pixels.
Gets the BIDI coloring mode. When true the BIDI text display algorithm is applied to segments of text that are the same color.
Returns the text segments that should be treated as if they had a different direction than the surrounding text.
@see #getBidiSegments Supports deprecated setBidiColoring API. Remove when API is removed.
Returns the index of the last fully visible line.
Returns the caret position relative to the start of the text.
Returns the caret width.
Gets the number of characters.
Returns the content implementation that is used for text storage.
Returns whether the widget implements double click mouse behavior.
Returns whether the widget content can be edited.
Returns the horizontal scroll increment.
Returns the horizontal scroll offset relative to the start of the line.
Returns the horizontal scroll offset relative to the start of the line.
Returns the line indentation of the widget.
Returns whether the widget justifies lines.
Returns the action assigned to the key. Returns SWT.NULL if there is no action associated with the key.
Returns the line at the given line index without delimiters. Index 0 is the first line of the content. When there are not any lines, getLine(0) is a valid call that answers an empty string. <p>
Returns the alignment of the line at the given index.
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.
Returns the background color of the line at the given index. Returns null if a LineBackgroundListener has been set or if no background color has been specified for the line. Should not be called if a LineBackgroundListener has been set since the listener maintains the line background colors.
Returns the line background data for the given line or null if there is none.
Returns the bullet of the line at the given index.
Gets the number of text lines.
Returns the number of lines that can be completely displayed in the widget client area.
Returns the line delimiter used for entering new lines by key down or paste operation.
Returns the line height. <p> Note: this API should not be used if a StyleRange attribute causes lines to have different heights (i.e. different fonts, rise, etc). </p>
Returns the line height at the given offset.
Returns the indentation of the line at the given index.
Returns the line index for a y, relative to the client area. The line index returned is always in the range 0..lineCount - 1.
Returns whether the line at the given index is justified.
Returns the top pixel, relative to the client area, of a given line. Clamps out of ranges index.
Returns the line spacing of the widget.
Returns the line style data for the given line or null if there is none. <p> If there is a LineStyleListener but it does not set any styles, the StyledTextEvent.styles field will be initialized to an empty array. </p>
Returns the x, y location of the upper left corner of the character bounding box at the specified offset in the text. The point is relative to the upper left corner of the widget client area.
Returns a string that uses only the line delimiter specified by the StyledTextContent implementation. <p> Returns only the first line if the widget has the SWT.SINGLE style. </p>
Returns the character offset of the first character of the given line.
Returns the offset of the character at the given location relative to the first character in the document. <p> The return value reflects the character offset that the caret will be placed at if a mouse click occurred at the specified location. If the x coordinate of the location is beyond the center of a character the returned offset will be behind the character. </p>
Returns the offset at the specified x location in the specified line.
Returns the orientation of the receiver.
Returns the index of the last partially visible line.
Returns the index of the first partially visible line.
Returns the content in the specified range using the platform line delimiter to separate lines.
Returns the location of the given offset. <p> <b>NOTE:</b> Does not return correct values for true italic fonts (vs. slanted fonts). </p>
Returns all the ranges of text that have an associated StyleRange. Returns an empty array if a LineStyleListener has been set. Should not be called if a LineStyleListener has been set since the listener maintains the styles. <p> The ranges array contains start and length pairs. Each pair refers to the corresponding style in the styles array. For example, the pair that starts at rangesn with length ranges[n+1] uses the style at styles[n/2] returned by <code>getStyleRanges(int, int, bool)</code>. </p>
Returns the ranges of text that have an associated StyleRange. Returns an empty array if a LineStyleListener has been set. Should not be called if a LineStyleListener has been set since the listener maintains the styles. <p> The ranges array contains start and length pairs. Each pair refers to the corresponding style in the styles array. For example, the pair that starts at rangesn with length ranges[n+1] uses the style at styles[n/2] returned by <code>getStyleRanges(int, int, bool)</code>. </p>
Returns the selection. <p> Text selections are specified in terms of caret positions. In a text widget that contains N characters, there are N+1 caret positions, ranging from 0..N </p>
Returns the receiver's selection background color.
Gets the number of selected characters.
Returns the receiver's selection foreground color.
Returns the selection.
Returns the selected text.
Returns the style range at the given offset. <p> Returns null if a LineStyleListener has been set or if a style is not set for the offset. Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p>
Returns the styles. <p> Returns an empty array if a LineStyleListener has been set. Should not be called if a LineStyleListener has been set since the listener maintains the styles. <p></p> Note: Because a StyleRange includes the start and length, the same instance cannot occur multiple times in the array of styles. If the same style attributes, such as font and color, occur in multiple StyleRanges, <code>getStyleRanges(bool)</code> can be used to get the styles without the ranges. </p>
Returns the styles. <p> Returns an empty array if a LineStyleListener has been set. Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p><p> Note: When <code>includeRanges</code> is true, the start and length fields of each StyleRange will be valid, however the StyleRange objects may need to be cloned. When <code>includeRanges</code> is false, <code>getRanges(int, int)</code> can be used to get the associated ranges. </p>
Returns the styles for the given text range. <p> Returns an empty array if a LineStyleListener has been set. Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p><p> Note: Because the StyleRange includes the start and length, the same instance cannot occur multiple times in the array of styles. If the same style attributes, such as font and color, occur in multiple StyleRanges, <code>getStyleRanges(int, int, bool)</code> can be used to get the styles without the ranges. </p> @param start the start offset of the style ranges to return @param length the number of style ranges to return
Returns the styles for the given text range. <p> Returns an empty array if a LineStyleListener has been set. Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p><p> Note: When <code>includeRanges</code> is true, the start and length fields of each StyleRange will be valid, however the StyleRange objects may need to be cloned. When <code>includeRanges</code> is false, <code>getRanges(int, int)</code> can be used to get the associated ranges. </p>
Returns the tab width measured in characters.
Returns a copy of the widget content.
Returns the widget content between the two offsets.
Returns the smallest bounding rectangle that includes the characters between two offsets.
Returns the maximum number of characters that the receiver is capable of holding.
Returns the widget content starting at start for length characters.
Gets the top index. <p> The top index is the index of the fully visible line that is currently at the top of the widget or the topmost partially visible line if no line is fully visible. The top index changes when the widget is scrolled. Indexing is zero based. </p>
Gets the top pixel. <p> The top pixel is the pixel position of the line that is currently at the top of the widget. The text widget can be scrolled by pixels by dragging the scroll thumb so that a partial line may be displayed at the top the widget. The top pixel changes when the widget is scrolled. The top pixel does not include the widget trimming. </p>
Returns the vertical scroll increment.
Returns whether the widget wraps lines.
Frees resources.
Scrolls the widget horizontally.
If an action has been registered for the key stroke execute the action. Otherwise, if a character has been entered treat it as new content.
If a VerifyKey listener exists, verify that the key that was entered should be processed.
Update the Selection Clipboard.
Updates the caret location and selection if mouse button 1 has been pressed.
Updates the caret location and selection if mouse button 1 is pressed during the mouse move.
Autoscrolling ends when the mouse button is released.
Renders the invalidated area specified in the paint event.
Recalculates the scroll bars. Rewraps all lines when in word wrap mode.
Updates the caret position and selection and the scroll bars to reflect the content change.
Updates the screen to reflect a pending content change.
Called when the widget content is set programmatically, overwriting the old content. Resets the caret position, selection and scroll offsets. Recalculates the content width and scroll bars. Redraws the widget.
Called when a traversal key is pressed. Allow tab next traversal to occur when the widget is in single line mode or in multi line and non-editable mode . When in editable multi line mode we want to prevent the tab traversal and receive the tab key event instead.
Scrolls the widget vertically.
Add accessibility support for the widget.
Inserts a string. The old selection is replaced with the new text.
Creates content change listeners and set the default content model.
Adds event listeners
Executes the action.
Temporary until SWT provides this
Returns whether the given offset is inside a multi byte line delimiter.
Returns whether the widget is mirrored (right oriented/right to left writing order).
Returns whether the widget can have only one line.
Sends the specified verify event, replace/insert text as defined by the event and send a modify event.
Replaces the selection with the text on the <code>DND.CLIPBOARD</code> clipboard or, if there is no selection, inserts the text at the current caret offset. If the widget has the SWT.SINGLE style and the clipboard text contains more than one line, only the first line without line delimiters is inserted in the widget.
Prints the widget's text to the default printer.
Returns a runnable that will print the widget's text to the specified printer. <p> The runnable may be run in a non-UI thread. </p>
Returns a runnable that will print the widget's text to the specified printer. <p> The runnable may be run in a non-UI thread. </p>
Causes the entire bounds of the receiver to be marked as needing to be redrawn. The next time a paint request is processed, the control will be completely painted. <p> Recalculates the content width for all lines in the bounds. When a <code>LineStyleListener</code> is used a redraw call is the only notification to the widget that styles have changed and that the content width may have changed. </p>
Causes the rectangular area of the receiver specified by the arguments to be marked as needing to be redrawn. The next time a paint request is processed, that area of the receiver will be painted. If the <code>all</code> flag is <code>true</code>, any children of the receiver which intersect with the specified area will also paint their intersecting areas. If the <code>all</code> flag is <code>false</code>, the children will not be painted. <p> Marks the content width of all lines in the specified rectangle as unknown. Recalculates the content width of all visible lines. When a <code>LineStyleListener</code> is used a redraw call is the only notification to the widget that styles have changed and that the content width may have changed. </p>
Redraws the specified text range.
Removes the specified bidirectional segment listener.
Removes the specified extended modify listener.
Removes the specified line background listener.
Removes the specified line style listener.
Removes the specified modify listener.
Removes the specified listener.
Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection.
Removes the specified key verify listener.
Removes the specified verify listener.
Removes the specified word movement listener.
Replaces the styles in the given range with new styles. This method effectively deletes the styles in the given range and then adds the the new styles. <p> Note: Because a StyleRange includes the start and length, the same instance cannot occur multiple times in the array of styles. If the same style attributes, such as font and color, occur in multiple StyleRanges, <code>setStyleRanges(int, int, int[], StyleRange[])</code> can be used to share styles and reduce memory usage. </p><p> Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p>
Replaces the given text range with new text. If the widget has the SWT.SINGLE style and "text" contains more than one line, only the first line is rendered but the text is stored unchanged. A subsequent call to getText will return the same text that was set. Note that only a single line of text should be set when the SWT.SINGLE style is used. <p> <b>NOTE:</b> During the replace operation the current selection is changed as follows: <ul> <li>selection before replaced text: selection unchanged <li>selection after replaced text: adjust the selection so that same text remains selected <li>selection intersects replaced text: selection is cleared and caret is placed after inserted text </ul> </p>
Resets the caret position, selection and scroll offsets. Recalculate the content width and scroll bars. Redraw the widget.
Resets the selection.
Scrolls the widget horizontally.
Scrolls the widget vertically.
Selects all the text.
Replaces/inserts text as defined by the event.
Returns a StyledTextEvent that can be used to request data such as styles and background color for a line. <p> The specified line may be a visual (wrapped) line if in word wrap mode. The returned object will always be for a logical (unwrapped) line. </p>
Sends the specified selection event.
Sets the alignment of the widget. The argument should be one of <code>SWT.LEFT</code>, <code>SWT.CENTER</code> or <code>SWT.RIGHT</code>. The alignment applies for all lines. </p><p> Note that if <code>SWT.MULTI</code> is set, then <code>SWT.WRAP</code> must also be set in order to stabilize the right edge before setting alignment. </p>
@see Control#setBackground(Color)
Sets the BIDI coloring mode. When true the BIDI text display algorithm is applied to segments of text that are the same color.
Sets the receiver's caret. Set the caret's height and location.
Moves the Caret to the current caret offset.
Sets the caret offset.
Copies the specified text range to the clipboard. The text will be placed in the clipboard in plain text format and RTF format.
Sets the content implementation to use for text storage.
Sets the receiver's cursor to the cursor specified by the argument. Overridden to handle the null case since the StyledText widget uses an ibeam as its default cursor.
Sets whether the widget : double click mouse behavior. </p>
Sets whether the widget content can be edited. </p>
Sets a new font to render text with. <p> <b>NOTE:</b> Italic fonts are not supported unless they have no overhang and the same baseline as regular fonts. </p>
Sets the horizontal scroll offset relative to the start of the line. Do nothing if there is no text set. <p> <b>NOTE:</b> The horizontal index is reset to 0 when new text is set in the widget. </p>
Sets the horizontal pixel offset relative to the start of the line. Do nothing if there is no text set. <p> <b>NOTE:</b> The horizontal pixel offset is reset to 0 when new text is set in the widget. </p>
Sets the line indentation of the widget. <p> It is the amount of blank space, in pixels, at the beginning of each line. When a line wraps in several lines only the first one is indented. </p>
Sets whether the widget should justify lines.
Maps a key to an action. <p> One action can be associated with N keys. However, each key can only have one action (key:action is N:1 relation). </p>
Sets the alignment of the specified lines. The argument should be one of <code>SWT.LEFT</code>, <code>SWT.CENTER</code> or <code>SWT.RIGHT</code>. <p><p> Note that if <code>SWT.MULTI</code> is set, then <code>SWT.WRAP</code> must also be set in order to stabilize the right edge before setting alignment. </p> Should not be called if a LineStyleListener has been set since the listener maintains the line attributes. </p><p> All line attributes are maintained relative to the line text, not the line index that is specified in this method call. During text changes, when entire lines are inserted or removed, the line attributes that are associated with the lines after the change will "move" with their respective text. An entire line is defined as extending from the first character on a line to the last and including the line delimiter. </p><p> When two lines are joined by deleting a line delimiter, the top line attributes take precedence and the attributes of the bottom line are deleted. For all other text changes line attributes will remain unchanged.
Sets the background color of the specified lines. <p> The background color is drawn for the width of the widget. All line background colors are discarded when setText is called. The text background color if defined in a StyleRange overlays the line background color. </p><p> Should not be called if a LineBackgroundListener has been set since the listener maintains the line backgrounds. </p><p> All line attributes are maintained relative to the line text, not the line index that is specified in this method call. During text changes, when entire lines are inserted or removed, the line attributes that are associated with the lines after the change will "move" with their respective text. An entire line is defined as extending from the first character on a line to the last and including the line delimiter. </p><p> When two lines are joined by deleting a line delimiter, the top line attributes take precedence and the attributes of the bottom line are deleted. For all other text changes line attributes will remain unchanged. </p>
Sets the bullet of the specified lines. <p> Should not be called if a LineStyleListener has been set since the listener maintains the line attributes. </p><p> All line attributes are maintained relative to the line text, not the line index that is specified in this method call. During text changes, when entire lines are inserted or removed, the line attributes that are associated with the lines after the change will "move" with their respective text. An entire line is defined as extending from the first character on a line to the last and including the line delimiter. </p><p> When two lines are joined by deleting a line delimiter, the top line attributes take precedence and the attributes of the bottom line are deleted. For all other text changes line attributes will remain unchanged. </p>
Sets the indent of the specified lines. <p> Should not be called if a LineStyleListener has been set since the listener maintains the line attributes. </p><p> All line attributes are maintained relative to the line text, not the line index that is specified in this method call. During text changes, when entire lines are inserted or removed, the line attributes that are associated with the lines after the change will "move" with their respective text. An entire line is defined as extending from the first character on a line to the last and including the line delimiter. </p><p> When two lines are joined by deleting a line delimiter, the top line attributes take precedence and the attributes of the bottom line are deleted. For all other text changes line attributes will remain unchanged. </p>
Sets the justify of the specified lines. <p> Should not be called if a LineStyleListener has been set since the listener maintains the line attributes. </p><p> All line attributes are maintained relative to the line text, not the line index that is specified in this method call. During text changes, when entire lines are inserted or removed, the line attributes that are associated with the lines after the change will "move" with their respective text. An entire line is defined as extending from the first character on a line to the last and including the line delimiter. </p><p> When two lines are joined by deleting a line delimiter, the top line attributes take precedence and the attributes of the bottom line are deleted. For all other text changes line attributes will remain unchanged. </p>
Sets the line spacing of the widget. The line spacing applies for all lines.
Flips selection anchor based on word selection direction.
Sets the orientation of the receiver, which must be one of the constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
Adjusts the maximum and the page size of the scroll bars to reflect content width/length changes.
Sets the selection to the given position and scrolls it into view. Equivalent to setSelection(start,start).
Sets the selection and scrolls it into view. <p> Indexing is zero based. Text selections are specified in terms of caret positions. In a text widget that contains N characters, there are N+1 caret positions, ranging from 0..N </p>
Sets the selection and scrolls it into view. <p> Indexing is zero based. Text selections are specified in terms of caret positions. In a text widget that contains N characters, there are N+1 caret positions, ranging from 0..N </p>
Sets the selection. <p> The new selection may not be visible. Call showSelection to scroll the selection into view. </p>
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.
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. <p> Note that this is a <em>HINT</em>. Some platforms do not allow the application to change the selection foreground color. </p> @param color the new color (or null)
Sets the selection. <p> The new selection may not be visible. Call showSelection to scroll the selection into view. A negative length places the caret at the visual start of the selection. </p>
Adds the specified style. <p> The new style overwrites existing styles for the specified range. Existing style ranges are adjusted if they partially overlap with the new style. To clear an individual style, call setStyleRange with a StyleRange that has null attributes. </p><p> Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p>
Clears the styles in the range specified by <code>start</code> and <code>length</code> and adds the new styles. <p> The ranges array contains start and length pairs. Each pair refers to the corresponding style in the styles array. For example, the pair that starts at rangesn with length ranges[n+1] uses the style at styles[n/2]. The range fields within each StyleRange are ignored. If ranges or styles is null, the specified range is cleared. </p><p> Note: It is expected that the same instance of a StyleRange will occur multiple times within the styles array, reducing memory usage. </p><p> Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p>
Sets styles to be used for rendering the widget content. <p> All styles in the widget will be replaced with the given set of ranges and styles. The ranges array contains start and length pairs. Each pair refers to the corresponding style in the styles array. For example, the pair that starts at rangesn with length ranges[n+1] uses the style at styles[n/2]. The range fields within each StyleRange are ignored. If either argument is null, the styles are cleared. </p><p> Note: It is expected that the same instance of a StyleRange will occur multiple times within the styles array, reducing memory usage. </p><p> Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p>
Sets styles to be used for rendering the widget content. All styles in the widget will be replaced with the given set of styles. <p> Note: Because a StyleRange includes the start and length, the same instance cannot occur multiple times in the array of styles. If the same style attributes, such as font and color, occur in multiple StyleRanges, <code>setStyleRanges(int[], StyleRange[])</code> can be used to share styles and reduce memory usage. </p><p> Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p>
Sets the tab width.
Sets the widget content. If the widget has the SWT.SINGLE style and "text" contains more than one line, only the first line is rendered but the text is stored unchanged. A subsequent call to getText will return the same text that was set. <p> <b>Note:</b> Only a single line of text should be set when the SWT.SINGLE style is used. </p>
Sets the text limit to the specified number of characters. <p> The text limit specifies the amount of text that the user can type into the widget. </p>
Sets the top index. Do nothing if there is no text set. <p> The top index is the index of the line that is currently at the top of the widget. The top index changes when the widget is scrolled. Indexing starts from zero. Note: The top index is reset to 0 when new text is set in the widget. </p>
Sets the top pixel offset. Do nothing if there is no text set. <p> The top pixel offset is the vertical pixel offset of the widget. The widget is scrolled so that the given pixel position is at the top. The top index is adjusted to the corresponding top line. Note: The top pixel is reset to 0 when new text is set in the widget. </p>
Sets whether the widget wraps lines. <p> This overrides the creation style bit SWT.WRAP. </p>
Sets the caret location and scrolls the caret offset into view.
Scrolls the selection into view. <p> The end of the selection will be scrolled into view. Note that if a right-to-left selection exists, the end of the selection is the visual beginning of the selection (i.e., where the caret is located). </p>
Updates the selection and caret position depending on the text change. <p> If the selection intersects with the replaced text, the selection is reset and the caret moved to the end of the new text. If the selection is behind the replaced text it is moved so that the same text remains selected. If the selection is before the replaced text it is left unchanged. </p>
Hides the scroll bars if widget is created in single line mode.
Fills the interior of the rectangle specified by the arguments, with the receiver's background.
Returns the caret. <p> The caret for the control is automatically hidden and shown when the control is painted or resized, when focus is gained or lost and when an the control is scrolled. To avoid drawing on top of the caret, the programmer must hide and show the caret when drawing in the window any other time. </p>
Returns the IME.
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. Children that intersect the rectangle are optionally moved during the operation. In addition, outstanding paint events are flushed before the source area is copied to ensure that the contents of the canvas are drawn correctly.
Sets the receiver's caret. <p> The caret for the control is automatically hidden and shown when the control is painted or resized, when focus is gained or lost and when an the control is scrolled. To avoid drawing on top of the caret, the programmer must hide and show the caret when drawing in the window any other time. </p> @param caret the new caret for the receiver, may be null
Sets the receiver's IME.
A StyledText is an editable user interface object that displays lines of text. The following style attributes can be defined for the text: <ul> <li>foreground color <li>background color <li>font style (bold, italic, bold-italic, regular) <li>underline <li>strikeout </ul> <p> In addition to text style attributes, the background color of a line may be specified. </p><p> 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: <ul> <li>getStyleRangeAtOffset(int) <li>getStyleRanges() <li>replaceStyleRanges(int,int,StyleRange[]) <li>setStyleRange(StyleRange) <li>setStyleRanges(StyleRange[]) </ul> </p><p> 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: <ul> <li>getLineBackground(int) <li>setLineBackground(int,int,Color) </ul> </p><p> 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. </p><p> <dl> <dt><b>Styles:</b><dd>FULL_SELECTION, MULTI, READ_ONLY, SINGLE, WRAP <dt><b>Events:</b><dd>ExtendedModify, LineGetBackground, LineGetSegments, LineGetStyle, Modify, Selection, Verify, VerifyKey </dl> </p><p> IMPORTANT: This class is <em>not</em> intended to be subclassed. </p>
@see <a href="http://www.eclipse.org/swt/snippets/#styledtext">StyledText snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Examples: CustomControlExample, TextEditor</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>