| Summary: | [Progress] Cannot give keyboard focus to the Progress Viewer with tab key | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Tod Creasey <Tod_Creasey> |
| Component: | UI | Assignee: | Tod Creasey <Tod_Creasey> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | steven.wasleski, veronika_irvine |
| Version: | 3.0 | Keywords: | accessibility |
| Target Milestone: | 3.2 M5 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Tod Creasey
andre, is this still a problem? This is still an issue as the widget does not take focus using f& and cannot be tabbed through Kevin I removed you as this might get a bit lengthy.
Veronika
I have tried adding a traverse listener to the Canvas of the form
addTraverseListener(new TraverseListener(){
/* (non-Javadoc)
* @see
org.eclipse.swt.events.TraverseListener#keyTraversed
(org.eclipse.swt.events.TraverseEvent)
*/
public void keyTraversed(TraverseEvent e) {
System.out.println("traverse ");
switch (e.detail) {
/* Do tab group traversal */
case SWT.TRAVERSE_ESCAPE:
case SWT.TRAVERSE_RETURN:
case SWT.TRAVERSE_TAB_NEXT:
case SWT.TRAVERSE_TAB_PREVIOUS:
case SWT.TRAVERSE_PAGE_NEXT:
case SWT.TRAVERSE_PAGE_PREVIOUS:
e.doit = true;
break;
}
}
});
But when I attempt to traverse using the tab key from the CtabItem tab I never
hit this code. This appears to be all I need based on the snippet.
We are in the process of updating the accessibility information for 3.1. Is this bug going to be fixed in 3.1? Veronika is this going to be possible using any SWT API? In ProgressViewer, I added the following and was able to see focus go into and
out of the progress viewer:
protected void hookControl(Control control) {
control.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
handleDispose(event);
}
});
control.addKeyListener(new org.eclipse.swt.events.KeyListener() {
public void keyPressed(org.eclipse.swt.events.KeyEvent e){}
public void keyReleased(org.eclipse.swt.events.KeyEvent e){}
});
control.addTraverseListener(new org.eclipse.swt.events.TraverseListener
() {
public void keyTraversed(org.eclipse.swt.events.TraverseEvent
e) {
switch (e.detail) {
case org.eclipse.swt.SWT.TRAVERSE_TAB_NEXT:
case org.eclipse.swt.SWT.TRAVERSE_TAB_PREVIOUS:
e.doit = true;
}
}
});
// Used red and blue so I could see where the focus went
// Your canvas needs to give some visible clue that it has focus.
// You also may nat want to take focus when no progress is being shown.
control.addFocusListener(new org.eclipse.swt.events.FocusListener() {
public void focusGained(org.eclipse.swt.events.FocusEvent e) {
Canvas c = (Canvas)e.widget;
c.setBackground(c.getDisplay().getSystemColor
(org.eclipse.swt.SWT.COLOR_RED));
}
public void focusLost(org.eclipse.swt.events.FocusEvent e) {
Canvas c = (Canvas)e.widget;
c.setBackground(c.getDisplay().getSystemColor
(org.eclipse.swt.SWT.COLOR_BLUE));
}
});
}
Great - lets do this for 3.1 then if we can. This can currently be done by using the down arrow. This turns out to be fiarly complex so I am going to remove the 3,1 marking. With the changes in 3.2 to using buttons instead of tool items we can now use the tab. Marking M5 so that we can verify. Verified in 20060113-1200 |