Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 298524

Summary: FormDialog calculates TableViewer's initial width incorrectly
Product: [RT] RAP Reporter: Setya Nugdjaja <jsetya>
Component: JFaceAssignee: Project Inbox <rap-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Setya Nugdjaja CLA 2009-12-25 12:20:32 EST
Hi all,

When laying out TableViewer on FormDialog, a horizontal scrollbar is always drawn on 1st display. It seems that FormDialog doesn't compute the TableViewer's initial width correctly.

The following is the snippet to reproduce the problem:

...
FormDialog dialog = new FormDialog(parent.getDisplay().getActiveShell())
{
@Override
protected void createFormContent(IManagedForm form)
{
Composite parent = form.getForm().getBody();
parent.setLayout(GridLayoutFactory.fillDefaults().create());

Composite container = new Composite(parent,SWT.None);
TableColumnLayout layout = new TableColumnLayout();
container.setLayout(layout);
				      container.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
				      
TableViewer tableViewer = new TableViewer(new Table(container, SWT.VIRTUAL));
tableViewer.getTable().setHeaderVisible(true);
				      
TableViewerColumn col = new TableViewerColumn(tableViewer, SWT.NULL);
col.getColumn().setText("Field 1");
				      
layout.setColumnData(col.getColumn(), new ColumnWeightData(100));
}

@Override
protected Point getInitialSize(){return new Point(500,400);}
};
          
dialog.open();
...

I've tried above snippet on RCP and it worked fine.


Regards,

Setya
Comment 1 Ivan Furnadjiev CLA 2010-01-25 08:00:56 EST
After spending too much time on it, trying to find the reason/fix, there is still no progress. I will close it as WONTFIX. Setya, if you can provide some insides/fix/patch please reopen the bug.
Comment 2 Setya Nugdjaja CLA 2010-01-25 10:59:08 EST
Hi,

(In reply to comment #1)
> After spending too much time on it, trying to find the reason/fix, there is
> still no progress. I will close it as WONTFIX. Setya, if you can provide some
> insides/fix/patch please reopen the bug.

I'll try to help as soon as I have time to delve deep into this problem.

In the meantime maybe the rest of the team can also investigate this ?

Regards,

Setya
Comment 3 Ivan Furnadjiev CLA 2010-02-28 07:34:47 EST
Setya, with the adoption of Forms 3.6 ( see bug 303731 ), we activated a scrollbars related code in SharedScrolledComposite#reflow(boolean). Can you check if the problem is fixed?