Bug 88942

Summary: [Forms] label and combo box don't line up
Product: [Eclipse Project] Platform Reporter: Wassim Melhem <wassim.melhem>
Component: UIAssignee: Dejan Glozic <dejan>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 Keywords: polish
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
uneven label and combo box none

Description Wassim Melhem CLA 2005-03-23 17:07:46 EST
Build: I-20050323

I have a number of FormEntry's in the General Information section of the 
plugin editor. 
In the last row, I tried adding a label and a combo box, but the two don't 
seem to align.  Screenshot to follow.

Here is the code:
Label matchLabel = toolkit.createLabel(client, PDEPlugin.getResourceString
(KEY_MATCH));
matchLabel.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
matchLabel.setLayoutData(new TableWrapData(TableWrapData.MIDDLE));
		
fMatchCombo = new ComboPart();
fMatchCombo.createControl(client, toolkit, SWT.READ_ONLY);
TableWrapData td = new TableWrapData(TableWrapData.FILL);
td.colspan = 2;
fMatchCombo.getControl().setLayoutData(td);
Comment 1 Wassim Melhem CLA 2005-03-23 17:54:27 EST
Created attachment 19146 [details]
uneven label and combo box
Comment 2 Dejan Glozic CLA 2005-05-06 19:44:32 EDT
The code above has several problems:

1) matchLabel has TableWrapData that has 'MIDDLE' set using the wrong 
constructor (align). I will add Assert to check for values.

2) One line is missing for combo:

fMatchCombo = new ComboPart();
fMatchCombo.createControl(client, toolkit, SWT.READ_ONLY);
TableWrapData td = new TableWrapData(TableWrapData.FILL);
td.colspan = 2;
td.valign = TableWrapData.MIDDLE; <--- missing

My tests show that with these changes the layout class works correctly.