Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » hidden rows copied during copy/paste
hidden rows copied during copy/paste [message #1692344] Wed, 15 April 2015 08:36 Go to next message
Bob Wheeler is currently offline Bob WheelerFriend
Messages: 2
Registered: April 2015
Junior Member
I have a tree table. I don't use glazed lists. I implemented my own IDataProvider/ITreeRowModel class. My problem is that copy/pasting from my tree also copies hidden rows. For example. Let's say my tree looks like:

+A
B
C
+D
E
F

And I collapse it to

-A
-D

There are three different copy/paste behaviors:

1) If I "select all" and paste into Excel, I get A, B, C, D, E, F.

2) If I select by clicking on A and dragging to D and paste into Excel, I get A, B, C, and D (but not E and F). Even though B and C are not visible.

3) If I select A and then add to the selection by selecting D, I just get A and D.

The second one is my problem. In my opinion, I should only get visible data when I copy/paste. But is this considered a bug or a feature? And is there any work around to make nattable only copy/paste visible data? Thanks!
Re: hidden rows copied during copy/paste [message #1692444 is a reply to message #1692344] Wed, 15 April 2015 17:39 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2624
Registered: July 2012
Senior Member
Hi,

first, if you want to ask a question regarding NatTable, please use the NatTable forum. And if you really like to ask the question on the Nebula forum, add the name of the control you ask about. Otherwise it is hard to know which control the question is related to. Nebula has some more controls that deal with rows and columns than only NatTable.

To your question:
The "problem" you are seeing is related to performing a drag selection. That means you are triggering a selection of a region instead of selecting single cells/rows. Since the TreeLayer sits on top of the SelectionLayer and the collapsed rows are hidden in the TreeLayer, the SelectionLayer doesn't know that they are hidden. Therefore they are also added to the selection (as they are visible for the SelectionLayer).

You shouldn't see that issue when using GlazedLists, because there the collapsed rows are hidden in the list itself and not via layer.

If you consider this a bug or a feature is up to you.

One workaround I can think of is to register an ILayerEventHandler for selection events to the TreeLayer that updates the selection on the SelectionLayer according to the hidden/collapsed rows. That means you manually remove the selected cells of the current selection for rows that are hidden in the TreeLayer.

Another workaround could be to create and register a custom CopyDataCommandHandler to the TreeLayer that knows both, the SelectionLayer and the TreeLayer. And on collecting the data that should be put to the clipboard it doesn't add the values of hidden rows.

Hope that helps,
Dirk
Re: hidden rows copied during copy/paste [message #1692490 is a reply to message #1692444] Thu, 16 April 2015 09:00 Go to previous message
Bob Wheeler is currently offline Bob WheelerFriend
Messages: 2
Registered: April 2015
Junior Member
Thanks for the reply. I think I can work with that. And sorry for posting in the wrong forum.
Previous Topic:CDateTime Databinding
Next Topic:XViewer Filter
Goto Forum:
  


Current Time: Fri Nov 16 06:24:58 GMT 2018

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

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

Back to the top