Community
Participate
Working Groups
In the ui.forms.widgets.AbstractHyperlink.handleActivate() method, triggerAccessible() is called after calling the linkActivated listeners. This is causing the problem described in this IBM Forums thread: http://ibmforums.ibm.com/forums/message.jspa?messageID=2002027&tstart=0 i.e. the AbstractHyperlink is stealing the accessibility focus back from a dialog that is opened in a linkActivated listener. I think triggerAccessible() should be called before calling the listeners.
Here is a simple JFace snippet for testing. This fails in the manner described in the forum post. import org.eclipse.jface.dialogs.*; import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class Snippet012BasicPopupDialogAccessibility { public static void main(String[] args) { Display display = new Display (); final Shell shell = new Shell(display); shell.setLayout(new GridLayout()); Text text = new Text(shell, SWT.SINGLE | SWT.BORDER); text.setText("This is a text edit field."); Button button = new Button(shell, SWT.PUSH); button.setText("Open"); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { PopupDialog testDialog = new PopupDialog(shell,PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE,false,false,false,false,false,"Testing!","This is a test"); testDialog.open(); } }); shell.pack(); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } }
This is a user error. Changing false to true in the following line fixes this: PopupDialog testDialog = new PopupDialog(shell,PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE,true,false,false,false,false,"Testing!","This is a test"); This is because the third parameter to the PopupDialog constructor is: * @param takeFocusOnOpen * A boolean indicating whether focus should be taken by this * popup when it opens. Closing this bug as "Works for me".