Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Active cell editor issue
Active cell editor issue [message #948684] Thu, 18 October 2012 09:08 Go to next message
Muaz Ahmad is currently offline Muaz AhmadFriend
Messages: 7
Registered: October 2012
Junior Member
Hi,

I have a dialog containing a nattable in it. In this dialog, nattable has a cell editor which opens up a new dialog which also contains a nattable. When i close the second dialog, second nattable get dispose off and in the result the controls of the cell editor(present in first nattable) also get dispose of.

By some debugging i found out that there is a class "ActiveCellEditor" which tracks the current active editor, but the problem is that it uses the static reference and does not cater the multiple nattables, so when a nattable dispose of, the static reference of cell editor also dispose of due to the following code in "NatTable.java",

addDisposeListener(new DisposeListener() {

public void widgetDisposed(DisposeEvent e) {
doCommand(new DisposeResourcesCommand());
conflaterChain.stop();
InlineCellEditController.dispose();
ActiveCellEditor.close();

layer.dispose();
}

});

The code which causing this is in bold font.
Re: Active cell editor issue [message #948853 is a reply to message #948684] Thu, 18 October 2012 12:50 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi,

indeed, this is an issue in the current NatTable architecture. Please file a bug on this, so we can look at this when evolving the NatTable.

For the moment I'm sorry that I have to tell you that I don't have a solution for your special case. The static reference to the current open active cell editor seem to doesn't allow what you are trying to achieve.

Greez,
Dirk
Re: Active cell editor issue [message #948857 is a reply to message #948853] Thu, 18 October 2012 12:56 Go to previous messageGo to next message
Muaz Ahmad is currently offline Muaz AhmadFriend
Messages: 7
Registered: October 2012
Junior Member
Thanks Dirk for quick reply. I will file a bug against it. Hopefully it gets fixed in next release.

Regards,
Muaz
Re: Active cell editor issue [message #1005879 is a reply to message #948857] Tue, 29 January 2013 08:07 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi,

I did a major refactoring of the edit behaviour, but unfortunately I didn't get rid of the static reference to the current active editor. To solve this we would need to create some kind of instance context which would be that easy to implement with the current architecture. But I removed the ActiveCellEditor and introduced a ActiveCellEditorRegistry. This one only holds the reference to the current active editor without convenience methods to operate on it. Together with that I moved the code that opens/closes an editor to the correct position in the editor itself. So maybe you are able to workaround the issue by doing operations on the ActiveCellEditorRegistry on opening and closing your custom editor, like e.g. on closing the editor in the NatTable of your custom editor, you put the editor itself back to the registry so the calling NatTable knows the correct reference.

Of course this is still a workaround for the issue. We will hopefully be able to solve it with a new architecture we are working on.

Please also note that with the edit refactoring I also introduced an enhanced ICellEditor interface and the possibility to create dialog only editors. This will definitely cause you to change your code. Hopefully making it easier for you to implement a custom editor.

Greez,
Dirk
Previous Topic:Does anyone has an example for Date Picker in NatTable?
Next Topic:Excel Export fires NullPointerException if file dialog is cancelled
Goto Forum:
  


Current Time: Tue Apr 23 06:07:45 GMT 2024

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

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

Back to the top