Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » JFace Layout Mystery - What am I doing wrong?
JFace Layout Mystery - What am I doing wrong? [message #1719177] Tue, 05 January 2016 21:01 Go to next message
Jim Boone is currently offline Jim BooneFriend
Messages: 15
Registered: August 2015
Location: North Carolina
Junior Member
Hi,

I am using the following code to create a property tabbed propertysheet page. My desire is for the tabbed folder to grab the excess horizontal and vertical space properly. However, as you can see, the text continues off the screen even though the containing widget is told to wrap. Does anyone have a clue what I am doing wrong? I am stumped. Thanks in advance!

--Jim

	@PostConstruct
	@Override
	public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {

		parent.setLayout(new GridLayout(1, false));
		parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
		
		ScrolledForm scrldfrmNewScrolledform = formToolkit.createScrolledForm(parent);
		//Form scrldfrmNewScrolledform = formToolkit.createForm(parent);		
		scrldfrmNewScrolledform.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		formToolkit.paintBordersFor(scrldfrmNewScrolledform);
		scrldfrmNewScrolledform.getBody().setLayout(new GridLayout(1, false));

		tabFolder = new CTabFolder(scrldfrmNewScrolledform.getBody(), SWT.BORDER);
		tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		tabFolder.setTabPosition(SWT.BOTTOM);
		formToolkit.adapt(tabFolder);
		formToolkit.paintBordersFor(tabFolder);
		tabFolder.setSelectionBackground(
				Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));

		tbtmDocumentation = new CTabItem(tabFolder, SWT.NONE);
		tbtmDocumentation.setText("Documentation");

		Composite docComposite = formToolkit.createComposite(tabFolder, SWT.NONE);
		tbtmDocumentation.setControl(docComposite);
		formToolkit.paintBordersFor(docComposite);
		docComposite.setLayout(new GridLayout(1, false));

		styledDocumentationText = new StyledText(docComposite, SWT.WRAP);
		styledDocumentationText.setAlwaysShowScrollBars(false);
		styledDocumentationText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		formToolkit.adapt(styledDocumentationText);
		formToolkit.paintBordersFor(styledDocumentationText);

		tbtmAppInfo = new CTabItem(tabFolder, SWT.NONE);
		tbtmAppInfo.setText("Application Info");

		Composite appComposite = formToolkit.createComposite(tabFolder, SWT.NONE);
		tbtmAppInfo.setControl(appComposite);
		formToolkit.paintBordersFor(appComposite);
		appComposite.setLayout(new GridLayout(1, false));

		styledAppInfoText = new StyledText(appComposite, SWT.WRAP);
		styledAppInfoText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		styledAppInfoText.setAlwaysShowScrollBars(false);
		formToolkit.adapt(styledAppInfoText);
		formToolkit.paintBordersFor(styledAppInfoText);

		super.createControls(parent, tabbedPropertySheetPage);


index.php/fa/24498/0/
Re: JFace Layout Mystery - What am I doing wrong? [message #1722519 is a reply to message #1719177] Fri, 05 February 2016 12:20 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I think you should not use a ScrolledForm. Replace it by a simple Form.
A ScrolledForm will provide as much space as its child controls need.
Previous Topic:How to draw Annotation in SourceViewer
Next Topic:Button-clicked listeners in Wizard
Goto Forum:
  


Current Time: Fri Mar 29 01:27:17 GMT 2024

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

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

Back to the top