Community
Participate
Working Groups
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);
Created attachment 19146 [details] uneven label and combo box
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.