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>
Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by sending it one of the messages defined in the <code>ModifyListener</code> interface.
Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in the <code>SelectionListener</code> interface. <p> <code>widgetSelected</code> is not called for texts. <code>widgetDefaultSelected</code> is typically called when ENTER is pressed in a single-line text, or when ENTER is pressed in a search text. If the receiver has the <code>SWT.SEARCH | SWT.CANCEL</code> style and the user cancels the search, the event object detail field contains the value <code>SWT.CANCEL</code>. </p>
Adds the listener to the collection of listeners who will be notified when the receiver's text is verified, by sending it one of the messages defined in the <code>VerifyListener</code> interface.
Appends a string. <p> The new text is appended to the text at the end of the widget. </p>
Clears the selection.
Copies the selected text. <p> The current selection is copied to the clipboard. </p>
Cuts the selected text. <p> The current selection is first copied to the clipboard and then deleted from the widget. </p>
Returns the line number of the caret. <p> The line number of the caret is returned. </p>
Returns a point describing the receiver's location relative to its parent (or its display if its parent is null). <p> The location of the caret is returned. </p>
Returns the character position of the caret. <p> Indexing is zero based. </p>
Returns the number of characters.
Returns the double click enabled flag. <p> The double click flag enables or disables the default action of the text widget when the user double clicks. </p>
Returns the echo character. <p> The echo character is the character that is displayed when the user enters text or the text is changed by the programmer. </p>
Returns the editable state.
Returns the number of lines.
Returns the line delimiter.
Returns the height of a line.
Returns the widget message. When the widget is created with the style <code>SWT.SEARCH</code>, the message text is displayed as a hint for the user, indicating the purpose of the field. <p> Note: This operation is a <em>HINT</em> and is not supported on platforms that do not have this concept. </p>
Returns the orientation of the receiver, which will be one of the constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
Returns a <code>Point</code> whose x coordinate is the character position representing the start of the selected text, and whose y coordinate is the character position representing the end of the selection. An "empty" selection is indicated by the x and y coordinates having the same value. <p> Indexing is zero based. The range of a selection is from 0..N where N is the number of characters in the widget. </p>
Returns the number of selected characters.
Gets the selected text, or an empty string if there is no current selection.
Returns the number of tabs. <p> Tab stop spacing is specified in terms of the space (' ') character. The width of a single tab stop is the pixel width of the spaces. </p>
Returns the widget text. <p> The text for a text widget is the characters in the widget, or an empty string if this has never been set. </p>
Returns a range of text. Returns an empty string if the start of the range is greater than the end. <p> Indexing is zero based. The range of a selection is from 0..N-1 where N is the number of characters in the widget. </p>
Returns the maximum number of characters that the receiver is capable of holding. <p> If this has not been changed by <code>setTextLimit()</code>, it will be the constant <code>Text.LIMIT</code>. </p>
Returns the zero-relative index of the line which is currently at the top of the receiver. <p> This index can change when lines are scrolled or new lines are added or removed. </p>
Returns the top pixel. <p> The top pixel is the pixel position of the line that is currently at the top of the widget. On some platforms, a text widget can be scrolled by pixels instead of lines so that a partial line is displayed at the top of the widget. </p><p> The top pixel changes when the widget is scrolled. The top pixel does not include the widget trimming. </p>
Inserts a string. <p> The old selection is replaced with the new text. </p>
Pastes text from clipboard. <p> The selected text is deleted from the widget and new text inserted from the clipboard. </p>
Removes the listener from the collection of listeners who will be notified when the receiver's text is modified.
Removes the listener from the collection of listeners who will be notified when the control is selected by the user.
Removes the listener from the collection of listeners who will be notified when the control is verified.
Selects all the text in the receiver.
Sets the double click enabled flag. <p> The double click flag enables or disables the default action of the text widget when the user double clicks. </p><p> Note: This operation is a hint and is not supported on platforms that do not have this concept. </p>
Sets the echo character. <p> The echo character is the character that is displayed when the user enters text or the text is changed by the programmer. Setting the echo character to '\0' clears the echo character and redraws the original text. If for any reason the echo character is invalid, or if the platform does not allow modification of the echo character, the default echo character for the platform is used. </p>
Sets the editable state.
Sets the widget message. When the widget is created with the style <code>SWT.SEARCH</code>, the message text is displayed as a hint for the user, indicating the purpose of the field. <p> Note: This operation is a <em>HINT</em> and is not supported on platforms that do not have this concept. </p>
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>. <p> Note: This operation is a hint and is not supported on platforms that do not have this concept. </p>
Sets the selection. <p> Indexing is zero based. The range of a selection is from 0..N where N is the number of characters in the widget. </p><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. This differs from other functions that address character position such as getText () that use the regular array indexing rules. </p>
Sets the selection to the range specified by the given start and end indices. <p> Indexing is zero based. The range of a selection is from 0..N where N is the number of characters in the widget. </p><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. This differs from other functions that address character position such as getText () that use the usual array indexing rules. </p>
Sets the selection to the range specified by the given point, where the x coordinate represents the start index and the y coordinate represents the end index. <p> Indexing is zero based. The range of a selection is from 0..N where N is the number of characters in the widget. </p><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. This differs from other functions that address character position such as getText () that use the usual array indexing rules. </p>
Sets the number of tabs. <p> Tab stop spacing is specified in terms of the space (' ') character. The width of a single tab stop is the pixel width of the spaces. </p>
Sets the contents of the receiver to the given string. If the receiver has style SINGLE and the argument contains multiple lines of text, the result of this operation is undefined and may vary from platform to platform.
Sets the maximum number of characters that the receiver is capable of holding to be the argument. <p> Instead of trying to set the text limit to zero, consider creating a read-only text widget. </p><p> To reset this value to the default, use <code>setTextLimit(Text.LIMIT)</code>. Specifying a limit value larger than <code>Text.LIMIT</code> sets the receiver's limit to <code>Text.LIMIT</code>. </p>
Sets the zero-relative index of the line which is currently at the top of the receiver. This index can change when lines are scrolled or new lines are added and removed.
Shows the selection. <p> If the selection is already showing in the receiver, this method simply returns. Otherwise, lines are scrolled until the selection is visible. </p>
The delimiter used by multi-line text widgets. When text is queried and from the widget, it will be delimited using this delimiter.
The maximum number of characters that can be entered into a text widget. <p> Note that this value is platform dependent, based upon the native widget implementation. </p>
Given a desired <em>client area</em> for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area. <p> In other words, it returns a rectangle such that, if the receiver's bounds were set to that rectangle, the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent). </p>
Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").
Returns the receiver's horizontal scroll bar if it has one, and null if it does not.
Returns the receiver's vertical scroll bar if it has one, and null if it does not.
Instances of this class are selectable user interface objects that allow the user to enter and modify text. Text controls can be either single or multi-line. When a text control is created with a border, the operating system includes a platform specific inset around the contents of the control. When created without a border, an effort is made to remove the inset such that the preferred size of the control is the same size as the contents. <p> <dl> <dt><b>Styles:</b></dt> <dd>CANCEL, CENTER, LEFT, MULTI, PASSWORD, SEARCH, SINGLE, RIGHT, READ_ONLY, WRAP</dd> <dt><b>Events:</b></dt> <dd>DefaultSelection, Modify, Verify</dd> </dl> <p> Note: Only one of the styles MULTI and SINGLE may be specified, and only one of the styles LEFT, CENTER, and RIGHT may be specified. </p><p> IMPORTANT: This class is <em>not</em> intended to be subclassed. </p>
@see <a href="http://www.eclipse.org/swt/snippets/#text">Text snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>