Example usage for Java org.eclipse.swt.custom StyledText fields, constructors, methods, implement or subclass
The text is from its open source code.
StyledText(Composite parent, int style) Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
void | addBidiSegmentListener(BidiSegmentListener listener) Adds a bidirectional segment listener. |
void | addExtendedModifyListener(ExtendedModifyListener extendedModifyListener) Adds an extended modify listener. |
void | addKeyListener(KeyListener listener) Adds the listener to the collection of listeners who will be notified when keys are pressed and released on the system keyboard, by sending it one of the messages defined in the KeyListener interface. |
void | addLineBackgroundListener(LineBackgroundListener listener) Adds a line background listener. |
void | addLineStyleListener(LineStyleListener listener) Adds a line style listener. |
void | addListener(int eventType, Listener listener) Adds the listener to the collection of listeners who will be notified when an event of the given type occurs. |
void | addModifyListener(ModifyListener modifyListener) Adds a modify listener. |
void | addPaintObjectListener(PaintObjectListener listener) Adds a paint object listener. |
void | addVerifyKeyListener(VerifyKeyListener listener) Adds a verify key listener. |
void | addVerifyListener(VerifyListener verifyListener) Adds a verify listener. |
void | append(String string) Appends a string to the text at the end of the widget. |
Point | computeSize(int wHint, int hHint) Returns the preferred size of the receiver. |
Rectangle | computeTrim(int x, int y, int width, int height) Given a desired client area for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area. |
void | copy() Copies the selected text to the DND.CLIPBOARD clipboard. |
void | cut() Moves the selected text to the clipboard. |
Accessible | getAccessible() Returns the accessible object for the receiver. |
int | getCaretOffset() Returns the caret position relative to the start of the text. |
int | getCharCount() Gets the number of characters. |
Rectangle | getClientArea() Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings"). |
Object | getData(String key) Returns the application defined property of the receiver with the specified name, or null if it has not been set. |
Font | getFont() Returns the font that the receiver will use to paint textual information. |
int | getKeyBinding(int key) Returns the action assigned to the key. |
String | getLine(int lineIndex) Returns the line at the given line index without delimiters. |
int | getLineAtOffset(int 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. |
int | getLineCount() Gets the number of text lines. |
int | getLineHeight() Returns the line height. |
Point | getLocationAtOffset(int offset) Returns the x, y location of the upper left corner of the character bounding box at the specified offset in the text. |
Point | getSelection() Returns the selection. |
String | getSelectionText() Returns the selected text. |
Point | getSize() Returns a point describing the receiver's size. |
StyleRange | getStyleRangeAtOffset(int offset) Returns the style range at the given offset. |
String | getText() Returns a copy of the widget content. |
String | getText(int start, int end) Returns the widget content between the two offsets. |
boolean | getWordWrap() Returns whether the widget wraps lines. |
void | insert(String string) Inserts a string. |
boolean | isDisposed() Returns true if the widget has been disposed, and false otherwise. |
void | paste() Replaces the selection with the text on the DND.CLIPBOARD clipboard or, if there is no selection, inserts the text at the current caret offset. |
void | print() Prints the widget's text to the default printer. |
Runnable | print(Printer printer, StyledTextPrintOptions options) Returns a runnable that will print the widget's text to the specified printer. |
void | redraw() Causes the entire bounds of the receiver to be marked as needing to be redrawn. |
void | replaceStyleRanges(int start, int length, StyleRange[] ranges) Replaces the styles in the given range with new styles. |
void | replaceTextRange(int start, int length, String text) Replaces the given text range with new text. |
void | selectAll() Selects all the text. |
void | setBackgroundImage(Image image) Sets the receiver's background image to the image specified by the argument, or to the default system color for the control if the argument is null. |
void | setBounds(int x, int y, int width, int height) Sets the receiver's size and location to the rectangular area specified by the arguments. |
void | setData(String key, Object value) |
void | setEditable(boolean editable) Sets whether the widget content can be edited. |
void | setFont(Font font) Sets a new font to render text with. |
void | setForeground(Color color) |
void | setKeyBinding(int key, int action) Maps a key to an action. |
void | setLayoutData(Object layoutData) Sets the layout data associated with the receiver to the argument. |
void | setLineAlignment(int startLine, int lineCount, int alignment) Sets the alignment of the specified lines. |
void | setLineBackground(int startLine, int lineCount, Color background) Sets the background color of the specified lines. |
void | setLineBullet(int startLine, int lineCount, Bullet bullet) Sets the bullet of the specified lines. |
void | setLineIndent(int startLine, int lineCount, int indent) Sets the indent of the specified lines. |
void | setLineJustify(int startLine, int lineCount, boolean justify) Sets the justify of the specified lines. |
void | setLineTabStops(int startLine, int lineCount, int[] tabStops) Sets the tab stops of the specified lines. |
void | setLineWrapIndent(int startLine, int lineCount, int wrapIndent) Sets the wrap indent of the specified lines. |
void | setMarginColor(Color color) Sets the color of the margins. |
void | setMargins(int leftMargin, int topMargin, int rightMargin, int bottomMargin) Sets the margins. |
void | setSelection(int start) Sets the selection to the given position and scrolls it into view. |
void | setSelection(Point point) Sets the selection and scrolls it into view. |
void | setSelectionRange(int start, int length) Sets the selection. |
void | setStyleRange(StyleRange range) Adds the specified style. |
void | setStyleRanges(StyleRange[] ranges) Sets styles to be used for rendering the widget content. |
void | setStyleRanges(int[] ranges, StyleRange[] styles) Sets styles to be used for rendering the widget content. |
void | setStyleRanges(int start, int length, int[] ranges, StyleRange[] styles) Clears the styles in the range specified by start and length and adds the new styles. |
void | setTabs(int tabs) Sets the tab width. |
void | setTabStops(int[] tabs) Sets the receiver's tab list. |
void | setText(String text) Sets the widget content. |
void | setTextLimit(int limit) Sets the text limit to the specified number of characters. |
void | setWordWrap(boolean wrap) Sets whether the widget wraps lines. |