From 4d198e5cbe796ea8430f42eb397d366064d1b1e5 Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Wed, 7 Apr 2010 15:23:45 +0200 Subject: [PATCH] Embedded to tree in a TabFolder, thanx to Yanamon for the crucial clue: http://stackoverflow.com/questions/2397925/how-to-embed-a-swt-tableviewer-in-a-tabfolder --- .../src/com/github/gittodo/rcp/GitToDo.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/com.github.gittodo.rcp/src/com/github/gittodo/rcp/GitToDo.java b/com.github.gittodo.rcp/src/com/github/gittodo/rcp/GitToDo.java index e881158..1564fd2 100644 --- a/com.github.gittodo.rcp/src/com/github/gittodo/rcp/GitToDo.java +++ b/com.github.gittodo.rcp/src/com/github/gittodo/rcp/GitToDo.java @@ -13,6 +13,8 @@ import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.TabItem; import org.openscience.gittodo.sort.ItemSorter; import com.github.gittodo.rcp.views.GitToDoTree; @@ -28,7 +30,12 @@ public static void main( String[] args ) { FillLayout layout = new FillLayout(); shell.setLayout(layout); - final GitToDoTree tableViewer = new GitToDoTree(shell); + TabFolder tabFolder = new TabFolder(shell, SWT.NONE); + TabItem item = new TabItem(tabFolder, SWT.NONE); + item.setText("TODO List"); + + final GitToDoTree tableViewer = new GitToDoTree(tabFolder); + item.setControl(tableViewer.getTable()); // Possible setControl call? Menu menuBar = new Menu(shell, SWT.BAR); shell.setMenuBar( menuBar );