Home » Eclipse Projects » Eclipse 4 » Develop reusable Custom Widgets In XWT
Develop reusable Custom Widgets In XWT [message #503761] |
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??}/> <!-How to do? Label.text="newWidgets"->
<Text/>
</Composite>
How to get the property text in DecoratedText.xwt and set it into a Label or others.
Thanks
[Updated on: Tue, 15 December 2009 06:13] by Moderator
|
|
| | | |
Re: Develop reusable Custom Widgets In XWT [message #504071 is a reply to message #503851] |
Wed, 16 December 2009 10:03   |
Eclipse User |
|
|
|
The simple solution is you create a "String text" property in DecoratedText.
In the setter, you can update the content in your widget text or label.
It should be possible to express in XAML. But we need to add a keyword in
binding expression "self". It is not yet supported in XWT.
The code should be:
<Composite x:Class="ext.custom.DecoratedText">
<Label name="myText"/>
<Text text="{Binding source=self,path=text}" />
</Composite>
Best regards
yves
"Jinshan" <jinshanl@gmail.com> wrote in message
news:hg9hge$rl5$1@build.eclipse.org...
> Thanks.
>
> Are there some way to bind DecoratedText.java's properties to
> DecoratedText.xwt.?
>
> For example:
> <c:DecoratedText text="newWidgets" />
>
> then
> <Composite x:Class="ext.custom.DecoratedText">
> <Label name="myText"/>
> <Text/>
> </Composite>
>
> "myText" Label is changed automatic and I need not handle "text" changed
> event. I know the SilverLight is OK.
>
>
>
>
>
> Yves YANG wrote on Tue, 15 December 2009 18:00
>> 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
>> >
>> >
>
>
|
|
| |
Re: Develop reusable Custom Widgets In XWT [message #504262 is a reply to message #504071] |
Thu, 17 December 2009 17:14   |
Eclipse User |
|
|
|
This should work.
<Composite x:Class="ext.custom.DecoratedText"
name="root">
<Label name="myText"/>
<Text text="{Binding elementName=root,path=text}" />
</Composite>
yves
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hgc6jo$s73$1@build.eclipse.org...
> The simple solution is you create a "String text" property in
> DecoratedText. In the setter, you can update the content in your widget
> text or label.
>
> It should be possible to express in XAML. But we need to add a keyword in
> binding expression "self". It is not yet supported in XWT.
>
> The code should be:
> <Composite x:Class="ext.custom.DecoratedText">
> <Label name="myText"/>
> <Text text="{Binding source=self,path=text}" />
> </Composite>
>
> Best regards
> yves
> "Jinshan" <jinshanl@gmail.com> wrote in message
> news:hg9hge$rl5$1@build.eclipse.org...
>> Thanks.
>>
>> Are there some way to bind DecoratedText.java's properties to
>> DecoratedText.xwt.?
>>
>> For example:
>> <c:DecoratedText text="newWidgets" />
>>
>> then
>> <Composite x:Class="ext.custom.DecoratedText">
>> <Label name="myText"/>
>> <Text/>
>> </Composite>
>>
>> "myText" Label is changed automatic and I need not handle "text" changed
>> event. I know the SilverLight is OK.
>>
>>
>>
>>
>>
>> Yves YANG wrote on Tue, 15 December 2009 18:00
>>> 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
>>> >
>>> >
>>
>>
>
>
|
|
|
Re: Develop reusable Custom Widgets In XWT [message #504272 is a reply to message #504262] |
Thu, 17 December 2009 20:28   |
Eclipse User |
|
|
|
<Composite x:Class="ext.custom.DecoratedText"
name="root">
<Label name="myText"/>
<Text text="{Binding elementName=root,path=text}" />
</Composite>
I have checked. This solution works.
yves
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hgeah2$sfm$1@build.eclipse.org...
> This should work.
> <Composite x:Class="ext.custom.DecoratedText"
> name="root">
> <Label name="myText"/>
> <Text text="{Binding elementName=root,path=text}" />
> </Composite>
>
> yves
> "Yves YANG" <yves.yang@soyatec.com> wrote in message
> news:hgc6jo$s73$1@build.eclipse.org...
>> The simple solution is you create a "String text" property in
>> DecoratedText. In the setter, you can update the content in your widget
>> text or label.
>>
>> It should be possible to express in XAML. But we need to add a keyword in
>> binding expression "self". It is not yet supported in XWT.
>>
>> The code should be:
>> <Composite x:Class="ext.custom.DecoratedText">
>> <Label name="myText"/>
>> <Text text="{Binding source=self,path=text}" />
>> </Composite>
>>
>> Best regards
>> yves
>> "Jinshan" <jinshanl@gmail.com> wrote in message
>> news:hg9hge$rl5$1@build.eclipse.org...
>>> Thanks.
>>>
>>> Are there some way to bind DecoratedText.java's properties to
>>> DecoratedText.xwt.?
>>>
>>> For example:
>>> <c:DecoratedText text="newWidgets" />
>>>
>>> then
>>> <Composite x:Class="ext.custom.DecoratedText">
>>> <Label name="myText"/>
>>> <Text/>
>>> </Composite>
>>>
>>> "myText" Label is changed automatic and I need not handle "text" changed
>>> event. I know the SilverLight is OK.
>>>
>>>
>>>
>>>
>>>
>>> Yves YANG wrote on Tue, 15 December 2009 18:00
>>>> 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
>>>> >
>>>> >
>>>
>>>
>>
>>
>
>
|
|
|
Re: Develop reusable Custom Widgets In XWT [message #504304 is a reply to message #504272] |
Fri, 18 December 2009 04:00   |
Eclipse User |
|
|
|
My e4 version is eclipse-e4-SDK-incubation-I20091022-2100-win32. but the fellowing does not work:
Widget:
<Composite xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt" xmlns:c="clr-namespace:allegro.ui.widgets"
xmlns:j="clr-namespace:java.lang" x:Class="allegro.ui.widgets.Image" name="root">
<Composite.layout>
<FillLayout />
</Composite.layout>
<Label name="imageLabel" image="{Binding elementName=root,path=source}" />
</Composite>
Using:
<Composite xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt"
xmlns:c="clr-namespace:allegro.image"
xmlns:j="clr-namespace:java.lang"
xmlns:a="clr-namespace:allegro.ui.widgets"
x:Class="allegro.image.ImageTest">
<Composite.layout>
<GridLayout numColumns="4" />
</Composite.layout>
<a:Image source="logo.gif"/>
</Composite>
Yves YANG wrote on Thu, 17 December 2009 20:28 | <Composite x:Class="ext.custom.DecoratedText"
name="root">
<Label name="myText"/>
<Text text="{Binding elementName=root,path=text}" />
</Composite>
I have checked. This solution works.
yves
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hgeah2$sfm$1@build.eclipse.org...
> This should work.
> <Composite x:Class="ext.custom.DecoratedText"
> name="root">
> <Label name="myText"/>
> <Text text="{Binding elementName=root,path=text}" />
> </Composite>
>
> yves
> "Yves YANG" <yves.yang@soyatec.com> wrote in message
> news:hgc6jo$s73$1@build.eclipse.org...
>> The simple solution is you create a "String text" property in
>> DecoratedText. In the setter, you can update the content in your widget
>> text or label.
>>
>> It should be possible to express in XAML. But we need to add a keyword in
>> binding expression "self". It is not yet supported in XWT.
>>
>> The code should be:
>> <Composite x:Class="ext.custom.DecoratedText">
>> <Label name="myText"/>
>> <Text text="{Binding source=self,path=text}" />
>> </Composite>
>>
>> Best regards
>> yves
>> "Jinshan" <jinshanl@gmail.com> wrote in message
>> news:hg9hge$rl5$1@build.eclipse.org...
>>> Thanks.
>>>
>>> Are there some way to bind DecoratedText.java's properties to
>>> DecoratedText.xwt.?
>>>
>>> For example:
>>> <c:DecoratedText text="newWidgets" />
>>>
>>> then
>>> <Composite x:Class="ext.custom.DecoratedText">
>>> <Label name="myText"/>
>>> <Text/>
>>> </Composite>
>>>
>>> "myText" Label is changed automatic and I need not handle "text" changed
>>> event. I know the SilverLight is OK.
>>>
>>>
>>>
>>>
>>>
>>> Yves YANG wrote on Tue, 15 December 2009 18:00
>>>> 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
>>>> >
>>>> >
>>>
>>>
>>
>>
>
>
|
|
|
|
Re: Develop reusable Custom Widgets In XWT [message #504398 is a reply to message #504304] |
Fri, 18 December 2009 11:58  |
Eclipse User |
|
|
|
The code seems correct. It should work. Please test it with the last build?
Best regards
Yves YANG
"Jinshan" <jinshanl@gmail.com> wrote in message
news:hgfgbu$sjd$1@build.eclipse.org...
> My e4 version is eclipse-e4-SDK-incubation-I20091022-2100-win32. but the
> fellowing does not work:
> Widget:
> <Composite xmlns="http://www.eclipse.org/xwt/presentation"
> xmlns:x="http://www.eclipse.org/xwt"
> xmlns:c="clr-namespace:allegro.ui.widgets"
> xmlns:j="clr-namespace:java.lang" x:Class="allegro.ui.widgets.Image"
> name="root">
>
> <Composite.layout>
> <FillLayout />
> </Composite.layout>
> <Label name="imageLabel" image="{Binding elementName=root,path=source}"
> />
> </Composite>
>
> Using:
> <Composite xmlns="http://www.eclipse.org/xwt/presentation"
> xmlns:x="http://www.eclipse.org/xwt"
> xmlns:c="clr-namespace:allegro.image"
> xmlns:j="clr-namespace:java.lang"
> xmlns:a="clr-namespace:allegro.ui.widgets"
> x:Class="allegro.image.ImageTest">
> <Composite.layout>
> <GridLayout numColumns="4" />
> </Composite.layout>
> <a:Image source="logo.gif"/>
>
> </Composite>
>
>
> Yves YANG wrote on Thu, 17 December 2009 20:28
>> <Composite x:Class="ext.custom.DecoratedText"
>> name="root">
>> <Label name="myText"/>
>> <Text text="{Binding elementName=root,path=text}" />
>> </Composite>
>>
>> I have checked. This solution works.
>>
>> yves
>> "Yves YANG" <yves.yang@soyatec.com> wrote in message
>> news:hgeah2$sfm$1@build.eclipse.org...
>> > This should work.
>> > <Composite x:Class="ext.custom.DecoratedText"
>> > name="root">
>> > <Label name="myText"/>
>> > <Text text="{Binding elementName=root,path=text}" />
>> > </Composite>
>> >
>> > yves
>> > "Yves YANG" <yves.yang@soyatec.com> wrote in message
>> > news:hgc6jo$s73$1@build.eclipse.org...
>> >> The simple solution is you create a "String text" property in
>> >> DecoratedText. In the setter, you can update the content in your
>> >> widget text or label.
>> >>
>> >> It should be possible to express in XAML. But we need to add a keyword
>> >> in binding expression "self". It is not yet supported in XWT.
>> >>
>> >> The code should be:
>> >> <Composite x:Class="ext.custom.DecoratedText">
>> >> <Label name="myText"/>
>> >> <Text text="{Binding source=self,path=text}" />
>> >> </Composite>
>> >>
>> >> Best regards
>> >> yves
>> >> "Jinshan" <jinshanl@gmail.com> wrote in message
>> >> news:hg9hge$rl5$1@build.eclipse.org...
>> >>> Thanks.
>> >>>
>> >>> Are there some way to bind DecoratedText.java's properties to
>> >>> DecoratedText.xwt.?
>> >>>
>> >>> For example:
>> >>> <c:DecoratedText text="newWidgets" />
>> >>>
>> >>> then
>> >>> <Composite x:Class="ext.custom.DecoratedText">
>> >>> <Label name="myText"/>
>> >>> <Text/>
>> >>> </Composite>
>> >>>
>> >>> "myText" Label is changed automatic and I need not handle "text"
>> >>> changed event. I know the SilverLight is OK.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> Yves YANG wrote on Tue, 15 December 2009 18:00
>> >>>> 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
>> >>>> >
>> >>>> >
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>
>
|
|
|
Re: Develop reusable Custom Widgets In XWT [message #566128 is a reply to message #503836] |
Tue, 15 December 2009 21:43  |
Eclipse User |
|
|
|
Thanks.
Are there some way to bind DecoratedText.java's properties to DecoratedText.xwt.?
For example:
<c:DecoratedText text="newWidgets" />
then
<Composite x:Class="ext.custom.DecoratedText">
<Label name="myText"/>
<Text/>
</Composite>
"myText" Label is changed automatic and I need not handle "text" changed event. I know the SilverLight is OK.
Yves YANG wrote on Tue, 15 December 2009 18:00
> 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
> >
> >
|
|
|
Re: Develop reusable Custom Widgets In XWT [message #566190 is a reply to message #566128] |
Wed, 16 December 2009 10:03  |
Eclipse User |
|
|
|
The simple solution is you create a "String text" property in DecoratedText.
In the setter, you can update the content in your widget text or label.
It should be possible to express in XAML. But we need to add a keyword in
binding expression "self". It is not yet supported in XWT.
The code should be:
<Composite x:Class="ext.custom.DecoratedText">
<Label name="myText"/>
<Text text="{Binding source=self,path=text}" />
</Composite>
Best regards
yves
"Jinshan" <jinshanl@gmail.com> wrote in message
news:hg9hge$rl5$1@build.eclipse.org...
> Thanks.
>
> Are there some way to bind DecoratedText.java's properties to
> DecoratedText.xwt.?
>
> For example:
> <c:DecoratedText text="newWidgets" />
>
> then
> <Composite x:Class="ext.custom.DecoratedText">
> <Label name="myText"/>
> <Text/>
> </Composite>
>
> "myText" Label is changed automatic and I need not handle "text" changed
> event. I know the SilverLight is OK.
>
>
>
>
>
> Yves YANG wrote on Tue, 15 December 2009 18:00
>> 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
>> >
>> >
>
>
|
|
| |
Re: Develop reusable Custom Widgets In XWT [message #566259 is a reply to message #504071] |
Thu, 17 December 2009 17:14  |
Eclipse User |
|
|
|
This should work.
<Composite x:Class="ext.custom.DecoratedText"
name="root">
<Label name="myText"/>
<Text text="{Binding elementName=root,path=text}" />
</Composite>
yves
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hgc6jo$s73$1@build.eclipse.org...
> The simple solution is you create a "String text" property in
> DecoratedText. In the setter, you can update the content in your widget
> text or label.
>
> It should be possible to express in XAML. But we need to add a keyword in
> binding expression "self". It is not yet supported in XWT.
>
> The code should be:
> <Composite x:Class="ext.custom.DecoratedText">
> <Label name="myText"/>
> <Text text="{Binding source=self,path=text}" />
> </Composite>
>
> Best regards
> yves
> "Jinshan" <jinshanl@gmail.com> wrote in message
> news:hg9hge$rl5$1@build.eclipse.org...
>> Thanks.
>>
>> Are there some way to bind DecoratedText.java's properties to
>> DecoratedText.xwt.?
>>
>> For example:
>> <c:DecoratedText text="newWidgets" />
>>
>> then
>> <Composite x:Class="ext.custom.DecoratedText">
>> <Label name="myText"/>
>> <Text/>
>> </Composite>
>>
>> "myText" Label is changed automatic and I need not handle "text" changed
>> event. I know the SilverLight is OK.
>>
>>
>>
>>
>>
>> Yves YANG wrote on Tue, 15 December 2009 18:00
>>> 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
>>> >
>>> >
>>
>>
>
>
|
|
|
Re: Develop reusable Custom Widgets In XWT [message #566271 is a reply to message #504262] |
Thu, 17 December 2009 20:28  |
Eclipse User |
|
|
|
<Composite x:Class="ext.custom.DecoratedText"
name="root">
<Label name="myText"/>
<Text text="{Binding elementName=root,path=text}" />
</Composite>
I have checked. This solution works.
yves
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hgeah2$sfm$1@build.eclipse.org...
> This should work.
> <Composite x:Class="ext.custom.DecoratedText"
> name="root">
> <Label name="myText"/>
> <Text text="{Binding elementName=root,path=text}" />
> </Composite>
>
> yves
> "Yves YANG" <yves.yang@soyatec.com> wrote in message
> news:hgc6jo$s73$1@build.eclipse.org...
>> The simple solution is you create a "String text" property in
>> DecoratedText. In the setter, you can update the content in your widget
>> text or label.
>>
>> It should be possible to express in XAML. But we need to add a keyword in
>> binding expression "self". It is not yet supported in XWT.
>>
>> The code should be:
>> <Composite x:Class="ext.custom.DecoratedText">
>> <Label name="myText"/>
>> <Text text="{Binding source=self,path=text}" />
>> </Composite>
>>
>> Best regards
>> yves
>> "Jinshan" <jinshanl@gmail.com> wrote in message
>> news:hg9hge$rl5$1@build.eclipse.org...
>>> Thanks.
>>>
>>> Are there some way to bind DecoratedText.java's properties to
>>> DecoratedText.xwt.?
>>>
>>> For example:
>>> <c:DecoratedText text="newWidgets" />
>>>
>>> then
>>> <Composite x:Class="ext.custom.DecoratedText">
>>> <Label name="myText"/>
>>> <Text/>
>>> </Composite>
>>>
>>> "myText" Label is changed automatic and I need not handle "text" changed
>>> event. I know the SilverLight is OK.
>>>
>>>
>>>
>>>
>>>
>>> Yves YANG wrote on Tue, 15 December 2009 18:00
>>>> 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
>>>> >
>>>> >
>>>
>>>
>>
>>
>
>
|
|
|
Re: Develop reusable Custom Widgets In XWT [message #566299 is a reply to message #504272] |
Fri, 18 December 2009 04:00  |
Eclipse User |
|
|
|
My e4 version is eclipse-e4-SDK-incubation-I20091022-2100-win32. but the fellowing does not work:
Widget:
<Composite xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt" xmlns:c="clr-namespace:allegro.ui.widgets"
xmlns:j="clr-namespace:java.lang" x:Class="allegro.ui.widgets.Image" name="root">
<Composite.layout>
<FillLayout />
</Composite.layout>
<Label name="imageLabel" image="{Binding elementName=root,path=source}" />
</Composite>
Using:
<Composite xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt"
xmlns:c="clr-namespace:allegro.image"
xmlns:j="clr-namespace:java.lang"
xmlns:a="clr-namespace:allegro.ui.widgets"
x:Class="allegro.image.ImageTest">
<Composite.layout>
<GridLayout numColumns="4" />
</Composite.layout>
<a:Image source="logo.gif"/>
</Composite>
Yves YANG wrote on Thu, 17 December 2009 20:28
> <Composite x:Class="ext.custom.DecoratedText"
> name="root">
> <Label name="myText"/>
> <Text text="{Binding elementName=root,path=text}" />
> </Composite>
>
> I have checked. This solution works.
>
> yves
> "Yves YANG" <yves.yang@soyatec.com> wrote in message
> news:hgeah2$sfm$1@build.eclipse.org...
> > This should work.
> > <Composite x:Class="ext.custom.DecoratedText"
> > name="root">
> > <Label name="myText"/>
> > <Text text="{Binding elementName=root,path=text}" />
> > </Composite>
> >
> > yves
> > "Yves YANG" <yves.yang@soyatec.com> wrote in message
> > news:hgc6jo$s73$1@build.eclipse.org...
> >> The simple solution is you create a "String text" property in
> >> DecoratedText. In the setter, you can update the content in your widget
> >> text or label.
> >>
> >> It should be possible to express in XAML. But we need to add a keyword in
> >> binding expression "self". It is not yet supported in XWT.
> >>
> >> The code should be:
> >> <Composite x:Class="ext.custom.DecoratedText">
> >> <Label name="myText"/>
> >> <Text text="{Binding source=self,path=text}" />
> >> </Composite>
> >>
> >> Best regards
> >> yves
> >> "Jinshan" <jinshanl@gmail.com> wrote in message
> >> news:hg9hge$rl5$1@build.eclipse.org...
> >>> Thanks.
> >>>
> >>> Are there some way to bind DecoratedText.java's properties to
> >>> DecoratedText.xwt.?
> >>>
> >>> For example:
> >>> <c:DecoratedText text="newWidgets" />
> >>>
> >>> then
> >>> <Composite x:Class="ext.custom.DecoratedText">
> >>> <Label name="myText"/>
> >>> <Text/>
> >>> </Composite>
> >>>
> >>> "myText" Label is changed automatic and I need not handle "text" changed
> >>> event. I know the SilverLight is OK.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> Yves YANG wrote on Tue, 15 December 2009 18:00
> >>>> 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
> >>>> >
> >>>> >
> >>>
> >>>
> >>
> >>
> >
> >
|
|
|
Re: Develop reusable Custom Widgets In XWT [message #566352 is a reply to message #566299] |
Fri, 18 December 2009 11:58  |
Eclipse User |
|
|
|
The code seems correct. It should work. Please test it with the last build?
Best regards
Yves YANG
"Jinshan" <jinshanl@gmail.com> wrote in message
news:hgfgbu$sjd$1@build.eclipse.org...
> My e4 version is eclipse-e4-SDK-incubation-I20091022-2100-win32. but the
> fellowing does not work:
> Widget:
> <Composite xmlns="http://www.eclipse.org/xwt/presentation"
> xmlns:x="http://www.eclipse.org/xwt"
> xmlns:c="clr-namespace:allegro.ui.widgets"
> xmlns:j="clr-namespace:java.lang" x:Class="allegro.ui.widgets.Image"
> name="root">
>
> <Composite.layout>
> <FillLayout />
> </Composite.layout>
> <Label name="imageLabel" image="{Binding elementName=root,path=source}"
> />
> </Composite>
>
> Using:
> <Composite xmlns="http://www.eclipse.org/xwt/presentation"
> xmlns:x="http://www.eclipse.org/xwt"
> xmlns:c="clr-namespace:allegro.image"
> xmlns:j="clr-namespace:java.lang"
> xmlns:a="clr-namespace:allegro.ui.widgets"
> x:Class="allegro.image.ImageTest">
> <Composite.layout>
> <GridLayout numColumns="4" />
> </Composite.layout>
> <a:Image source="logo.gif"/>
>
> </Composite>
>
>
> Yves YANG wrote on Thu, 17 December 2009 20:28
>> <Composite x:Class="ext.custom.DecoratedText"
>> name="root">
>> <Label name="myText"/>
>> <Text text="{Binding elementName=root,path=text}" />
>> </Composite>
>>
>> I have checked. This solution works.
>>
>> yves
>> "Yves YANG" <yves.yang@soyatec.com> wrote in message
>> news:hgeah2$sfm$1@build.eclipse.org...
>> > This should work.
>> > <Composite x:Class="ext.custom.DecoratedText"
>> > name="root">
>> > <Label name="myText"/>
>> > <Text text="{Binding elementName=root,path=text}" />
>> > </Composite>
>> >
>> > yves
>> > "Yves YANG" <yves.yang@soyatec.com> wrote in message
>> > news:hgc6jo$s73$1@build.eclipse.org...
>> >> The simple solution is you create a "String text" property in
>> >> DecoratedText. In the setter, you can update the content in your
>> >> widget text or label.
>> >>
>> >> It should be possible to express in XAML. But we need to add a keyword
>> >> in binding expression "self". It is not yet supported in XWT.
>> >>
>> >> The code should be:
>> >> <Composite x:Class="ext.custom.DecoratedText">
>> >> <Label name="myText"/>
>> >> <Text text="{Binding source=self,path=text}" />
>> >> </Composite>
>> >>
>> >> Best regards
>> >> yves
>> >> "Jinshan" <jinshanl@gmail.com> wrote in message
>> >> news:hg9hge$rl5$1@build.eclipse.org...
>> >>> Thanks.
>> >>>
>> >>> Are there some way to bind DecoratedText.java's properties to
>> >>> DecoratedText.xwt.?
>> >>>
>> >>> For example:
>> >>> <c:DecoratedText text="newWidgets" />
>> >>>
>> >>> then
>> >>> <Composite x:Class="ext.custom.DecoratedText">
>> >>> <Label name="myText"/>
>> >>> <Text/>
>> >>> </Composite>
>> >>>
>> >>> "myText" Label is changed automatic and I need not handle "text"
>> >>> changed event. I know the SilverLight is OK.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> Yves YANG wrote on Tue, 15 December 2009 18:00
>> >>>> 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
>> >>>> >
>> >>>> >
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>
>
|
|
|
Goto Forum:
Current Time: Tue Jul 08 13:14:45 EDT 2025
Powered by FUDForum. Page generated in 0.06038 seconds
|