Summary: | [CDateTime] Exception if using CDateTime widget in NatTable | ||||||
---|---|---|---|---|---|---|---|
Product: | [Technology] NatTable | Reporter: | Ralf Heydenreich <rheydenr> | ||||
Component: | Nebula Extension | Assignee: | Dirk Fauth <dirk.fauth> | ||||
Status: | CLOSED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | dirk.fauth, dirk.fauth, nebula-inbox | ||||
Version: | 2.0.0 | ||||||
Target Milestone: | 2.0.1 | ||||||
Hardware: | PC | ||||||
OS: | Mac OS X | ||||||
See Also: |
https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/181201 https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/commit/?id=547d30f2e4ac878c270c0a5d0bdab607566173ab |
||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Ralf Heydenreich
2021-05-23 12:21:24 EDT
You should assign this ticket to the Nebula project as it seems to be an issue in CDateTime and not NatTable. Maybe it is already fixed in a current version. Have you tried to use a newer Nebula version locally? I've tried the current Nebula master branch, same effect. If I use the CDateTime widget outside NatTable it works fine. So I assume that it has to do with the org.eclipse.nebula.widgets.nattable.extension.nebula.cdatetime.CDateTimeCellEditor. I've just created an ugly hack to verify my assumption: private long currentTime = System.currentTimeMillis(); @Override public boolean commit(MoveDirectionEnum direction, boolean closeAfterCommit) { if (SWT.getPlatform() == "cocoa") { long myTime = System.currentTimeMillis(); long timeDiff = myTime - this.currentTime; System.err.println(timeDiff); if (timeDiff < 5000) { System.err.println("No Commit!"); return false; } System.err.println("Commit!"); this.currentTime = myTime; } return super.commit(direction, closeAfterCommit); } If I place this code in the CDateTimeCellEditor the NPE only come up once. Hitting the button for the DateTime a second time launches the Calendar widget. So it seems to be any kind of focus error (I assume that the CDateTimeCellEditor lost focus and therefore the close-cascade is triggered). The NatTable framework adds a focus listener to close the editor if it looses the focus. Maybe that listener needs to be adjusted to ignore the event if the button is clicked. Created attachment 286441 [details]
fix for FocusOut bug in MacOS
The attached patch seems to fix the problem. Thanks for the patch. Unfortunately I can't accept patches attached to the ticket. Please follow the contribution guideline and provide a patch via Gerrit so I can review it, a verification build is triggered and the contribution is automatically added to the contribution documents needed for the license stuff. New Gerrit change created: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/181201 Hi Dirk, thanks for applying the patch. I didn't find the time to do it for myself, sorry. Want to give a +1 Gerrit change https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/181201 was merged to [master]. Commit: http://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/commit/?id=547d30f2e4ac878c270c0a5d0bdab607566173ab I have taken your patch and added it manually as you did not respond here. I set you as the author to satisfy the process. Hope that is also fine. Although I am not happy with that setup, as it is much more work for the review. Released with 2.0.1 |