XWT and JFace UpdateValueStrategies [message #570844] |
Tue, 16 March 2010 17:54 |
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 #570931 is a reply to message #570844] |
Thu, 18 March 2010 00:35 |
Yves YANG Messages: 688 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
|
|
|
Powered by
FUDForum. Page generated in 1.02360 seconds