This example demonstrates how to use the StyledText widget to implement a text editor with formatting support.
If the Example Launcher is installed, select the Text Editor item from the Standalone category and click Run.
Otherwise, install and run the example manually as per the
Standalone Examples Manual Setup instructions. The executable class is
org.eclipse.swt.examples.texteditor.TextEditor
.
The example has a typical text editor interface. The File menu contains Cut, Copy, Paste and Set Font items and the toolbar provides a bold text toggle, three colour tools that operate on the current selection, and a reset to defaults button that also operates on the current selection.