...
- Create a class
TapeViewPart
in a new packagede.cau.cs.rtprakt.login.simple.views
that extends the ViewPart class. - Add a private field
tableViewer
of type TableViewer. 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 language java title createPartControl(...) linenumbers true collapse true Table table = new Table(parent, SWT.BORDER); TableColumn column = new TableColumn(table, SWT.NONE); column.setWidth(80); 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 title setFocus(...) linenumbers true collapse true tableViewer.getControl().setFocus();
...