Eclipse Rich Client Platform - Text Infrastructure
Eclipse Rich Client Platform

The rich client platform (RCP) is a major theme since Eclipse 3.0. As many applications provide some sort of text editing, an optional RCP Text component is provided.

Optional Text Editing Components

Applications that want to offer text editing capabilities may include the following eclipse plug-ins which are an optional part of RCP i.e. they are not included in the RCP Runtime Binary available from the Eclipse Project download page but they can be extracted from the Platform Runtime Binary download):

  • org.eclipse.text
  • org.eclipse.jface.text
  • org.eclipse.ui.workbench.texteditor
  • since 3.3: org.eclipse.ui.editors - provides a Text editor but drags in plug-ins like:
    • org.eclipse.ui.ide
    • org.eclipse.core.resources
    Use this if the resulting size of your RCP isn't important and you don't want to write your own editor.
RCP Text Editor Example

The RCP Text Editor Example is a simple RCP application that creates own text editors using the text editing infrastructure (an optional RCP component) and offers text editing capabilities such as shifting, moving and deleting lines, find/replace, auto-completion and basic syntax highlighting for markup languages. See also the documentation and implementation notes.

To run the example in binary form:

  1. Download the RCP Runtime Binary from the Eclipse Project downloads page and extract it to a folder such as c:\texteditor-example. The eclipse subfolder of this location will be referenced as <install_dir> below.
  2. Download the Platform Text Binary and extract it into <install_dir>/plugins subfolder.
  3. Download the RCP Text editor example plug-in and save it into the <install_dir>/plugins subfolder.
  4. Replace the <install_dir>/configuration/config.ini file with this one.
  5. Run the eclipse executable: For example, on Windows, run <install_dir>/eclipse.exe.

To load the RCP text editor example source into your workspace:

  1. Download the texteditor source plug-in and save it on your harddisk.
  2. Choose File > Import... > Existing Project into Workspace.
  3. Click the Browse... button to select the zip file you downloaded in step 1.
  4. Press Finish.
To run the example from your workspace:
  1. Choose Run > Open Run Dialog...
  2. Under Run-time Workbench, there should be a new launch configuration: RCP Text Editor.
  3. Click Run.
  4. When the RCP Text Editor Example window opens, use File > Open to open a plain text, .xml, or .html file.

Default Text Editor Example (requires R3.3 or later)

This example shows how to use the Eclipse Text editor in your RCP application. As mentioned above this requires to add several additional plug-ins and hence increases the size of the resulting RCP application.

To run the example in binary form:
  1. Download the RCP Runtime Binary from the Eclipse Project downloads page and extract it to a folder such as c:\texteditor-example. The eclipse subfolder of this location will be referenced as <install_dir> below.
  2. Download the Platform Runtime Binary from the Eclipse Project downloads page and extract the following plug-ins into <install_dir>/plugins:
    • org.eclipse.core.filebuffers
    • org.eclipse.core.filesystem + corresponding fragment
    • * org.eclipse.core.net
    • org.eclipse.core.resources + corresponding fragment
    • org.eclipse.jface.text
    • org.eclipse.text
    • org.eclipse.ui.editors
    • * org.eclipse.ui.forms
    • org.eclipse.ui.ide
    • * org.eclipse.ui.views
    • org.eclipse.ui.workbench.texteditor
    • * org.eclipse.update.core + corresponding fragment
    • * org.eclipse.update.ui
    *) these plug-ins are not really needed but as they are not marked optional in the manifest of org.eclipse.ui.ide and therefore we have to add them as well (see bug 198821 for details).
  3. Download the Text editor example plug-in and save it into the <install_dir>/plugins subfolder.
  4. Replace the <install_dir>/configuration/config.ini file with this one.
  5. Run the eclipse executable: For example, on Windows, run <install_dir>/eclipse.exe.

To load the default Text editor example source into your workspace:

  1. Download the texteditor source plug-in and save it on your harddisk.
  2. Choose File > Import... > Existing Project into Workspace.
  3. Click the Browse... button to select the zip file you downloaded in step 1.
  4. Press Finish.
To run the example from your workspace:
  1. Choose Run > Open Run Dialog...
  2. Under Run-time Workbench, there should be a new launch configuration: RCP Text Editor.
  3. Click Run.
  4. When the RCP Text Editor Example window opens, use File > Open to open a plain text, .xml, or .html file.