Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Problem with my Custom Editors with Nattable 1.0.1
Problem with my Custom Editors with Nattable 1.0.1 [message #1067881] Thu, 11 July 2013 01:19 Go to next message
SD Khan is currently offline SD Khan
Messages: 63
Registered: May 2013
Member
Hi,

I have implemented my own custom editors using these classes of nattable "ICellEditor interface", the "AbstractCellEditor" and the "AbstractDialogCellEditor",

Now it was working fine with Nattable0.9.0, As i updated the code to Nattable1.0.0, it got break, there were some compile time issue because of new methods are introduced in ICellEditor, and arguments of existing methods are changed in other classes, but i solved them, now i can run the code successfully, but with some editors i am getting abnormal behavior like one particular case is i have a class which is implementing ICellEditor interface, as new methods are introduced , and i have provide implementation of some of them but i am getting runtime exceptions.

So i am concerned about, is there any doc or notes through which i can get idea about the new changed architecture of editors api in nattabe1.0.1 (I have already seen bugzilla tickets on that).

Thanks,
SD Khan
Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1067918 is a reply to message #1067881] Thu, 11 July 2013 05:00 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1066
Registered: July 2012
Senior Member
The first question is, why are you implementing the interface rather than extending the abstract implementations? Is it really necessary?

No there is currently no architecture document or any other documentation on how to implement a custom editor. That is work in progress. But the javadoc of the classes should give you some hints what the methods are intended to do.
Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1067929 is a reply to message #1067918] Thu, 11 July 2013 06:01 Go to previous messageGo to next message
SD Khan is currently offline SD Khan
Messages: 63
Registered: May 2013
Member
okay, it seems to be possible to avoid implementing "ICellEditor" directly and use any other abstract class, i try that...

Thanks,
SD Khan
Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1069674 is a reply to message #1067929] Tue, 16 July 2013 07:13 Go to previous messageGo to next message
SD Khan is currently offline SD Khan
Messages: 63
Registered: May 2013
Member
Hi,

I have created an editor dialog which is directly extended from "AbstractDialogCellEditor", it's work fine but not going in the inline mode, i have overridden openInline() function and return true in that , but still not working,

What i want is to get the cell in the inline mode on the single click ? instead of opening the dialog directly,

Thanks,
SD khan


Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1069703 is a reply to message #1069674] Tue, 16 July 2013 08:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1066
Registered: July 2012
Senior Member
Why should an editor dialog be opened inline? If you want an editor to be opened inline, you need to extend AbstractCellEditor. If you want an editor dialog you need to extend AbstractDialogCellEditor. You can tell inline editors to be opened in a dialog, but you can not tell a dialog to open inline. That wouldn't make sense.
Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1069722 is a reply to message #1069703] Tue, 16 July 2013 08:57 Go to previous messageGo to next message
SD Khan is currently offline SD Khan
Messages: 63
Registered: May 2013
Member
Actually, previously i have extended my own AbstractEditorDialog which was extended directly from the "TextCellEditor", i have attached button on the cell, to open editor and get in the inline mode on single click, now after the update, it's not getting in the inline mode and dialog gets open on the single click.

Previous:- MyEditor->MyDialogCellEditor->TextCellEditor
(Text cell editor is from the nattable core)

now i think i should do this:-
Currently:- MyEditor->MyDialogCellEditor->AbstractCellEditor


Creating "MyDialogCellEditor" will provide the button facility to open the dialog while "MyEditor" will be any editor dialog, so in order to get inline on single click and editor dialog on the button click on cell, any one will simply extend from "MyEditorDialog",

Is this right?, please correct me or suggest if there is something better.

Note:- just for info, i have created an editor which is directly extended from AbstractCellEditor, like MyEditorDialog->AbstractCellEditor, now "MyEditorDialog", contains these both features i.e inline and singleclick, but now looking for this one
"MyEditor->MyDialogCellEditor->AbstractCellEditor" to have more flexibility.


Thanks,
Safdar Khan
Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1069727 is a reply to message #1069722] Tue, 16 July 2013 09:05 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1066
Registered: July 2012
Senior Member
Sorry, I don't understand what you want to do.

To have an inline editor you need to extend AbstractCellEditor. If you want to have controls like buttons in it, that is something completely different. If you want to open your editor that extends AbstractCellEditor in a dialog you need to either set the configuration for OPEN_INLINE or override openInline().
Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1069819 is a reply to message #1069727] Tue, 16 July 2013 12:26 Go to previous messageGo to next message
SD Khan is currently offline SD Khan
Messages: 63
Registered: May 2013
Member
Okay, thanks! , I got it now.

Regards,
Safdar Khan
Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1072602 is a reply to message #1069819] Tue, 23 July 2013 02:15 Go to previous messageGo to next message
SD Khan is currently offline SD Khan
Messages: 63
Registered: May 2013
Member
Hi!

Almost all of my problems with editors are solved as i have migrated from Nattable0.9.0 to Nattable1.0.1, But still there is an issue,


Actually, i am opening different editors for different cells of a single column, like this:-
configReg.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new AdvanceFilterTableCellEditor(filterTableBuilder, parentTable), DisplayMode.NORMAL, AdvanceFilterTableModel.OPERATOR_COLUMN_NAME);  


Now this class "AdvanceFilterTableCellEditor" is implementing "ICellEditor" and when its "activateCell(...)" is called it returns the respective editor at runtime depending upon that particular cell.

It was working fine previously but now it's getting problems like editor open in the wrong direction , getting wrong edit control in the newly introduced "EditController".


So, now i have editors which are working fine when i use them for all the cells of single column, now i am trying to assign different editors on different cells of the single column for which i have written a wrapper class implementing ICellEditor and return different editors at run time, but as described facing problems,

so, can you please comment on this, may be i am using it wrongly or provide any suggestion to make it work with this changed editor api.


Thanks,
Safdar Khan

Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1072628 is a reply to message #1072602] Tue, 23 July 2013 03:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1066
Registered: July 2012
Senior Member
Quote:
now it's getting problems like editor open in the wrong direction , getting wrong edit control in the newly introduced "EditController".


What do you mean with that? open in the wrong direction?

And the EditController was there before as far as I remember. If it now gets the wrong edit control, maybe there is something wrong with your implementation.

Do you use the ActiveCellEditor singleton anywhere? It was removed and replaced with some singleton that has less logic. But still it might cause issues.
Re: Problem with my Custom Editors with Nattable 1.0.1 [message #1072656 is a reply to message #1072628] Tue, 23 July 2013 04:15 Go to previous message
SD Khan is currently offline SD Khan
Messages: 63
Registered: May 2013
Member
Hi!

yup, i have investigated the problem and found that editor control was not getting passed properly, i corrected that and stopped using "ActiveCellEditor" directly and provided proper implementation of the new methods introduced in "ICellEditor" , now it started working fine Surprised and everything has been fixed,

So, it seems no problem in the newly changed editor api except some new enhancements which i have adopted and everything is fine now.

Thank you for your help Smile

Regards,
Safdar Khan
Previous Topic:[ColumnReorderEvent] Possible inconsistent behavior
Next Topic:Problems with ColumnGroupHeaderLayer in a Grid
Goto Forum:
  


Current Time: Mon Apr 21 08:44:05 EDT 2014

Powered by FUDForum. Page generated in 0.02689 seconds