Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329004 - [Forms] ScrolledForm, TableHeader wider than 100 %
Summary: [Forms] ScrolledForm, TableHeader wider than 100 %
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: platform-ua-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-29 03:31 EDT by Thomas CLA
Modified: 2011-02-14 05:32 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas CLA 2010-10-29 03:31:32 EDT
Build Identifier: M20080911-1700

Created a scrolled form, with a section. Section contains table, Section set to SWT.FILL.
Scrollbar visible because table has some more widt. If you rise the width of the view, Table gets wider on next start.
Workaround: use Form instead of scrolled form, but in my project, i've added some contend which is better placed in a scrolled Form

Reproducible: Always

Steps to Reproduce:
public final void createPartControl(Composite parent) {
		toolkit = new FormToolkit(parent.getDisplay());
		form = toolkit.createScrolledForm(parent);//Workaround use form
		GridLayout layout = new GridLayout();
		form.getBody().setLayout(layout);
		Section detailsSection = toolkit.createSection(form.getBody(),
				Section.TITLE_BAR | Section.EXPANDED);
		detailsSection.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true,false));

		detailsSection.setText("Details");
		Composite sectionClient = toolkit.createComposite(detailsSection);
		TableColumnLayout tableColumnLayout = new TableColumnLayout();
		sectionClient.setLayout(tableColumnLayout);
		Table bDetails = toolkit.createTable(sectionClient, SWT.NONE);
		bDetails.setHeaderVisible(true);
		bDetViewer = new TableViewer(bDetails);
		String[] titles = { "1", "2__x", "3xxxx", "xx4", "x y 5" };
		int[] withs = { 21, 12, 25, 17, 25 };//percent
		for (int i = 0; i < withs.length; i++) {
			TableViewerColumn column = new TableViewerColumn(bDetViewer,
					SWT.NONE);
			column.getColumn().setText(titles[i]);
			tableColumnLayout.setColumnData(column.getColumn(),
					new ColumnWeightData(withs[i], 25, true));
			column.getColumn().setMoveable(true);
		}
		bDetViewer.setContentProvider(new ArrayContentProvider());
//		bDetViewer.setLabelProvider(new ...);

		bDetViewer.setInput("");
		detailsSection.setClient(sectionClient);
}
Comment 1 Thomas CLA 2010-10-29 04:01:54 EDT
(In reply to comment #0)
found similar Bug 215997
Comment 2 Chris Goldthorpe CLA 2011-02-07 18:22:15 EST
I just tried the example you pasted into the bug using I20110127-2034 but did not see a scrollbar except when the view was very narrow.
Comment 3 Thomas CLA 2011-02-14 05:32:32 EST
In reaction to the comment of Chris Goldthorpe I tried it with Eclipse 3.6.1 and the newer version of the SWT-Plug-in.
Somewehere between the two versions the bug vanishes.
(I wrote Eclipse Version 3.4.1 by mistake when I posted the bug but used Eclipse 3.4.0; SWT-Plug-in Version 3.4.1)