Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » CCombo and FormData
CCombo and FormData [message #314844] Wed, 25 April 2007 08:39 Go to next message
Eclipse UserFriend
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 #314855 is a reply to message #314844] Wed, 25 April 2007 10:41 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: CCombo and FormData [message #314868 is a reply to message #314855] Wed, 25 April 2007 17:21 Go to previous message
Eclipse UserFriend
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
Previous Topic:PatternRule with startSequence '\n'
Next Topic:Bug with the remote debugger ?
Goto Forum:
  


Current Time: Fri Jul 18 21:43:56 EDT 2025

Powered by FUDForum. Page generated in 0.03563 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top