Bug 88942 - [Forms] label and combo box don't line up
Summary: [Forms] label and combo box don't line up
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dejan Glozic CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
Depends on:
Blocks:
 
Reported: 2005-03-23 17:07 EST by Wassim Melhem CLA
Modified: 2005-05-06 19:44 EDT (History)
0 users

See Also:


Attachments
uneven label and combo box (7.57 KB, image/gif)
2005-03-23 17:54 EST, Wassim Melhem CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.