CCombo and FormData [message #314844] |
Wed, 25 April 2007 08:39  |
Eclipse User |
|
|
|
Originally posted by: jan_ryba.interia.pl
Hallo,
I tried to create "Tabbed property" with Clabel, button and Ccombo object. I
have created this object:
Composite composite = getWidgetFactory().createFlatFormComposite(parent);
CLabel fitnessFunctionLabel =
getWidgetFactory().createCLabel(composite, "aaa");
CCombo fitnessFunctionCombo = getWidgetFactory().createCCombo(parent);
Button changeButton = getWidgetFactory().createButton(composite,
"bbb", SWT.PUSH);
and after that I try to configure their positions. Everything is OK except:
data = new FormData();
data.left = new FormAttachment(0, 150);
fitnessFunctionCombo.setLayoutData(data);
I hava an exception:
ava.lang.ClassCastException: org.eclipse.swt.layout.FormData cannot be cast
to org.eclipse.swt.layout.FillData
Can I use formData to Ccombo or should I use somethig else?
regards
Janusz
|
|
|
|
Re: CCombo and FormData [message #314868 is a reply to message #314855] |
Wed, 25 April 2007 17:21  |
Eclipse User |
|
|
|
Originally posted by: jan_ryba.interia.pl
Hi Grant,
Thank's. Now it is working. I used example from "The Eclipse Tabbed
Properties View" article and there was everything OK (without Ccombo)
Janusz
> Hi Janusz,
>
> It looks like createFlatFormComposite() is giving you a Composite whose
> layout is not pre-set to FormLayout (either it's pre-set to FillLayout, or
> there is no layout pre-set on it and FillLayout is set on some other
> control
> higher in the widget hierarchy). I don't think you can assume that
> createFlatFormComposite() returns a Composite whose layout is pre-set to
> FormLayout.
>
> Grant
>
>
> "Janusz" <jan_ryba@interia.pl> wrote in message
> news:f0ni24$3o0$1@build.eclipse.org...
>> Hallo,
>>
>> I tried to create "Tabbed property" with Clabel, button and Ccombo
>> object.
> I
>> have created this object:
>>
>> Composite composite = getWidgetFactory().createFlatFormComposite(parent);
>>
>> CLabel fitnessFunctionLabel =
>> getWidgetFactory().createCLabel(composite, "aaa");
>> CCombo fitnessFunctionCombo = getWidgetFactory().createCCombo(parent);
>> Button changeButton = getWidgetFactory().createButton(composite,
>> "bbb", SWT.PUSH);
>>
>> and after that I try to configure their positions. Everything is OK
> except:
>>
>> data = new FormData();
>> data.left = new FormAttachment(0, 150);
>> fitnessFunctionCombo.setLayoutData(data);
>>
>> I hava an exception:
>> ava.lang.ClassCastException: org.eclipse.swt.layout.FormData cannot be
> cast
>> to org.eclipse.swt.layout.FillData
>>
>> Can I use formData to Ccombo or should I use somethig else?
>>
>> regards
>> Janusz
|
|
|
Powered by
FUDForum. Page generated in 0.03563 seconds