Community
Participate
Working Groups
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?
yes see bug #151295 I think this could be closed as duplicate of this bug if you agree
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.
(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.
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.
by the way bug #151377 talks about cell-selection interface which might provide the foundation for your request one day or another.
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
Created attachment 55705 [details] A ZIP file containing a project that adds a 'New Wizard' showing the issue
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.
BTW, ZIP'd code uses "TableViewer", -not- "TreeViewer" as I had previously said.
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.
Don't forget to add the accessibility keyword for accessibility bugs.
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
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
If you are using TableCursor, then move this bug over to SWT and give it to Carolyn. Thanks!
Eric, please find out if we're doing the right thing and update the bug. We should investigate fixing this for 3.2.2.
(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.
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
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...
(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?
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.
Eric will there be anything to do here or should this be closed.
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...
Please mark as WONTFIX if we aren't going to do anything
Marking as WONTFIX. Feel free to open a new defect if you have problems related to a TableCursor implementation.