Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Develop reusable Custom Widgets In XWT
Develop reusable Custom Widgets In XWT [message #566042] Tue, 15 December 2009 11:10 Go to next message
Jinshan  is currently offline Jinshan Friend
Messages: 24
Registered: December 2009
Junior Member
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 #566064 is a reply to message #566042] Tue, 15 December 2009 20:06 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
> 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 #566107 is a reply to message #566064] Tue, 15 December 2009 23:00 Go to previous message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
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
>
>
Previous Topic:[xwt] Dynamic EMF data context not recognized
Next Topic:Application.xmi + Intro / Welcome Page
Goto Forum:
  


Current Time: Tue Aug 04 06:56:41 GMT 2020

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

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

Back to the top