Child pages
  • The Plug-in Architecture of Eclipse

Versions Compared

Key

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

...

  1. Create a class TapeViewPart in a new package de.cau.cs.rtprak.login.simple.views that extends the ViewPart class. (make sure that in the New Java Class wizard, the option Inherited abstract methods is checked.)
  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
    Table table = new Table(parent, SWT.BORDER);
    table.setHeaderVisible(true);
    TableColumn column = new TableColumn(table, SWT.NONE);
    column.setWidth(80);
    column.setText("Tape Data");
    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
    tableViewer.getControl().setFocus();

...