Hi,
I'm going crazy how hard it is to put a combobox in a toolbar in eclipse
without it looking bad.
See the attached snapshot where the lower border/pixels of the comboboxes
are missing.
Anyone who got an idea how to make this work !?
here is the relevant code in a subclass of ControlContribution:
protected Control createControl(Composite parent) {
Composite panel = new Composite( parent, SWT.NONE );
panel.setLayout( new GridLayout(2,false) );
if(getLabelText()!=null) {
Label label = new Label(panel, SWT.None);
label.setText(getLabelText());
GridData gd = new GridData();
gd.horizontalSpan = 1;
gd.verticalAlignment = GridData.BEGINNING;
gd.horizontalAlignment = GridData.END;
}
comboControl = new Combo( panel, SWT.DROP_DOWN |
(isReadOnly()?SWT.READ_ONLY:SWT.NONE) );
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.widthHint = getComboWidth();
gd.verticalAlignment = GridData.CENTER;
gd.horizontalAlignment = GridData.END;
comboControl.setLayoutData( gd );
populateComboBox( comboControl );
if(getSelectionAdapter()!=null) {
comboControl.addSelectionListener( getSelectionAdapter() );
}
return panel;
}
--
--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
max(a)hibernate.org
http://hibernate.org
JBoss a division of Red Hat
max.andersen(a)jboss.com