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

Bug 14131

Summary: Unexpected tab traversal order
Product: [Eclipse Project] Platform Reporter: Naomi Miyamoto <nmiya>
Component: SWTAssignee: Grant Gayed <grant_gayed>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P2 CC: snorthov
Version: 2.0Keywords: accessibility
Target Milestone: ---   
Hardware: PC   
OS: Linux-Motif   
Whiteboard:

Description Naomi Miyamoto CLA 2002-04-18 12:48:56 EDT
Env. : Red Hat 7.2

Tab traversal order seems wrong in modal dialog which extends jface.dialog.

Here is a sample class.

public class MyDialog extends org.eclipse.jface.dialogs.Dialog {
    Text fileText;
    Button browseButton;

    protected Control createDialogArea(Composite parent) {
        Composite composite = new Composite(parent, SWT.NONE);
        GridLayout layout = new GridLayout();
        layout.numColumns = 3;
        composite.setLayout(layout);
        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
        Label label = new Label(composite, SWT.NONE);
        label.setText("File:");
        fileText = new Text(composite, SWT.BORDER);
        browseButton = new Button(composite, SWT.PUSH);
        browseButton.setText("Browse...");
        fileText.setFocus();
        return composite;
    }
}

Tab traversal order in Windows is;
    (1) Text widget
    (2) [Browse...] Button widget
    (3) [OK] Button widget
    (4) [Cancel] Button widget
    (5) Text widget

Tab traversal order in Linux is;
    (1) Text widget
    (2) [OK] Button widget
    (3) [Browse...] Button widget
    (4) Text widget

Expected tab traversal order in Linux is;
    (1) Text widget
    (2) [Browse...] Button widget
    (3) [OK] Button widget
    (4) Text widget
Comment 1 Nick Edgar CLA 2002-04-18 14:04:19 EDT
Tab order should be consistent between platforms.
org.eclipse.jface.Dialog creates the OK and Cancel buttons after calling 
createDialogArea, but other than that it has no impact on the tab order.
Comment 2 Mike Wilson CLA 2002-04-18 14:18:37 EDT
What about the fact that focus never goes to the Cancel button on linux?
Comment 3 Steve Northover CLA 2002-04-18 17:55:18 EDT
Buttons on Linux are tab items and are traversed using the arrow keys.  Try the 
native file dialog to see this behavior.  Buttons on Windows are tab groups.  
This is the behavior you expected to see on Linux but this goes against the 
platform look and feel.
Comment 4 Naomi Miyamoto CLA 2002-04-19 02:02:24 EDT
I see. Thank you.