Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Full row validation
Full row validation [message #1066942] Fri, 05 July 2013 08:23 Go to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Hello,

Sorry for asking so much questions, but I just started using the control.

I have a requirement for which I need to make full row validation. The NatTable is displaying information about properties. Each property has a name, a type and a default value.
The default value has to be validated against its type. This could be solved using what is described in this article: http://blog.vogella.com/2013/03/02/crossweak-validation-in-nattable-by-dirk-fauth/

However, the name has to be validated also: names have to be unique. So, the validation of the row has to also happen when it is not edited (I add a new property and change its name to an existing name, then both properties should be in error).

The ideal case for me to show those errors would be to display an error decoration next to the row in error. When you hover over it, the error message is displayed.
I supposed this is difficult or impossible to do right now. Another option would then be to color the row in red (this can be done like described in the article) but also provide a tooltip when the user hover over the row (whichever cell).

Is this possible ?

Thank you,
Cédric
Re: Full row validation [message #1066969 is a reply to message #1066942] Fri, 05 July 2013 09:35 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
I supposed this is difficult or impossible to do right now


Why that? You could use a ControlDecoration as explained in the documentation. You could create a custom IOverlayPainter. About rendering there is nothing impossible in NatTable!
Re: Full row validation [message #1066997 is a reply to message #1066969] Fri, 05 July 2013 11:33 Go to previous messageGo to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Quote:
You could use a ControlDecoration as explained in the documentation


I was thinking about that but the ControlDecoration requires a control to decorate. As far as I saw, the control is only available when the cell is being edited (at that time, a SWT control is create to allow editing).
Will I be able to have a control decoration even if a cell is not being edited ?

[Updated on: Fri, 05 July 2013 11:35]

Report message to a moderator

Re: Full row validation [message #1067010 is a reply to message #1066997] Fri, 05 July 2013 12:18 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Good question. Yes I think when the editor is closed the control decoration vanishes.

In this case you possibly need an IOverlayPainter. This is not yet documented, but we are working on it. Try to have a look at the interface. It needs to be registered against the NatTable and renders on top of the NatTable.
Re: Full row validation [message #1067261 is a reply to message #1067010] Mon, 08 July 2013 07:12 Go to previous messageGo to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
I could do that, the part for drawing the image at the correct location should be ok. But I have no clue how I can hook in a tooltip with that image (again, tooltips are usually associated with controls, no with something that you draw directly on the canvas).

Any idea how I could solve this ?

Thanks for the support so far Razz
Cédric
Re: Full row validation [message #1067319 is a reply to message #1067261] Mon, 08 July 2013 09:54 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hook it on the table and determine the tooltip to show dependent on what you paint.
Previous Topic:Table with no row header
Next Topic:NatTable Examples - 1.0.1
Goto Forum:
  


Current Time: Tue Apr 16 17:48:47 GMT 2024

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

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

Back to the top