|
Re: TreeViewer and TabFolder [message #464361 is a reply to message #464359] |
Tue, 22 November 2005 04:19 |
Aaron Messages: 13 Registered: July 2009 |
Junior Member |
|
|
you have to use setControl for the tab's contents. For you I think there
are two ways of doing this, just putting in the tree, or making a function
for the composite (if you want more on the tab than the tree). The first
way of doing this would be something like:
TabFolder folder = new TabFolder(parent, SWT.BOTTOM);
TabItem projectTab = new TabItem(folder, SWT.NONE, 0);
projectTab.setControl(new TreeViewer(projectComp));
Note that this will only allow for the tree to be on the tab. If you
wanted more stuff on the tab you can still use a composite, and just pass
the composite to setControl like this:
TabFolder folder = new TabFolder(parent, SWT.BOTTOM);
TabItem projectTab = new TabItem(folder, SWT.NONE, 0);
// set up your composite here
Composite projectComp = new Composite(folder, SWT.NONE);
TreeViewer treeViewer = new TreeViewer(projectComp);
.....
// and anything else you want
// now pass the composite to setControl
projectTab.setControl(projectComp);
I think this is what you're looking for, but someone feel free to correct
me if I am wrong.
Aaron
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04121 seconds