Bug 263511 - [DataBinding] Editable TableViewer Validation Status Provider
Summary: [DataBinding] Editable TableViewer Validation Status Provider
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.1   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-03 13:42 EST by Thomas Kratz CLA
Modified: 2019-09-06 16:14 EDT (History)
1 user (show)

See Also:


Attachments
Demo to show problem (9.88 KB, text/plain)
2009-02-09 13:36 EST, Thomas Kratz CLA
no flags Details
Updated snippet (7.25 KB, patch)
2009-02-10 15:52 EST, Matthew Hall CLA
no flags Details | Diff
Decorating Controls from Observables (7.56 KB, application/octet-stream)
2009-02-28 05:28 EST, Thomas Kratz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kratz CLA 2009-02-03 13:42:19 EST
Around my work with MessageManager/Databinding integration I got the idea to work on a ValidationStatusProvider that validates content of an editable TableViewer. 

The Problem is with EditingSupport that validation happens only when Items are edited, and messages get lost when leaving the cell editor.

So far so good attached is the hack I have so far (I only have IObservaleSets as input) I abuse an totaly abnorm IObservable wrapper for the table to make the messageManager render the decoration on the table. The only way to get this message out to the messagemanager seems to be getModels().

Any ideas on improving this will be appreciated. I thought of decorating a concrete TableItem thats erroneous but MessageManager only decorates Controls. Any ideas on using a decorating label Provider ?

see also bug #219661
Comment 1 Thomas Kratz CLA 2009-02-05 13:08:31 EST
with help from matthew hall it got even easier and more flexible.
Comment 2 Matthew Hall CLA 2009-02-09 00:57:43 EST
Thomas, were you going to post an attachment?
Comment 3 Thomas Kratz CLA 2009-02-09 13:35:01 EST
Matthew, I was straight up to do this when I noticed that it didn't work. I post the demo app instead which demonstrates my problem with  the validator does not get notified when updating the cell. Maybe you can have a look it it, it should work quite straightforward.
Comment 4 Thomas Kratz CLA 2009-02-09 13:36:08 EST
Created attachment 125158 [details]
Demo to show problem
Comment 5 Matthew Hall CLA 2009-02-10 15:52:24 EST
Created attachment 125307 [details]
Updated snippet

Your MultiValidator was working correctly.  It was the code that adds listeners to all validation status providers that did not work.  What you want to use is AggregateValidationStatus.

If this class doesn't do what you want, it would be easier to observe all the validation statuses like this:

IObservableList validationStatuses = BindingProperties.validationStatusProviders()
	.values(BindingProperties.validationStatus()).observe(bindingContext);

This will give you an IObservableList<IStatus>
Comment 6 Matthew Hall CLA 2009-02-10 15:58:17 EST
WORKSFORME.  If I missed anything please reopen.

BindingProperties was only added 4 days ago so you may need to update from CVS to get it.

Comment 7 Thomas Kratz CLA 2009-02-14 03:50:35 EST
Hi Matthew, this is all quite nice (don't clearly see the bug be now), but I need the ValidationStatusProvider to get the targets/models for the stati. I then use MessageManager to decorate the appropriate widgets. If you have any hint how the solve this in another clean way, let me know. I tried the latest code from cvs but it gives me more headache :) see bug #264925
Comment 8 Matthew Hall CLA 2009-02-20 19:52:32 EST
(In reply to comment #7)
> Hi Matthew, this is all quite nice (don't clearly see the bug be now), but I
> need the ValidationStatusProvider to get the targets/models for the stati. I
> then use MessageManager to decorate the appropriate widgets.

Are you talking about ControlDecoration / FieldDecoration ?  Personally I think we should add support for those right into jface.databinding.  I don't know anything about MessageManager so it would help if you could spell out that part a little more.
Comment 9 Thomas Kratz CLA 2009-02-21 02:52:26 EST
MessageManager simple takes a control with its message that then gets decoratet. I inspect the targets/models to find the control thats bound. Thats all.
Comment 10 Matthew Hall CLA 2009-02-25 14:35:33 EST
(In reply to comment #7)
> ..If you have any
> hint how the solve this in another clean way, let me know. I tried the latest
> code from cvs but it gives me more headache :) see bug #264925

Please provide an "unclean" example of how you decorate controls currently so I can see the problem.  Standalone snippets are best.
Comment 11 Matthew Hall CLA 2009-02-25 14:38:58 EST
Clearing target milestone until more information is provided
Comment 12 Thomas Kratz CLA 2009-02-28 05:28:17 EST
Created attachment 127077 [details]
Decorating Controls from Observables
Comment 13 Thomas Kratz CLA 2009-02-28 05:29:08 EST
Hi Matthew, look at the still buggy code I attached. Its in "guessControl" what I actually mean. Should be straightforward.
Comment 14 Matthew Hall CLA 2009-03-08 11:27:52 EDT
Ran out of time for 3.5.
Comment 15 Eclipse Webmaster CLA 2019-09-06 16:14:39 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.