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.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();

...