Table Viewer - Selecting F2 on the key board does not put the cell into edit mode [message #668297] |
Wed, 04 May 2011 18:47  |
Eclipse User |
|
|
|
I have defined a table viewer with 80 table viewer columns.
I have defined the cell editing support along with standard cell navigation strategy.
I have defined the ColumnViewerEditorActivationStrategy as follows which specifies to activate column viewer editing when F2 key is pressed as follows :
ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(
v) {
protected boolean isEditorActivationEvent(
ColumnViewerEditorActivationEvent event) {
return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
|| event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION
|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.F2)
|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR)
|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && Character
.isSpaceChar(event.character))
|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode > 31 && event.keyCode < 127)
|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == 16777296)
|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.F2)
|| event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
}
};
TableViewerEditor.create(v, focusCellManager, actSupport,
ColumnViewerEditor.TABBING_HORIZONTAL
| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
| ColumnViewerEditor.TABBING_VERTICAL
| ColumnViewerEditor.KEYBOARD_ACTIVATION);
I have seen lot of examples online which suggest this way of doing things but I am not sure if I am doing something wrong. Please help. Thanks!
|
|
|
|
|
Re: Table Viewer - Selecting F2 on the key board does not put the cell into edit mode [message #668539 is a reply to message #668297] |
Fri, 06 May 2011 03:34   |
Eclipse User |
|
|
|
Tom, Thanks for the response.
Yes you are right. When I added the key listener to the table and then hit F2 key on the key board, the key listener is not getting triggered. But when I hit any other key like PageUp, PageDown, F4, A, B, C, etc., the key listener is getting triggered.
I am using a Win 7 machine. Have you heard this problem before and if so what is your recommendation ?
|
|
|
Re: Table Viewer - Selecting F2 on the key board does not put the cell into edit mode [message #668549 is a reply to message #668539] |
Fri, 06 May 2011 04:06   |
Eclipse User |
|
|
|
Can you try this on a pure SWT-Table as well?
Tom
Am 06.05.11 09:34, schrieb Pavan K Immaneni:
> Tom, Thanks for the response.
>
> Yes you are right. When I added the key listener to the table and then
> hit F2 key on the key board, the key listener is not getting triggered.
> But when I hit any other key like PageUp, PageDown, F4, A, B, C, etc.,
> the key listener is getting triggered.
> I am using a Win 7 machine. Have you heard this problem before and if so
> what is your recommendation ?
>
|
|
|
|
Re: Table Viewer - Selecting F2 on the key board does not put the cell into edit mode [message #729574 is a reply to message #670422] |
Mon, 26 September 2011 10:36   |
Eclipse User |
|
|
|
Sorry to bump this, but I'm having the same issue: the F2 key doesn't seem to be recognized as a key event when pressing it. Adding a KeyListener won't even trigger the keyPressed/keyReleased events at all. Similarly, the ColumnViewerEditorActivationStrategy.isEditorActivationEvent() method won't be called either, if one is set.
Seems like any other key works, but not F2 (tried on three different browsers, Chrome/Firefox/IE9, just in case).
Is this a RAP bug? Or are we missing something?
Thanks,
Jérémy
edit: thought this was posted in the RAP forum. Apparently, this is not related to it specifically. Still, this is pretty annoying!
[Updated on: Mon, 26 September 2011 10:49] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06123 seconds