Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » CTabItem Content Not showing up
CTabItem Content Not showing up [message #527551] Thu, 15 April 2010 11:03 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:StyledText in SWT Table
Next Topic:How to position the caret from mouse cursor in SWT Text
Goto Forum:
  


Current Time: Tue Jul 01 06:15:38 EDT 2025

Powered by FUDForum. Page generated in 0.08068 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top