Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Conditional CellEditor activation based on EditAction
Conditional CellEditor activation based on EditAction [message #1741425] Thu, 25 August 2016 04:09 Go to next message
Tobias Mehre is currently offline Tobias MehreFriend
Messages: 5
Registered: August 2016
Junior Member
Hello,

we would like to be able to choose the celleditor (dialog or inline) based on the EditAction (KeyEditAction, MouseEditAction) that triggers the cell edit mode At the moment we use NatTable 1.3.1.

Example
- if you tab into a cell and the cell is editable and hit "10" the TextCellEditor should be activated initialized with "10"
- if you tab into a cell and hit F2 the DialogCellEditor should be opened

As far is i know the information which action triggers the edit mode is lost as soon as the CellEditor is retrieved from config registry. So i could not find any straight forward solution yet. The only solution i can image at this point is to replace the EventHandler but this seems to be too much

I would appreciate any idea. Thanks in advance.

Re: Conditional CellEditor activation based on EditAction [message #1741509 is a reply to message #1741425] Thu, 25 August 2016 14:41 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
Hm, I guess I would create and register an alternative IKeyAction that extends KeyEditAction as UI binding for the F2 key press (see DefaultEditBindings).

In that customized KeyEditAction I would first set Boolean value true for the EditConfigAttributes.OPEN_IN_DIALOG. Then call the super implementation of KeyEditAction. And at the end set the value back to false or null.

Not sure if that works, but I would try that.
Re: Conditional CellEditor activation based on EditAction [message #1741525 is a reply to message #1741509] Thu, 25 August 2016 15:37 Go to previous messageGo to next message
Tobias Mehre is currently offline Tobias MehreFriend
Messages: 5
Registered: August 2016
Junior Member
Hey Dirk,

thank you very much for the hint. i will have a look at it this evening.
Re: Conditional CellEditor activation based on EditAction [message #1741582 is a reply to message #1741525] Fri, 26 August 2016 05:48 Go to previous message
Tobias Mehre is currently offline Tobias MehreFriend
Messages: 5
Registered: August 2016
Junior Member
Hey Dirk,

You definitely hit the mark. Using a custom KeyEditAction implementation and changing the EditConfigAttributes.OPEN_IN_DIALOG attribute value temporarily is the way to go. Thank you very much!
Previous Topic:Find Text while setting the Scope to Selection, Removing Application Modal
Next Topic:Editor registered for a Spanned cell should invoke original column editor
Goto Forum:
  


Current Time: Mon Sep 24 22:54:27 GMT 2018

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

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

Back to the top