...
- Create a class
TapeViewPart
in a new packagede.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.) - Add a private field
tableViewer
of type TableViewer. Your
TableViewPart
contains a still empty methodcreatePartControl
. 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 language java 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);
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();
...