Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Highlighting specific cells on a paste operation(I have a copy paste functionality which i need to enhance by highlight cells I am not paste upon)
Highlighting specific cells on a paste operation [message #1478125] Tue, 18 November 2014 12:00 Go to next message
Brian Lobo is currently offline Brian LoboFriend
Messages: 8
Registered: September 2014
Junior Member
Hi

I have a copy paste functionality in place where the rows that are selected are copied and then pasted to the selected target cells . But some cells have to be skipped during this paste operation and have to be highlighed , How do I hightligh those cells . I tried adding a label to the necessary cells before called setDataValue (for pasting values on the targetted selected cells) , but looks like the label is lost during rendering and hence I dont see the effect . Is there a solution where I can highlight specific cells only during this paste operation which is triggered by selected cells , right clicking a menu for paste

Thanks in advance

Brian lobo
Re: Highlighting specific cells on a paste operation [message #1478138 is a reply to message #1478125] Tue, 18 November 2014 12:17 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
The label stack is created and build up from the bottom on rendering. So adding a label afterwards does not work. So if I understand you correctly you need to find a way to temporarily remember where you want to highlight something because of a condition or state. If your state is only available in a specific time slot (your paste) and is gone when the table is rerendered I have no idea how it should work.

I'm not sure if I understand your requirement correctly and I'm not sure if NatTable is that flexible that it rerenders stuff solely on actions, although it supports rerendering of specific cells, rows and columns.
Re: Highlighting specific cells on a paste operation [message #1479003 is a reply to message #1478138] Wed, 19 November 2014 04:49 Go to previous messageGo to next message
Brian Lobo is currently offline Brian LoboFriend
Messages: 8
Registered: September 2014
Junior Member
Actually the state is not for a time slot , Moreover when I paste I will have the cells be highlighted and it will remain unless I enter a value on that cell , Its moreover an indicator that the paste has not don't its job and the user has to enter values manually. Do you think this kind of functionality is possible ?
Re: Highlighting specific cells on a paste operation [message #1479020 is a reply to message #1479003] Wed, 19 November 2014 05:10 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Yes, in that case you need a way to keep that state somehow, so you can add a label dependent to that state. Maybe some additional map somewhere like a dirty map for position key and boolean value.
Re: Highlighting specific cells on a paste operation [message #1479328 is a reply to message #1479020] Wed, 19 November 2014 10:50 Go to previous messageGo to next message
Brian Lobo is currently offline Brian LoboFriend
Messages: 8
Registered: September 2014
Junior Member
Actually getting out of state and removing the label is not a problem for me as In the createbodylayer I could just check the value of the cell and if its not blank I would remove its set label and make it behave normal. My challange is when I do a paste operation which I get done with setDataValue , how can I set the label . because setting a label during setdataValue doesnt seem to be the solution as you rightly mentioned about the label being reloaded , So how do I apply the label so that once the other cells are pasted I am able to apply a label on the specific cell I need to.
Re: Highlighting specific cells on a paste operation [message #1479363 is a reply to message #1479328] Wed, 19 November 2014 11:20 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
how can I set the label


I might repeat myself, but you can only add a label using an accumulator that can add the label in the default way when the label stack is requested. Or implement a custom layer that adds the label. But the label stack is build from bottom to top. Adding the labels at some places out of the default mechanism won't work.
Re: Highlighting specific cells on a paste operation [message #1479487 is a reply to message #1479363] Wed, 19 November 2014 13:17 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Maybe the following blog post helps to understand what I mean: http://blog.vogella.com/2013/03/02/crossweak-validation-in-nattable-by-dirk-fauth/
Previous Topic:Custom FILTER_COMPARATOR not called
Next Topic:Is ctrl+c and ctrl+v supprted on the nattabel cells
Goto Forum:
  


Current Time: Thu Mar 28 20:11:56 GMT 2024

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

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

Back to the top