Child pages
  • The Plug-in Architecture of Eclipse

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Switch back to the Overview tab of the Plug-in Manifest Editor.
  2. Click Launch an Eclipse Application.
    • For future tests, you can now select Eclipse Application in the run menu.
    • To enable debug mode for your test instances: open the Run Configurations dialog, select the Arguments tab of the Eclipse Application configuration, and add -debug -consoleLog as program arguments. This dumps all errors and exceptions to the console view, so you can directly see what went wrong.
    • To improve performance, select only the plugins that are necessary: in the Plug-ins tab select Launch with plug-ins selected below only, deselect Target Platform, select Workspace, and then Add Required Plug-ins.
      • Make sure that org.eclipse.ui.ide.application is also selected, else you won't be able to launch Eclipse.
      • The requirements list needs to be updated when the dependencies of your plugins have changed; click Add Required Plug-ins again for updating. 
  3. In the new Eclipse instance, click New -> Project... -> General -> Project. Enter test as the project name.
  4. Right-click the new project and click New -> File... As the file name, enter test.simple. This will create a new file with that name and open the file in your newly added text editor. (You can see that it is your editor by looking at the editor icon, which should look like the icon you downloaded and put into the icons folder.)

Creating a Simple View

WRITE THIS SECTIONThe next task consists of creating a view that is able to display the state of a Turing Machine. We will do this using a table with one column, where each row represents an entry on the tape of the Turing Machine. The tape shall be infinite to one side, and the position of the read/write head shall be movable by two buttons. The content of the tape shall be determined by the currently active instance of our simple text editor.

Info
titleHint

In this tutorial, we will be making use of the Standard Widget Toolkit (SWT) to build a user interface. It might be a good idea now to search for an introduction to SWT concepts on the Internet now before you proceed.

Creating the View Class

We will start by creating a class that will define the view.

  1. Create a class TapeViewPart in a new package de.cau.cs.rtprakt.login.simple.views that extends the ViewPart class.
  2. Add a private field tableViewer of type TableViewer.
  3. Your TableViewPart contains a still empty method createPartControl. This method will be responsible for creating the user interface components of your view. Add the following code to create the table we want to display:

    Code Block
    languagejava
    titlecreatePartControl(...)
    linenumberstrue
    collapsetrue
    Table table = new Table(parent, SWT.BORDER);
    TableColumn column = new TableColumn(table, SWT.NONE);
    column.setWidth(80);
    tableViewer = new TableViewer(table);
  4. The setFocus method controls what happens when your part gets the focus. Make sure the focus will then automatically be set to the table by adding the following code:

    Code Block
    titlesetFocus(...)
    linenumberstrue
    collapsetrue
    tableViewer.getControl().setFocus();

 

 

 

 

Creating an Extension Point

...