[jbosside-dev] jface-swt driving me crazy!

Marshall Culpepper marshall.culpepper at jboss.com
Fri Oct 27 11:26:23 EDT 2006


This sometimes happens to me when I have a Composite embeded in another
GridLayout Composite.. is the "parent" in this method also using a
GridLayout? You might wanna try panel.setLayoutData(GridData.FILL_BOTH) ?

On 10/27/06, Max Rydahl Andersen <max.andersen at jboss.com> wrote:
>
> 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 at hibernate.org
> http://hibernate.org
>
> JBoss a division of Red Hat
> max.andersen at jboss.com
>
> _______________________________________________
> jbosside-dev mailing list
> jbosside-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosside-dev
>
>
>
>


-- 
Marshall Culpepper
marshall.culpepper at jboss.com
JBossIDE Team Lead
JBoss, a division of Red Hat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jbosstools-dev/attachments/20061027/ef4d02b6/attachment.html 


More information about the jbosstools-dev mailing list