Develop reusable Custom Widgets In XWT [message #566042] |
Tue, 15 December 2009 06:10  |
Eclipse User |
|
|
|
Thanks for the answers from Yves YANG in e4 developer mailing list.
For example:
In your example, DecoratedText have property ,text, then the widgets will be used as following:
<Composite xmlns:c="clr-namespace:ext.custom">
<c:DecoratedText text="newWidgets" />
</Composite>
and :
DecoratedText.java
------------------
package ext.custom;
public class DecoratedText {
private String text;
....
...
// event handling methods
...
}
DecoratedText.xwt
------------------
<Composite x:Class="ext.custom.DecoratedText">
<Label text={xxxxxx??}/>
<Text/>
</Composite>
How to get the property text in DecoratedText.xwt and set it into a Label or others.
Thanks
|
|
|
|
Re: Develop reusable Custom Widgets In XWT [message #566107 is a reply to message #566064] |
Tue, 15 December 2009 18:00  |
Eclipse User |
|
|
|
Here is the bug for this feature:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=297586
yves
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hg90to$fq7$1@build.eclipse.org...
>> How to get the property text in DecoratedText.xwt and set it into a Label
>> or others.
> By now, you need to give them a name. and then call
> XWT.findElementByName(context, "<name>");
>
> <Composite x:Class="ext.custom.DecoratedText">
> <Label name="myText" text={xxxxxx??}/>
> <Text/>
> </Composite>
>
> protected void eventHandle(Object sender, Event event) {
> Text text = (Text) XWT.findElementByName(event.widget, "myText");
> }
>
> We are considering to provide automatic solution to initialize the class
> Field to avoid the manuel research call
>
> Best regards
> Yves YANG
> "Jinshan" <jinshanl@gmail.com> wrote in message
> news:hg8ce9$hmb$1@build.eclipse.org...
>> Thanks for the answers from Yves YANG in e4 developer mailing list.
>>
>> For example:
>> In your example, DecoratedText have property ,text, then the widgets will
>> be used as following:
>>
>> <Composite xmlns:c="clr-namespace:ext.custom">
>> <c:DecoratedText text="newWidgets" />
>> </Composite>
>>
>> and :
>> DecoratedText.java
>> ------------------
>> package ext.custom;
>>
>> public class DecoratedText {
>> private String text;
>>
>> ....
>> ...
>>
>> // event handling methods
>> ...
>> }
>>
>> DecoratedText.xwt
>> ------------------
>> <Composite x:Class="ext.custom.DecoratedText">
>> <Label text={xxxxxx??}/>
>> <Text/>
>> </Composite>
>>
>> How to get the property text in DecoratedText.xwt and set it into a Label
>> or others.
>>
>> Thanks
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03946 seconds