Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Cell editor issue
icon9.gif  Cell editor issue [message #1203042] Fri, 22 November 2013 12:52 Go to next message
Heiß Michael is currently offline Heiß MichaelFriend
Messages: 6
Registered: June 2012
Junior Member
Hi,

I am currently trying to create a custom cell editor that is based on the NatTable as editor control. I read the comments in the bug-report (https://bugs.eclipse.org/bugs/show_bug.cgi?id=392535) and i wanted to know if there is any progress on that?

My current solution for this bug is that i use a custom EditCellCommandHandler which simply re-sets the active cell editor so that the table does not know that there is one. But this has certain drawbacks as i need to worry about closing the editor if the user clicks somewhere.

Why is the editor not stored as an instance variable inside of the table? Every call agains the static helper EditUtils.commitAndCloseActiveEditor() has either access to the natTable itself or has an event that holds the nat table. This would be a quick fix and would not require any major refactoring as stated in the bug report.

I am thinking about patching the NatTable so i do not need all those workarounds ...

Regards,
Michael
Re: Cell editor issue [message #1203065 is a reply to message #1203042] Fri, 22 November 2013 13:07 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
and i wanted to know if there is any progress on that?


No there is no progress on that. I didn't found the time to dig deeper into this.

Quote:
Why is the editor not stored as an instance variable inside of the table?


Because the EditController nor the EditCellCommandHandler know about the NatTable instance on which the command was called.

Quote:
Every call agains the static helper EditUtils.commitAndCloseActiveEditor() has either access to the natTable itself or has an event that holds the nat table.


After a quick check, it seems you are right. Although I'm not quite sure about the ScrollBarHandlerTemplate.

Quote:
I am thinking about patching the NatTable so i do not need all those workarounds


Your welcome to do that! Every help on that would be great. We are a open source project and we accept contributions. Just ensure that you do not break anything else.
Re: Cell editor issue [message #1207969 is a reply to message #1203065] Sun, 24 November 2013 21:41 Go to previous messageGo to next message
Heiß Michael is currently offline Heiß MichaelFriend
Messages: 6
Registered: June 2012
Junior Member
Hi,

I am done with my changes Smile Everything works as expected and I could get rid of those static references to the cell editor. The only remaining "problem" is that I do not know which repository you are using for external contributions.

PS: Thanks for the great tutorial how to setup the workspace. Using that I could get started in a few minutes Smile

Regards,
Michael

Re: Cell editor issue [message #1208674 is a reply to message #1207969] Mon, 25 November 2013 06:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi,

Cool news. There is no repository for external contributions. You just need to attach a patch containing your modifications to the ticket. And you need to follow the Eclipse development process, so the patch needs to be signed, you need to hace the CLA signed,...

For the future weneed to setup Gerrit Smile

Curious to check your modifications.

Greez,
Dirk
Re: Cell editor issue [message #1209354 is a reply to message #1208674] Mon, 25 November 2013 13:19 Go to previous messageGo to next message
Heiß Michael is currently offline Heiß MichaelFriend
Messages: 6
Registered: June 2012
Junior Member
Just for consistency. I provided a patch and attached it to the bug. Thanks for reviewing Smile
Gerrit would be cool, makes the life as contributor a little bit easier.

Regards,
Michael
Re: Cell editor issue [message #1209386 is a reply to message #1209354] Mon, 25 November 2013 13:40 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
Gerrit would be cool, makes the life as contributor a little bit easier.


I agree, just need to check what I need to do to enable Gerrit for NatTable.

I did a quick check by viewing the patch, and the first impression is positive. I will apply the patch and perform various tests the next days. There are so much corner cases that are difficult to deal with.

The solution for ScrollBarHandlerTemplate is really ugly, but not sure if there is another way. I will see if there is another option for that.

Thanks for the contribution so far, I will get back after the checks are finished.

Re: Cell editor issue [message #1212416 is a reply to message #1209386] Tue, 26 November 2013 22:22 Go to previous messageGo to next message
Michael Heiss is currently offline Michael HeissFriend
Messages: 20
Registered: November 2013
Location: Graz, Austria
Junior Member
I found one problem in the patch that I proposed. The CellEditorCreatedEvent#convertToLocal should always return true. I honestly don't know why the instance of check is in. Will update the patch tomorrow.

Regarding the ScrollBarHandlerTemplate: What if I introduce another LayerEvent (CellEditorCloseEvent) that can be fired by any layer if an active editor should be closed. The table itself could listen to the event and close the editor. Doing that we would avoid that each layer needs to have a direct reference of the table.
Re: Cell editor issue [message #1213371 is a reply to message #1212416] Wed, 27 November 2013 07:58 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
What if I introduce another LayerEvent (CellEditorCloseEvent) that can be fired by any layer if an active editor should be closed


I thought of that too, but I guess it will create race conditions to fail, as if the editor can not be closed, actions should not apply. Like, don't scroll if the editor is invalid and can't be closed, as otherwise the open editor will stay while the rest of the table scrolls.

So no, this is not an option as far as I see.
Previous Topic:programmatically resize column
Next Topic:Unable to perform selection when row is added or removed from event list
Goto Forum:
  


Current Time: Tue Apr 16 05:34:41 GMT 2024

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

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

Back to the top