Bug 164598 - [CellEditors] Can not navigate tables (cells) using keyboard
Summary: [CellEditors] Can not navigate tables (cells) using keyboard
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2006-11-15 03:54 EST by manivannan_pk CLA
Modified: 2007-05-09 15:03 EDT (History)
6 users (show)

See Also:


Attachments
A ZIP file containing a project that adds a 'New Wizard' showing the issue (32.23 KB, application/x-zip-compressed)
2006-12-14 16:11 EST, Eric Moffatt CLA
no flags Details
A KeyListener workaround that does not work (32.69 KB, application/zip file)
2006-12-17 14:16 EST, manivannan_pk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description manivannan_pk CLA 2006-11-15 03:54:36 EST
I can not navigate a table (in a wizard), select its cells, activate cell-editors using the keyboard. Is this a known issue? Is there any key combination to do this? If not, what is the work-around?
Comment 1 Thomas Schindl CLA 2006-11-15 04:05:49 EST
yes see bug #151295 I think this could be closed as duplicate of this bug if you agree
Comment 2 Thomas Schindl CLA 2006-11-15 04:10:26 EST
the only work around coming to my mind is to register a key listener and mouse listener on the table, to track of the currently selected cell and activating CellEditor using table.editElement(Object,int) on certain key combinations.
Comment 3 manivannan_pk CLA 2006-11-15 06:25:41 EST
(In reply to comment #1)
> yes see bug #151295 I think this could be closed as duplicate of this bug if
> you agree

I am not sure; the bug #151295 only talks about activating cell-editors but not about selecting cells. I have the same question about the work-around you have suggested. If the user can't even select a parcitular cell he/she wants  to edit what do we achieve by attaching a key-listener ? Please clarify.
Comment 4 Thomas Schindl CLA 2006-11-15 06:48:23 EST
1.
Indeed it doesn't talk explicity about navigation but that's implied by the fact that when we want to support activation by key board we must track cell-selection using the keyboard where from should be else know from which cell-editor to activate.

2.
MouseListener:
- selection cells and activating CellEditor

KeyBoardListener:
- navigating table/tree using e.g. arrow keys (remembering currently selected 
  cell)
- activating appropriate cell-editor


Another thing which works and I think someone I supported on newsgroups did that is the use of a TableCursor.

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.java

3.
For further discussion I'd say lets use the platform.rcp-newsgroup and not bugzilla.
Comment 5 Thomas Schindl CLA 2006-11-15 06:50:44 EST
by the way bug #151377 talks about cell-selection interface which might provide the foundation for your request one day or another.
Comment 6 Eric Moffatt CLA 2006-12-14 11:13:51 EST
Carolyn, 

Karice said that this is a known issue and that there's a (albeit non-intuitive) way to get this to work (in 3.2). It's essentially about keyboard navigating inside a TreeViewer with columns. Does this ring any bells??

Thanks
Comment 7 Eric Moffatt CLA 2006-12-14 16:11:33 EST
Created attachment 55705 [details]
A ZIP file containing a project that adds a 'New Wizard' showing the issue
Comment 8 Eric Moffatt CLA 2006-12-14 16:23:33 EST
To test, unpack the ZIP somewhere, fire up eclipse and Import Existing Project (opinting to where you unzipped).

Fire up an inner (debug) session and do 'File->Import->Other->TestImportWizard'
You should see a page containing a Table.
Comment 9 Eric Moffatt CLA 2006-12-14 16:28:59 EST
BTW, ZIP'd code uses "TableViewer", -not- "TreeViewer" as I had previously said.
Comment 10 Carolyn MacLeod CLA 2006-12-14 16:41:43 EST
Regarding comment 6 - sorry, Eric, no bells are ringing.

Cells cannot be selected in native Tables or native Trees with columns, using
either the mouse or the keyboard. TableViewer and TreeViewer would need to
implement this functionality themselves.

I do not know if they maybe already implement some way to navigate cells as part of the cell editing code. To determine that, you'll have to grok through TableViewer and TreeViewer.
Comment 11 Karice McIntyre CLA 2006-12-15 16:06:10 EST
Don't forget to add the accessibility keyword for accessibility bugs.  
Comment 12 manivannan_pk CLA 2006-12-17 14:16:38 EST
Created attachment 55837 [details]
A KeyListener workaround that does not work


As a workaround, I am trying to use a KeyListener to capture left-arrow and right-arrow keystrokes and activate one of two cell-editors (depending on the key); I call TableViewer.editElement(element, column) method to activate the cell-editors. But this method does not seem to work. Can someone take a look at my code and tell me what is wrong?

Please see the attached plugin project TestImportWizard (as zip file) with the description "A KeyListener workaround that does not work" - the class TablePage in particular. It defines an inner class called TableKeyListener in which the keyReleased() method calls TableViewer.editElement().

Thanks in advance,
mani
Comment 13 Carolyn MacLeod CLA 2006-12-18 08:45:41 EST
The left and right arrow keys are used for keyboard traversal. Try adding a TraverseListener instead of a KeyListener. A sample snippet that uses a TraverseListener is here:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet241.java
Comment 14 Steve Northover CLA 2006-12-18 11:20:59 EST
If you are using TableCursor, then move this bug over to SWT and give it to Carolyn.  Thanks!
Comment 15 Mike Wilson CLA 2006-12-18 11:25:22 EST
Eric, please find out if we're doing the right thing and update the bug. We should investigate fixing this for 3.2.2.
Comment 16 manivannan_pk CLA 2006-12-18 15:43:58 EST
(In reply to comment #13)
> The left and right arrow keys are used for keyboard traversal. Try adding a
> TraverseListener instead of a KeyListener.
My problem is in using the TableViewer.editElement() to activate the cell-editors; not in capturing key-strokes. The editElement() somehow does not work for me. Please look at the source file TablePage.java (the method TablePage.TableKeyListener.keyReleased()) and see if you can find out what is wrong.


Comment 17 Eric Moffatt CLA 2006-12-19 10:00:56 EST
OK, After going to a variety of folks here seeing if this is a known issue and, more importantly, is there a known solution. It turns out that the existing behaviour has always been there so adding it in 3.2.x would constitute a new feature (one that is already under development for 3.3) and we don't usually add features into point releases.

It is, however, possible to roll your own. The best example I can find is the JDT's 'Refactor -> Change Method Signature' which brings up a dialog that allows kepboard navigation and editing. You should be able to get some useful information about how to handle the navigation issues (see the JDT "ChangeParametersControl.createParameterList" for specifics...

Let me know how it goes
Comment 18 Eric Moffatt CLA 2006-12-21 14:53:34 EST
I've been told the suggested path is to use the SWT 'TableCursor' to handle this, not the 'hand-rolled' version that the JDT is using (they wrote theirs before the TableCursor came into existence...
Comment 19 manivannan_pk CLA 2006-12-21 14:55:40 EST
(In reply to comment #17)
> OK, After going to a variety of folks here seeing if this is a known issue and, ...
> JDT's 'Refactor -> Change Method Signature' which brings up a dialog that
> allows kepboard navigation and editing. You should be able to get some useful
> information about how to handle the navigation issues (see the JDT
> "ChangeParametersControl.createParameterList" for specifics...
> Let me know how it goes

Hi Eric,

I already tried a workaround which I have mentioned (and attached) here. I looked at the JDT code you mentioned; it calls the same TableViewer.editElement() method that I do. But it doesn't work in my work-around. Can you please look at my code and tell me what could be wrong?
Comment 20 Eric Moffatt CLA 2007-01-02 16:04:33 EST
PK, have you looked at using the SWT TableCursor? If not then take a look. The concensus is that this is a better path to take than rolling your own.
Comment 21 Tod Creasey CLA 2007-01-09 15:51:36 EST
Eric will there be anything to do here or should this be closed.
Comment 22 Eric Moffatt CLA 2007-01-09 16:42:35 EST
Todd, I think that we've done all we can do on this side by pointing them towards the recommended approach (i.e. using SWT's TableCursor). I'll mark this as fixed since we don't anticipate taking further action on this...

Folks, if you run into bugs in the TableCursor you should open an SWT defect for them...
Comment 23 Tod Creasey CLA 2007-05-09 11:20:30 EDT
Please mark as WONTFIX if we aren't going to do anything
Comment 24 Eric Moffatt CLA 2007-05-09 15:03:56 EDT
Marking as WONTFIX. Feel free to open a new defect if you have problems related to a TableCursor implementation.