Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Forms UI inside tabs(Is it possible to embed forms in CTabItems or similiar containers?)
icon5.gif  Forms UI inside tabs [message #664052] Thu, 07 April 2011 10:15
Thorsten Reitz is currently offline Thorsten ReitzFriend
Messages: 1
Registered: April 2011
Junior Member
Dear eclipse community,

I would like to create a three-part form without using the multipage editor facilities that the forms UI provides. An editor is not really the applicable thing for my use case for various reasons.

Consequently, I tried to emulate the look and feel of a multipage editor by using a normal view with a CTabFolder inside. To this CTabFolder, I added three CTabItems, to each of which I would like to add a different form. Is it possible? If yes, what is the mistake I am currently making? This is the (slightly abbreviated) code I am using:

createPartControl of the View:

public void createPartControl(Composite parent) {

	    // Create the tabs
	    tabFolder = new CTabFolder(parent, SWT.LEFT|SWT.BOTTOM);
	    tabFolder.setBorderVisible(true);
	    tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
	    Display display = parent.getShell().getDisplay();
	    
	    CTabItem overviewTabItem = new CTabItem(tabFolder, SWT.NONE, 0);
	    overviewTabItem.setText("Mistmach Overview");
	    overviewTabItem.setToolTipText("Select a Mismatch and get overview " +
	    		"information.");
	    overviewTabItem.setControl(this.getOverviewForm(tabFolder));
	    
	    CTabItem reasonsTabItem = new CTabItem(tabFolder, SWT.NONE, 1);
	    reasonsTabItem.setText("Reasons");
	    reasonsTabItem.setToolTipText("Get and edit information of the " +
	    		"reasons for an mismatch.");
...


getOverviewForm:

private Control getOverviewForm(Composite parent) {
		Composite formsComposite = new Composite(parent, SWT.NONE);
		this.formToolkit = new FormToolkit(parent.getDisplay());

		this.overviewForm = this.formToolkit.createScrolledForm(formsComposite);
		overviewForm.setText("Mismatch Overview");
		ColumnLayout layout = new ColumnLayout();
		overviewForm.getBody().setLayout(layout);
		
		// create "Mismatch" Section
		Section sectionMismatch = formToolkit.createSection(overviewForm.getBody(), 
				  Section.DESCRIPTION|Section.TITLE_BAR|
				  Section.TWISTIE|Section.EXPANDED);
		ColumnLayoutData cd = new ColumnLayoutData();
		sectionMismatch.setLayoutData(cd);
...


However, based on this code, the content of the composite (the overviewForm) is not displayed. There seems to be no error/exception popping up, so I am a bit lost.

Thanks for any hints (also for pointers to alternative solutions of using multiple form pages without using an editor),

Thorsten
Previous Topic:(closed)
Next Topic:Internal Browser Disabled
Goto Forum:
  


Current Time: Sat Apr 27 00:53:23 GMT 2024

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

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

Back to the top