Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [DataBindings] validation in inline editing
[DataBindings] validation in inline editing [message #334929] Tue, 10 March 2009 16:00 Go to next message
david leloup is currently offline david leloupFriend
Messages: 36
Registered: July 2009
Member
hi,

i've got a tableViewer with inline editing.
i would like to add a validator (maybe a global one) to the data entered in
cells
but i don't have any idea of how to do it

i've tried with a multiValidator , but the validate() methods never get
called.

i've also looked at the databinding snippet but with no luck

can someone point me in the right direction

thanks in advance

david
Re: [DataBindings] validation in inline editing [message #334930 is a reply to message #334929] Tue, 10 March 2009 16:07 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
david wrote:
> i've got a tableViewer with inline editing.
> i would like to add a validator (maybe a global one) to the data
> entered in cells
> but i don't have any idea of how to do it

Are you using ObservableValueEditingSupport? You can override the
createBinding() method to customize the converter / validators.

> i've tried with a multiValidator , but the validate() methods never get
> called.

MultiValidator.validate() method should be called any time one of your
observable dependencies change. Did you remember to call
DataBindingContext.addValidationStatusProvider(MultiValidato r)? Please
post a snippet with your MultiValidator code and we'll try to troubleshoot.

Matthew
Re: [DataBindings] validation in inline editing [message #334931 is a reply to message #334930] Tue, 10 March 2009 16:36 Go to previous messageGo to next message
david leloup is currently offline david leloupFriend
Messages: 36
Registered: July 2009
Member
Ce message est compos
Re: [DataBindings] validation in inline editing [message #334939 is a reply to message #334931] Tue, 10 March 2009 18:58 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Here is your problem:

final WritableList wlLignes = new WritableList(SWTObservables
.getRealm(peopleViewer.getTable().getDisplay()), viewModel
.getPeople(), Person.class);

....

MultiValidator ligneValidator = new MultiValidator(SWTObservables
.getRealm(peopleViewer.getTable().getDisplay())) {
protected IStatus validate() {
IStatus status = ValidationStatus.ok();
for (Iterator it = wlLignes.iterator(); it.hasNext();) {
Person person = (Person) it.next();
if (person.name == "") // << this
status = ValidationStatus.error("nom obligatoire");
}
return status;
}
};

The observable that you are accessing in MultiValidator is wlLignes, and
so the validator is only revalidated when this observable changes state.
However this list is observing the Person objects, not their
respective "name" properties which is what you are really interested in.
This list does not fire a change event when properties of the objects
change, just when the objects themselves are added, moved, replaced or
removed. What you want to observe instead is the "name" property over
each element in the master list:

// Observe the names of each person directly.
final IObservableList personNames =
BeanProperties.value(Person.class, "name").observeDetail(wlLignes);

MultiValidator ligneValidator = new MultiValidator(SWTObservables
.getRealm(peopleViewer.getTable().getDisplay())) {
protected IStatus validate() {
IStatus status = ValidationStatus.ok();
for (Iterator it = personNames.iterator(); it.hasNext();) {
String name = (String) it.next();
if (name == null || name.length() == 0)
status = ValidationStatus.error("nom obligatoire");
}
return status;
}
};

Also I want to point out one error in your code:

if (person.name == "")
status = ValidationStatus.error("nom obligatoire");

== compares by identity. You should be using equals() here since you
are interested in equality, not object identity.

Also, there is a method BeanProperties.values() that you can use to
shorten this:

ViewerSupport.bind(peopleViewer, wlLignes, new IValueProperty[] {
BeanProperties.value(Person.class, "name"),
BeanProperties.value(Person.class, "city"),
BeanProperties.value(Person.class, "age"),
BeanProperties.value(Person.class, "prix") });

to this:

ViewerSupport.bind(peopleViewer, wlLignes, BeanProperties.values(
Person.class, new String[] { "name", "city", "age", "prix" }));

Hope this helps,

Matthew

david wrote:
> thanks Matthew
>
> i call the addValidationProvider.
>
> do i have to call the validate() method myself ???
>
> i've posted a snippet (based on the snippet013)
>
>
>
> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le message de
> groupe de discussion : gp6388$u7t$1@build.eclipse.org...
>> david wrote:
>>> i've got a tableViewer with inline editing.
>>> i would like to add a validator (maybe a global one) to the data
>>> entered in cells
>>> but i don't have any idea of how to do it
>>
>> Are you using ObservableValueEditingSupport? You can override the
>> createBinding() method to customize the converter / validators.
>>
>>> i've tried with a multiValidator , but the validate() methods never
>>> get called.
>>
>> MultiValidator.validate() method should be called any time one of your
>> observable dependencies change. Did you remember to call
>> DataBindingContext.addValidationStatusProvider(MultiValidato r)?
>> Please post a snippet with your MultiValidator code and we'll try to
>> troubleshoot.
>>
>> Matthew
Re: [DataBindings] validation in inline editing [message #334944 is a reply to message #334939] Wed, 11 March 2009 07:59 Go to previous messageGo to next message
david leloup is currently offline david leloupFriend
Messages: 36
Registered: July 2009
Member
Hi Matthew,

thanks for all this informations.
i've made the modifications in my snippet
and the validate() method still not called
(and the label error bound to status is still "OK" when i empty a name cell
in the table)

thanks

David


"Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le message de
groupe de discussion : gp6d84$n5e$1@build.eclipse.org...
> Here is your problem:
>
> final WritableList wlLignes = new WritableList(SWTObservables
> .getRealm(peopleViewer.getTable().getDisplay()), viewModel
> .getPeople(), Person.class);
>
> ...
>
> MultiValidator ligneValidator = new MultiValidator(SWTObservables
> .getRealm(peopleViewer.getTable().getDisplay())) {
> protected IStatus validate() {
> IStatus status = ValidationStatus.ok();
> for (Iterator it = wlLignes.iterator(); it.hasNext();) {
> Person person = (Person) it.next();
> if (person.name == "") // << this
> status = ValidationStatus.error("nom obligatoire");
> }
> return status;
> }
> };
>
> The observable that you are accessing in MultiValidator is wlLignes, and
> so the validator is only revalidated when this observable changes state.
> However this list is observing the Person objects, not their respective
> "name" properties which is what you are really interested in. This list
> does not fire a change event when properties of the objects change, just
> when the objects themselves are added, moved, replaced or removed. What
> you want to observe instead is the "name" property over each element in
> the master list:
>
> // Observe the names of each person directly.
> final IObservableList personNames =
> BeanProperties.value(Person.class, "name").observeDetail(wlLignes);
>
> MultiValidator ligneValidator = new MultiValidator(SWTObservables
> .getRealm(peopleViewer.getTable().getDisplay())) {
> protected IStatus validate() {
> IStatus status = ValidationStatus.ok();
> for (Iterator it = personNames.iterator(); it.hasNext();) {
> String name = (String) it.next();
> if (name == null || name.length() == 0)
> status = ValidationStatus.error("nom obligatoire");
> }
> return status;
> }
> };
>
> Also I want to point out one error in your code:
>
> if (person.name == "")
> status = ValidationStatus.error("nom obligatoire");
>
> == compares by identity. You should be using equals() here since you are
> interested in equality, not object identity.
>
> Also, there is a method BeanProperties.values() that you can use to
> shorten this:
>
> ViewerSupport.bind(peopleViewer, wlLignes, new IValueProperty[] {
> BeanProperties.value(Person.class, "name"),
> BeanProperties.value(Person.class, "city"),
> BeanProperties.value(Person.class, "age"),
> BeanProperties.value(Person.class, "prix") });
>
> to this:
>
> ViewerSupport.bind(peopleViewer, wlLignes, BeanProperties.values(
> Person.class, new String[] { "name", "city", "age", "prix" }));
>
> Hope this helps,
>
> Matthew
>
> david wrote:
>> thanks Matthew
>> i call the addValidationProvider.
>> do i have to call the validate() method myself ???
>> i've posted a snippet (based on the snippet013)
>> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le
>> message de groupe de discussion : gp6388$u7t$1@build.eclipse.org...
>>> david wrote:
>>>> i've got a tableViewer with inline editing.
>>>> i would like to add a validator (maybe a global one) to
>>>> the data entered in cells
>>>> but i don't have any idea of how to do it
>>>
>>> Are you using ObservableValueEditingSupport? You can override
>>> the createBinding() method to customize the converter /
>>> validators.
>>>
>>>> i've tried with a multiValidator , but the validate() methods
>>>> never get called.
>>>
>>> MultiValidator.validate() method should be called any time one
>>> of your observable dependencies change. Did you remember to
>>> call DataBindingContext.addValidationStatusProvider(MultiValidato r)?
>>> Please post a snippet with your MultiValidator code and we'll
>>> try to troubleshoot.
>>>
>>> Matthew
Re: [DataBindings] validation in inline editing [message #334964 is a reply to message #334944] Thu, 12 March 2009 14:50 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
David,

Please post your revised snippet and I'll take a look.

Matthew

david wrote:
> Hi Matthew,
>
> thanks for all this informations.
> i've made the modifications in my snippet
> and the validate() method still not called
> (and the label error bound to status is still "OK" when i empty a name
> cell in the table)
>
> thanks
>
> David
>
>
> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le message de
> groupe de discussion : gp6d84$n5e$1@build.eclipse.org...
>> Here is your problem:
>>
>> final WritableList wlLignes = new WritableList(SWTObservables
>> .getRealm(peopleViewer.getTable().getDisplay()), viewModel
>> .getPeople(), Person.class);
>>
>> ...
>>
>> MultiValidator ligneValidator = new MultiValidator(SWTObservables
>> .getRealm(peopleViewer.getTable().getDisplay())) {
>> protected IStatus validate() {
>> IStatus status = ValidationStatus.ok();
>> for (Iterator it = wlLignes.iterator(); it.hasNext();) {
>> Person person = (Person) it.next();
>> if (person.name == "") // << this
>> status = ValidationStatus.error("nom obligatoire");
>> }
>> return status;
>> }
>> };
>>
>> The observable that you are accessing in MultiValidator is wlLignes,
>> and so the validator is only revalidated when this observable changes
>> state. However this list is observing the Person objects, not their
>> respective "name" properties which is what you are really interested
>> in. This list does not fire a change event when properties of the
>> objects change, just when the objects themselves are added, moved,
>> replaced or removed. What you want to observe instead is the "name"
>> property over each element in the master list:
>>
>> // Observe the names of each person directly.
>> final IObservableList personNames =
>> BeanProperties.value(Person.class, "name").observeDetail(wlLignes);
>>
>> MultiValidator ligneValidator = new MultiValidator(SWTObservables
>> .getRealm(peopleViewer.getTable().getDisplay())) {
>> protected IStatus validate() {
>> IStatus status = ValidationStatus.ok();
>> for (Iterator it = personNames.iterator(); it.hasNext();) {
>> String name = (String) it.next();
>> if (name == null || name.length() == 0)
>> status = ValidationStatus.error("nom obligatoire");
>> }
>> return status;
>> }
>> };
>>
>> Also I want to point out one error in your code:
>>
>> if (person.name == "")
>> status = ValidationStatus.error("nom obligatoire");
>>
>> == compares by identity. You should be using equals() here since you
>> are interested in equality, not object identity.
>>
>> Also, there is a method BeanProperties.values() that you can use to
>> shorten this:
>>
>> ViewerSupport.bind(peopleViewer, wlLignes, new IValueProperty[] {
>> BeanProperties.value(Person.class, "name"),
>> BeanProperties.value(Person.class, "city"),
>> BeanProperties.value(Person.class, "age"),
>> BeanProperties.value(Person.class, "prix") });
>>
>> to this:
>>
>> ViewerSupport.bind(peopleViewer, wlLignes, BeanProperties.values(
>> Person.class, new String[] { "name", "city", "age", "prix" }));
>>
>> Hope this helps,
>>
>> Matthew
>>
>> david wrote:
>>> thanks Matthew
>>> i call the addValidationProvider.
>>> do i have to call the validate() method myself ???
>>> i've posted a snippet (based on the snippet013)
>>> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le
>>> message de groupe de discussion :
>>> gp6388$u7t$1@build.eclipse.org...
>>>> david wrote:
>>>>> i've got a tableViewer with inline editing.
>>>>> i would like to add a validator (maybe a global one)
>>>>> to the data entered in cells
>>>>> but i don't have any idea of how to do it
>>>>
>>>> Are you using ObservableValueEditingSupport? You can
>>>> override the createBinding() method to customize the
>>>> converter / validators.
>>>>
>>>>> i've tried with a multiValidator , but the validate()
>>>>> methods never get called.
>>>>
>>>> MultiValidator.validate() method should be called any time
>>>> one of your observable dependencies change. Did you
>>>> remember to call
>>>> DataBindingContext.addValidationStatusProvider(MultiValidato r)?
>>>> Please post a snippet with your MultiValidator code and
>>>> we'll try to troubleshoot.
>>>>
>>>> Matthew
>
Re: [DataBindings] validation in inline editing [message #334965 is a reply to message #334964] Thu, 12 March 2009 15:10 Go to previous messageGo to next message
david leloup is currently offline david leloupFriend
Messages: 36
Registered: July 2009
Member
Ce message est compos
Re: [DataBindings] validation in inline editing [message #334966 is a reply to message #334965] Thu, 12 March 2009 15:20 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Your aggregate validation status is observing
bindingContext.getBindings(), but MultiValidator is a
ValidationStatusProvider, not a binding. Use
getValidationStatusProviders() instead.

bindingContext
.bindValue(SWTObservables.observeText(error),
new AggregateValidationStatus(bindingContext
.getValidationStatusProviders(),
AggregateValidationStatus.MAX_SEVERITY),
null, null);

Note that Binding extends ValidationStatusProvider so this collection
includes all bindings as well.

Matthew

david wrote:
> hi Matthew
>
> here it is
>
> David
>
>
> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le message de
> groupe de discussion : gpb7eq$t3t$1@build.eclipse.org...
>> David,
>>
>> Please post your revised snippet and I'll take a look.
>>
>> Matthew
>>
>> david wrote:
>>> Hi Matthew,
>>>
>>> thanks for all this informations.
>>> i've made the modifications in my snippet
>>> and the validate() method still not called
>>> (and the label error bound to status is still "OK" when i empty a
>>> name cell in the table)
>>>
>>> thanks
>>>
>>> David
>>>
>>>
>>> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le message
>>> de groupe de discussion : gp6d84$n5e$1@build.eclipse.org...
>>>> Here is your problem:
>>>>
>>>> final WritableList wlLignes = new WritableList(SWTObservables
>>>> .getRealm(peopleViewer.getTable().getDisplay()), viewModel
>>>> .getPeople(), Person.class);
>>>>
>>>> ...
>>>>
>>>> MultiValidator ligneValidator = new MultiValidator(SWTObservables
>>>> .getRealm(peopleViewer.getTable().getDisplay())) {
>>>> protected IStatus validate() {
>>>> IStatus status = ValidationStatus.ok();
>>>> for (Iterator it = wlLignes.iterator(); it.hasNext();) {
>>>> Person person = (Person) it.next();
>>>> if (person.name == "") // << this
>>>> status = ValidationStatus.error("nom obligatoire");
>>>> }
>>>> return status;
>>>> }
>>>> };
>>>>
>>>> The observable that you are accessing in MultiValidator is wlLignes,
>>>> and so the validator is only revalidated when this observable
>>>> changes state. However this list is observing the Person objects,
>>>> not their respective "name" properties which is what you are really
>>>> interested in. This list does not fire a change event when
>>>> properties of the objects change, just when the objects themselves
>>>> are added, moved, replaced or removed. What you want to observe
>>>> instead is the "name" property over each element in the master list:
>>>>
>>>> // Observe the names of each person directly.
>>>> final IObservableList personNames =
>>>> BeanProperties.value(Person.class, "name").observeDetail(wlLignes);
>>>>
>>>> MultiValidator ligneValidator = new MultiValidator(SWTObservables
>>>> .getRealm(peopleViewer.getTable().getDisplay())) {
>>>> protected IStatus validate() {
>>>> IStatus status = ValidationStatus.ok();
>>>> for (Iterator it = personNames.iterator(); it.hasNext();) {
>>>> String name = (String) it.next();
>>>> if (name == null || name.length() == 0)
>>>> status = ValidationStatus.error("nom obligatoire");
>>>> }
>>>> return status;
>>>> }
>>>> };
>>>>
>>>> Also I want to point out one error in your code:
>>>>
>>>> if (person.name == "")
>>>> status = ValidationStatus.error("nom obligatoire");
>>>>
>>>> == compares by identity. You should be using equals() here since
>>>> you are interested in equality, not object identity.
>>>>
>>>> Also, there is a method BeanProperties.values() that you can use to
>>>> shorten this:
>>>>
>>>> ViewerSupport.bind(peopleViewer, wlLignes, new IValueProperty[] {
>>>> BeanProperties.value(Person.class, "name"),
>>>> BeanProperties.value(Person.class, "city"),
>>>> BeanProperties.value(Person.class, "age"),
>>>> BeanProperties.value(Person.class, "prix") });
>>>>
>>>> to this:
>>>>
>>>> ViewerSupport.bind(peopleViewer, wlLignes, BeanProperties.values(
>>>> Person.class, new String[] { "name", "city", "age", "prix" }));
>>>>
>>>> Hope this helps,
>>>>
>>>> Matthew
>>>>
>>>> david wrote:
>>>>> thanks Matthew
>>>>> i call the addValidationProvider.
>>>>> do i have to call the validate() method myself ???
>>>>> i've posted a snippet (based on the snippet013)
>>>>> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le
>>>>> message de groupe de discussion :
>>>>> gp6388$u7t$1@build.eclipse.org...
>>>>>> david wrote:
>>>>>>> i've got a tableViewer with inline editing.
>>>>>>> i would like to add a validator (maybe a global
>>>>>>> one) to the data entered in cells
>>>>>>> but i don't have any idea of how to do it
>>>>>>
>>>>>> Are you using ObservableValueEditingSupport? You can
>>>>>> override the createBinding() method to customize the
>>>>>> converter / validators.
>>>>>>
>>>>>>> i've tried with a multiValidator , but the validate()
>>>>>>> methods never get called.
>>>>>>
>>>>>> MultiValidator.validate() method should be called any time
>>>>>> one of your observable dependencies change. Did you
>>>>>> remember to call
>>>>>> DataBindingContext.addValidationStatusProvider(MultiValidato r)?
>>>>>> Please post a snippet with your MultiValidator code and
>>>>>> we'll try to troubleshoot.
>>>>>>
>>>>>> Matthew
>>>
Re: [DataBindings] validation in inline editing [message #334967 is a reply to message #334966] Thu, 12 March 2009 15:26 Go to previous message
david leloup is currently offline david leloupFriend
Messages: 36
Registered: July 2009
Member
thanks for your help, Matthew
it works

but it's sometimes hard to navigate through all these classes in databinding

have a good day

david


"Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le message de
groupe de discussion : gpb98f$d1j$1@build.eclipse.org...
> Your aggregate validation status is observing
> bindingContext.getBindings(), but MultiValidator is a
> ValidationStatusProvider, not a binding. Use
> getValidationStatusProviders() instead.
>
> bindingContext
> .bindValue(SWTObservables.observeText(error),
> new AggregateValidationStatus(bindingContext
> .getValidationStatusProviders(),
> AggregateValidationStatus.MAX_SEVERITY),
> null, null);
>
> Note that Binding extends ValidationStatusProvider so this collection
> includes all bindings as well.
>
> Matthew
>
> david wrote:
>> hi Matthew
>>
>> here it is
>>
>> David
>>
>>
>> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le message de
>> groupe de discussion : gpb7eq$t3t$1@build.eclipse.org...
>>> David,
>>>
>>> Please post your revised snippet and I'll take a look.
>>>
>>> Matthew
>>>
>>> david wrote:
>>>> Hi Matthew,
>>>>
>>>> thanks for all this informations.
>>>> i've made the modifications in my snippet
>>>> and the validate() method still not called
>>>> (and the label error bound to status is still "OK" when i empty a name
>>>> cell in the table)
>>>>
>>>> thanks
>>>>
>>>> David
>>>>
>>>>
>>>> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le message de
>>>> groupe de discussion : gp6d84$n5e$1@build.eclipse.org...
>>>>> Here is your problem:
>>>>>
>>>>> final WritableList wlLignes = new WritableList(SWTObservables
>>>>> .getRealm(peopleViewer.getTable().getDisplay()), viewModel
>>>>> .getPeople(), Person.class);
>>>>>
>>>>> ...
>>>>>
>>>>> MultiValidator ligneValidator = new MultiValidator(SWTObservables
>>>>> .getRealm(peopleViewer.getTable().getDisplay())) {
>>>>> protected IStatus validate() {
>>>>> IStatus status = ValidationStatus.ok();
>>>>> for (Iterator it = wlLignes.iterator(); it.hasNext();) {
>>>>> Person person = (Person) it.next();
>>>>> if (person.name == "") // << this
>>>>> status = ValidationStatus.error("nom obligatoire");
>>>>> }
>>>>> return status;
>>>>> }
>>>>> };
>>>>>
>>>>> The observable that you are accessing in MultiValidator is wlLignes,
>>>>> and so the validator is only revalidated when this observable changes
>>>>> state. However this list is observing the Person objects, not their
>>>>> respective "name" properties which is what you are really interested
>>>>> in. This list does not fire a change event when properties of the
>>>>> objects change, just when the objects themselves are added, moved,
>>>>> replaced or removed. What you want to observe instead is the "name"
>>>>> property over each element in the master list:
>>>>>
>>>>> // Observe the names of each person directly.
>>>>> final IObservableList personNames =
>>>>> BeanProperties.value(Person.class,
>>>>> "name").observeDetail(wlLignes);
>>>>>
>>>>> MultiValidator ligneValidator = new MultiValidator(SWTObservables
>>>>> .getRealm(peopleViewer.getTable().getDisplay())) {
>>>>> protected IStatus validate() {
>>>>> IStatus status = ValidationStatus.ok();
>>>>> for (Iterator it = personNames.iterator(); it.hasNext();) {
>>>>> String name = (String) it.next();
>>>>> if (name == null || name.length() == 0)
>>>>> status = ValidationStatus.error("nom obligatoire");
>>>>> }
>>>>> return status;
>>>>> }
>>>>> };
>>>>>
>>>>> Also I want to point out one error in your code:
>>>>>
>>>>> if (person.name == "")
>>>>> status = ValidationStatus.error("nom obligatoire");
>>>>>
>>>>> == compares by identity. You should be using equals() here since you
>>>>> are interested in equality, not object identity.
>>>>>
>>>>> Also, there is a method BeanProperties.values() that you can use to
>>>>> shorten this:
>>>>>
>>>>> ViewerSupport.bind(peopleViewer, wlLignes, new IValueProperty[] {
>>>>> BeanProperties.value(Person.class, "name"),
>>>>> BeanProperties.value(Person.class, "city"),
>>>>> BeanProperties.value(Person.class, "age"),
>>>>> BeanProperties.value(Person.class, "prix") });
>>>>>
>>>>> to this:
>>>>>
>>>>> ViewerSupport.bind(peopleViewer, wlLignes, BeanProperties.values(
>>>>> Person.class, new String[] { "name", "city", "age", "prix" }));
>>>>>
>>>>> Hope this helps,
>>>>>
>>>>> Matthew
>>>>>
>>>>> david wrote:
>>>>>> thanks Matthew
>>>>>> i call the addValidationProvider.
>>>>>> do i have to call the validate() method myself ???
>>>>>> i've posted a snippet (based on the snippet013)
>>>>>> "Matthew Hall" <matthall@woodcraftmill.com> a écrit dans le
>>>>>> message de groupe de discussion :
>>>>>> gp6388$u7t$1@build.eclipse.org...
>>>>>>> david wrote:
>>>>>>>> i've got a tableViewer with inline editing.
>>>>>>>> i would like to add a validator (maybe a global one)
>>>>>>>> to the data entered in cells
>>>>>>>> but i don't have any idea of how to do it
>>>>>>>
>>>>>>> Are you using ObservableValueEditingSupport? You can
>>>>>>> override the createBinding() method to customize the converter
>>>>>>> / validators.
>>>>>>>
>>>>>>>> i've tried with a multiValidator , but the validate()
>>>>>>>> methods never get called.
>>>>>>>
>>>>>>> MultiValidator.validate() method should be called any time
>>>>>>> one of your observable dependencies change. Did you
>>>>>>> remember to call
>>>>>>> DataBindingContext.addValidationStatusProvider(MultiValidato r)?
>>>>>>> Please post a snippet with your MultiValidator code and
>>>>>>> we'll try to troubleshoot.
>>>>>>>
>>>>>>> Matthew
>>>>
Previous Topic:TabbedPropertySheetPage reorganization
Next Topic:How add "Show In" navigation to a view?
Goto Forum:
  


Current Time: Sat Nov 29 01:40:14 GMT 2014

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

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