Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 63386

Summary: [Progress] Cannot give keyboard focus to the Progress Viewer with tab key
Product: [Eclipse Project] Platform Reporter: Tod Creasey <Tod_Creasey>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: steven.wasleski, veronika_irvine
Version: 3.0Keywords: accessibility
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Tod Creasey CLA 2004-05-21 07:50:11 EDT
20040521

It is not possible to give keyboard focus to the progress viewer. As a result 
you need a mouse to delete anything and nothing can be giveen focus.

What is worse is that it eats the tab when you hit it you can't tab anywhere 
in the workbench.

setFocus likely should be implemented to give focus to either the toolbar or 
one of the buttons of the entry
Comment 1 Michael Van Meekeren CLA 2004-06-21 09:56:30 EDT
andre, is this still a problem?
Comment 2 Tod Creasey CLA 2004-09-14 16:47:31 EDT
This is still an issue as the widget does not take focus using f& and cannot 
be tabbed through
Comment 3 Tod Creasey CLA 2004-09-15 13:50:47 EDT
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.
Comment 4 Steven Wasleski CLA 2005-04-12 11:00:13 EDT
We are in the process of updating the accessibility information for 3.1.  Is 
this bug going to be fixed in 3.1?
Comment 5 Tod Creasey CLA 2005-04-12 11:41:39 EDT
Veronika is this going to be possible using any SWT API?
Comment 6 Veronika Irvine CLA 2005-04-12 14:56:00 EDT
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));
		}
	});
}
Comment 7 Tod Creasey CLA 2005-04-12 14:58:02 EDT
Great - lets do this for 3.1 then if we can.
Comment 8 Tod Creasey CLA 2005-04-25 14:44:25 EDT
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.
Comment 9 Tod Creasey CLA 2006-02-02 11:39:54 EST
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.
Comment 10 Tod Creasey CLA 2006-02-13 14:46:33 EST
Verified in 20060113-1200