Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » CTabItem Content Not showing up
CTabItem Content Not showing up [message #527551] Thu, 15 April 2010 15:03 Go to next message
Andrew Hubbs is currently offline Andrew HubbsFriend
Messages: 9
Registered: April 2010
Location: Dallas TX
Junior Member

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


Thanks,

Andrew Hubbs
Re: CTabItem Content Not showing up [message #527636 is a reply to message #527551] Thu, 15 April 2010 20:21 Go to previous message
Andrew Hubbs is currently offline Andrew HubbsFriend
Messages: 9
Registered: April 2010
Location: Dallas TX
Junior Member

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


Thanks,

Andrew Hubbs
Previous Topic:StyledText in SWT Table
Next Topic:How to position the caret from mouse cursor in SWT Text
Goto Forum:
  


Current Time: Mon Aug 26 00:07:49 GMT 2019

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

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

Back to the top