Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » XWT and JFace UpdateValueStrategies
XWT and JFace UpdateValueStrategies [message #570844] Tue, 16 March 2010 17:54 Go to next message
St Clair Clarke is currently offline St Clair Clarke
Messages: 118
Registered: March 2010
Senior Member
Congrats on e4M4 release and your nomination for best eclipse project.

I have some questions:

JFace, has the concept of an UpdateValueStrategy that can be applied when creating any binding. This class contains several of the components of the binding, including the validation routine, the conversion routine, as well as the actual strategy for performing the update.

One of the mandatory arguments when you create an UpdateValueStrategy is an integer representing the update 'policy'. There are four possible policies in JFace:

POLICY_UPDATE - This means update as soon as the change occurs on the 'source' side.

POLICYONREQUEST - This means, update on request.

POLICY_CONVERT - This is just like POLICY_ON_REQUEST

POLICY_ON_REQUEST but also automatically runs the new value through the validation and conversion routines, so you can immediately provide user feedback as they type. It still requires you manually request the final binding however. This is the most likely candidate in real world use.

POLICY_NEVER - This allows you to create a uni-directional binding, where one side will never update the other.

Currently XWT supports, One Way binding, One Time binding and Two Way binding. What mechanism exist to cancel a binding or to bind on
demand as the POLICY_CONVERT, or POLICYONREQUEST in JFace.

I am asking because of the following scenario. I have a Wizard. At the end of the Wizard I can choose to cancel or finish. It is at this moment that I would like to actually bind with my model or if I hand bind with them before, I would like to have the option to update the model or target. Currently XWT does not seem to offer me this. If it
does let me know.

PS: I love the Property editor in e4M4: :d

St Clair
Re: XWT and JFace UpdateValueStrategies [message #570899 is a reply to message #570844] Tue, 16 March 2010 21:37 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 555
Registered: July 2009
Senior Member
St Clair Clarke wrote on Tue, 16 March 2010 20:54
> Congrats on e4M4 release and your nomination for best eclipse project.
>
> PS: I love the Property editor in e4M4: :d


Because its "Data Binding" tab uses icons from WindowBuilder Pro?
Or because "Layout" and "Layout Data" tabs (at least for GridLayout) are 100% cloned from "Layout Assistant" of WindowBuilder Pro? :)

I don't work with data binding, but data bindings dialogs in E4 also look very much like what I saw on screen of my colleague who works on them in WBP.

--
Konstantin Scheglov,
Instantiations, Inc.


Konstantin Scheglov,
Google, Inc.
Re: XWT and JFace UpdateValueStrategies [message #570931 is a reply to message #570844] Thu, 18 March 2010 00:35 Go to previous message
Yves YANG is currently offline Yves YANG
Messages: 687
Registered: July 2009
Senior Member
Hi St Clair,

"St Clair Clarke" <st_clair@flowja.com> wrote in message
news:hnoglh$gg3$1@build.eclipse.org...
> Congrats on e4M4 release and your nomination for best eclipse project.
>
> I have some questions:
>
> JFace, has the concept of an UpdateValueStrategy that can be applied when
> creating any binding. This class contains several of the components of the
> binding, including the validation routine, the conversion routine, as well
> as the actual strategy for performing the update.
>
> One of the mandatory arguments when you create an UpdateValueStrategy is
> an integer representing the update 'policy'. There are four possible
> policies in JFace:
>
> POLICY_UPDATE - This means update as soon as the change occurs on the
> 'source' side.
> POLICYONREQUEST - This means, update on request.
> POLICY_CONVERT - This is just like POLICY_ON_REQUEST
>
> POLICY_ON_REQUEST but also automatically runs the new value through the
> validation and conversion routines, so you can immediately provide user
> feedback as they type. It still requires you manually request the final
> binding however. This is the most likely candidate in real world use.
> POLICY_NEVER - This allows you to create a uni-directional binding, where
> one side will never update the other.
> Currently XWT supports, One Way binding, One Time binding and Two Way
> binding. What mechanism exist to cancel a binding or to bind on
> demand as the POLICY_CONVERT, or POLICYONREQUEST in JFace.

Yes, XWT supports most useful policy. For others, please fill a feature
request in a bug report.

>
> I am asking because of the following scenario. I have a Wizard. At the end
> of the Wizard I can choose to cancel or finish. It is at this moment that
> I would like to actually bind with my model or if I hand bind with them
> before, I would like to have the option to update the model or target.
> Currently XWT does not seem to offer me this. If it does let me know.

By now, XWT doesn't support this policy. I'm not sure the data binding is a
good solution for this case. I don't believe we can disconnect the UI with
model behind. For example, if we have a list, we need to create/remove an
element. Probably, the concept of transaction edition is better: all
modifications can be valided in whole or nothing.

Best regards
Yves YANG
>
> PS: I love the Property editor in e4M4: :d
> St Clair
Previous Topic:XWT and JFace UpdateValueStrategies
Next Topic:DataProvider examples in CVS
Goto Forum:
  


Current Time: Wed Oct 22 01:46:21 GMT 2014

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

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