Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » XWT + DataBinding +HashMap
XWT + DataBinding +HashMap [message #505065] Sat, 26 December 2009 05:42 Go to next message
Walter Mising name is currently offline Walter Mising nameFriend
Messages: 128
Registered: July 2009
Senior Member
If a HashMap is passed as the DataContext, how can it be declared in XWT
using databinding ?


Thanks
- Walter G. Prabhakar.
Re: XWT + DataBinding +HashMap [message #505067 is a reply to message #505065] Sat, 26 December 2009 07:13 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I solved this through the use of dynamic emf, i.e. map all Map's keys to a dynamic emf object feature and use the emf data binding.
Though, there are many more use cases where a map-like structure could be used as data context, thus, a data provider for those structures would be very handy as well.
Re: XWT + DataBinding +HashMap [message #505081 is a reply to message #505065] Fri, 25 December 2009 23:22 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
Could you give your usecase? I'd like to know what you want to do with a Map
in UI. If you use it as a dynamic object, as said Erdal, you need a specific
data provider. There is an example in our test project under the package
org.eclipse.e4.xwt.tests.databinding.dataprovider.custom.

Best regards
Yves YANG
"Walter Prabhakar" <kwchess@gmail.com> wrote in message
news:hh47nm$7ho$1@build.eclipse.org...
> If a HashMap is passed as the DataContext, how can it be declared in XWT
> using databinding ?
>
>
> Thanks
> - Walter G. Prabhakar.
Re: XWT + DataBinding +HashMap [message #505110 is a reply to message #505081] Sat, 26 December 2009 19:02 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I guess, Walter is referring to the transfer object pattern [1].
A transfer object could be used to request data from a relational database (e.g. sql select) and wrap the result set.

in legacy code:
transferObject.get("user")

in xwt:
{Binding path=user}

I would suggest not to use dynamic emf, since this will add extra overhead to your transfer object (memory and performance?).
Providing a data provider will be the right way, imo.

[1] http://java.sun.com/blueprints/corej2eepatterns/Patterns/Tra nsferObject.html
Re: XWT + DataBinding +HashMap [message #505114 is a reply to message #505110] Sun, 27 December 2009 03:46 Go to previous message
Walter Mising name is currently offline Walter Mising nameFriend
Messages: 128
Registered: July 2009
Senior Member
That is precisely what I would like to achieve.

- Thanks.

"Erdal Karaca" <erdal.karaca.de@googlemail.com> wrote in message
news:hh685f$8st$1@build.eclipse.org...
>I guess, Walter is referring to the transfer object pattern [1].
> A transfer object could be used to request data from a relational database
> (e.g. sql select) and wrap the result set.
>
> in legacy code:
> transferObject.get("user")
>
> in xwt:
> {Binding path=user}
>
> I would suggest not to use dynamic emf, since this will add extra overhead
> to your transfer object (memory and performance?).
> Providing a data provider will be the right way, imo.
>
> [1]
> http://java.sun.com/blueprints/corej2eepatterns/Patterns/Tra nsferObject.html
Re: XWT + DataBinding +HashMap [message #505145 is a reply to message #505114] Sun, 27 December 2009 03:43 Go to previous message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
So, the solution proposed by Erdal is good one.

yves
"Walter Prabhakar" <kwchess@gmail.com> wrote in message
news:hh6lav$qch$1@build.eclipse.org...
> That is precisely what I would like to achieve.
>
> - Thanks.
>
> "Erdal Karaca" <erdal.karaca.de@googlemail.com> wrote in message
> news:hh685f$8st$1@build.eclipse.org...
>>I guess, Walter is referring to the transfer object pattern [1].
>> A transfer object could be used to request data from a relational
>> database (e.g. sql select) and wrap the result set.
>>
>> in legacy code:
>> transferObject.get("user")
>>
>> in xwt:
>> {Binding path=user}
>>
>> I would suggest not to use dynamic emf, since this will add extra
>> overhead to your transfer object (memory and performance?).
>> Providing a data provider will be the right way, imo.
>>
>> [1]
>> http://java.sun.com/blueprints/corej2eepatterns/Patterns/Tra nsferObject.html
>
Re: XWT + DataBinding +HashMap [message #566551 is a reply to message #505065] Sat, 26 December 2009 07:13 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I solved this through the use of dynamic emf, i.e. map all Map's keys to a dynamic emf object feature and use the emf data binding.
Though, there are many more use cases where a map-like structure could be used as data context, thus, a data provider for those structures would be very handy as well.
Re: XWT + DataBinding +HashMap [message #566600 is a reply to message #505065] Fri, 25 December 2009 23:22 Go to previous message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
Could you give your usecase? I'd like to know what you want to do with a Map
in UI. If you use it as a dynamic object, as said Erdal, you need a specific
data provider. There is an example in our test project under the package
org.eclipse.e4.xwt.tests.databinding.dataprovider.custom.

Best regards
Yves YANG
"Walter Prabhakar" <kwchess@gmail.com> wrote in message
news:hh47nm$7ho$1@build.eclipse.org...
> If a HashMap is passed as the DataContext, how can it be declared in XWT
> using databinding ?
>
>
> Thanks
> - Walter G. Prabhakar.
Re: XWT + DataBinding +HashMap [message #566627 is a reply to message #505081] Sat, 26 December 2009 19:02 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I guess, Walter is referring to the transfer object pattern [1].
A transfer object could be used to request data from a relational database (e.g. sql select) and wrap the result set.

in legacy code:
transferObject.get("user")

in xwt:
{Binding path=user}

I would suggest not to use dynamic emf, since this will add extra overhead to your transfer object (memory and performance?).
Providing a data provider will be the right way, imo.

[1] http://java.sun.com/blueprints/corej2eepatterns/Patterns/Tra nsferObject.html
Re: XWT + DataBinding +HashMap [message #566653 is a reply to message #505110] Sun, 27 December 2009 03:46 Go to previous message
Walter Mising name is currently offline Walter Mising nameFriend
Messages: 128
Registered: July 2009
Senior Member
That is precisely what I would like to achieve.

- Thanks.

"Erdal Karaca" <erdal.karaca.de@googlemail.com> wrote in message
news:hh685f$8st$1@build.eclipse.org...
>I guess, Walter is referring to the transfer object pattern [1].
> A transfer object could be used to request data from a relational database
> (e.g. sql select) and wrap the result set.
>
> in legacy code:
> transferObject.get("user")
>
> in xwt:
> {Binding path=user}
>
> I would suggest not to use dynamic emf, since this will add extra overhead
> to your transfer object (memory and performance?).
> Providing a data provider will be the right way, imo.
>
> [1]
> http://java.sun.com/blueprints/corej2eepatterns/Patterns/Tra nsferObject.html
Re: XWT + DataBinding +HashMap [message #566686 is a reply to message #505114] Sun, 27 December 2009 03:43 Go to previous message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
So, the solution proposed by Erdal is good one.

yves
"Walter Prabhakar" <kwchess@gmail.com> wrote in message
news:hh6lav$qch$1@build.eclipse.org...
> That is precisely what I would like to achieve.
>
> - Thanks.
>
> "Erdal Karaca" <erdal.karaca.de@googlemail.com> wrote in message
> news:hh685f$8st$1@build.eclipse.org...
>>I guess, Walter is referring to the transfer object pattern [1].
>> A transfer object could be used to request data from a relational
>> database (e.g. sql select) and wrap the result set.
>>
>> in legacy code:
>> transferObject.get("user")
>>
>> in xwt:
>> {Binding path=user}
>>
>> I would suggest not to use dynamic emf, since this will add extra
>> overhead to your transfer object (memory and performance?).
>> Providing a data provider will be the right way, imo.
>>
>> [1]
>> http://java.sun.com/blueprints/corej2eepatterns/Patterns/Tra nsferObject.html
>
Previous Topic:XWT + DataBinding +HashMap
Next Topic:XWT + TableViewer + Retrieve Table Data
Goto Forum:
  


Current Time: Tue Mar 19 07:42:14 GMT 2024

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

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

Back to the top