Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Paste Data
Paste Data [message #1058629] Tue, 14 May 2013 15:04 Go to next message
David Hein is currently offline David HeinFriend
Messages: 3
Registered: May 2013
Junior Member
Hi,

I want to implement a copy / paste mechanism for the NatTable.
For copy I use the default org.eclipse.nebula.widgets.nattable.copy.action.CopyDataAction. Works fine.

Is there a possibility to use a default paste action which calls the setValue(int columnIndex, int rowIndex, Object newValue) method of the IRowDataProvider?

At the moment I have registered a KeyBinding (CTRL+v) in the UIBindingregistry and manage the paste manually. Is there a better / easier way to do this?

Thank you!
Re: Paste Data [message #1058797 is a reply to message #1058629] Wed, 15 May 2013 07:31 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
Currently there is no default paste mechanism in NatTable. This is because pasting is related to editing and therefore special to the use cases.

Of course we could think about a default implementation in NatTable. But without looking at it in much more detail it would look like what you implemented, with additional checks for editable state, conversion and validation safety. It would also need to take care of the sructure of the selected and copied cells. And of course it wouldn't be configured by default then.

For now, no there is no default implementation I would know.
Re: Paste Data [message #1058816 is a reply to message #1058797] Wed, 15 May 2013 08:52 Go to previous messageGo to next message
David Hein is currently offline David HeinFriend
Messages: 3
Registered: May 2013
Junior Member
Hi,

thank you for your answer. Lets see what the future brings.
Re: Paste Data [message #1781918 is a reply to message #1058816] Wed, 14 February 2018 15:54 Go to previous messageGo to next message
Maksim Shchekotov is currently offline Maksim ShchekotovFriend
Messages: 4
Registered: April 2016
Junior Member
Hi! Sorry if it is a silly question, but I looked at FormulaDataExample and I don't understand why NatTable doesn't execute PasteDataCommand in case when I select a cell and it becomes editable, and then I press Ctrl+V?

How can I process CTRL+V pressing if I'm trying to paste something to an editable cell?
Re: Paste Data [message #1781931 is a reply to message #1781918] Wed, 14 February 2018 17:07 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
Because in that case the SWT copy paste mechanism is applied. In an editable field you are in a Text component and not NatTable when looking into the details.
Re: Paste Data [message #1781990 is a reply to message #1781931] Thu, 15 February 2018 14:31 Go to previous message
Maksim Shchekotov is currently offline Maksim ShchekotovFriend
Messages: 4
Registered: April 2016
Junior Member
Thank you, Dirk, for the answer. I solved my problem by using an appropriate cell editor.

I had to copy several cells from Excel to the filter row. I made this using custom FilterRowTextCellEditor implementation as an extension of MultiLineTextCellEditor. Not sure than it is the perfect way but maybe it would be helpful for somebody.
Previous Topic:how can get the hidden cell
Next Topic:Is it possible to put filter dropdown with column header ?
Goto Forum:
  


Current Time: Tue Sep 25 06:56:59 GMT 2018

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

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

Back to the top