Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Strange celleditor behavior on Mac
Strange celleditor behavior on Mac [message #1774389] Fri, 13 October 2017 15:18 Go to next message
Bakjwis Bakjwis is currently offline Bakjwis BakjwisFriend
Messages: 3
Registered: September 2015
Junior Member
Hello.

I'm making a program based on NatTable example _447_EditorExample.java.
(NatTable Examples Application>Tutorial Examples>Configuration>Editing>EditorExample)

When I moved selection by keyboard and enter new data, a cell editor opens and the first key input is selected(see attached nattable.png) and overwritten by next key input.

I added next code, but not works.

TextCellEditor textCellEditor = new TextCellEditor(true, true);
textCellEditor.setSelectionMode(EditorSelectionEnum.END);
			
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITOR,
textCellEditor, DisplayMode.NORMAL, 
EDITOR_LABEL);


This only happens on macOS.
On Windows, the key input that opens cell editor is not selected.

I tried adding clear the selection code to TextCellEditor's key adapter,
it works with alphanumeric code input, but not works with international code input.

Thanks.

  • Attachment: nattable.png
    (Size: 285.74KB, Downloaded 141 times)

[Updated on: Sun, 15 October 2017 07:12]

Report message to a moderator

Re: Strange celleditor behavior on Mac [message #1774477 is a reply to message #1774389] Mon, 16 October 2017 08:17 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
NatTable is using a SWT Text control for editing. So if it works on Windows but not on Mac I suppose there is an issue with SWT on Mac regarding the Text control and selection. EditorSelectionEnum.END is by the way the default, so I would expect that your code modified code does not change anything. Maybe there is an issue with Text#setSelection() on Mac.

As I don't have a Mac, I can't tell anything more. You could try to create an example that only uses a SWT Text control, and if you see that the issue is there, open a ticket for SWT.
Re: Strange celleditor behavior on Mac [message #1774500 is a reply to message #1774477] Mon, 16 October 2017 14:10 Go to previous message
Bakjwis Bakjwis is currently offline Bakjwis BakjwisFriend
Messages: 3
Registered: September 2015
Junior Member
Thank you for your advice.
After googling, i found It's a already known cocoa programming problem.
https://stackoverflow.com/questions/28649382/deselecting-text-in-nstextfield

I'll use space key to edit on Mac.
Thanks.
Previous Topic:checkbox column double-click event
Next Topic:Select row instead of cell in a Tree NatTable
Goto Forum:
  


Current Time: Fri Mar 29 13:48:54 GMT 2024

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

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

Back to the top