CTabItem Content Not showing up [message #527551] |
Thu, 15 April 2010 11:03  |
Eclipse User |
|
|
|
Hi,
I am unable to get my CTabItem content to show up. I am creating the CTabFolder, adding a CTabItem to it, creating a Composite on the CTabFolder. Setting tab item control to that composite.
@Override
public void createPartControl(Composite parent) {
//Create Form and Toolkit
managedForm = new ManagedForm(parent);
form = managedForm.getForm();
toolkit = managedForm.getToolkit();
form.setText("Function Edit Form - ");
//Set layout
ColumnLayout formLayout = new ColumnLayout();
form.getBody().setLayout(formLayout);
//Add the tabFolder
tabFolder = new CTabFolder(form.getBody(), SWT.FLAT | SWT.BOTTOM);
toolkit.adapt(tabFolder, true, true);
ColumnLayoutData clData = new ColumnLayoutData(ColumnLayoutData.FILL);
clData.heightHint = 0;
tabFolder.setLayout(new ColumnLayout());
tabFolder.setLayoutData(clData);
Color selectedColor = toolkit.getColors().getColor(FormColors.SEPARATOR);
tabFolder.setSelectionBackground(new Color[] {selectedColor, toolkit.getColors().getBackground()}, new int[] {100});
toolkit.paintBordersFor(tabFolder);
tabFolder.setCursor(FormsResources.getHandCursor());
tabFolder.setSimple(false);
//Create the Function Tab and contents
final CTabItem item = new CTabItem(tabFolder, SWT.NULL);
item.setText("Function");
functionTabContent = toolkit.createComposite(tabFolder);//form.getBody());
item.setControl(functionTabContent);
clData = new ColumnLayoutData(ColumnLayoutData.FILL);
functionTabContent.setLayoutData(clData);
functionTabContent.setLayout(new ColumnLayout());
... Adding things to the Composite functionTabContent...
form.getForm().layout(true, true);
}
I am completely stumped as to why this is not working. Any suggestions are appreicated.
Thanks,
Andrew
|
|
|
Re: CTabItem Content Not showing up [message #527636 is a reply to message #527551] |
Thu, 15 April 2010 16:21  |
Eclipse User |
|
|
|
Solved my own problem.
Problem lines:
tabFolder.setLayout(new ColumnLayout());
tabFolder.setLayoutData(clData);
You are not supposed to assign Layout information to the folder. This fact is written in the API.
Andrew
|
|
|
Powered by
FUDForum. Page generated in 0.08068 seconds