Albireo Focus Management Test Cases

From Eclipsepedia

Jump to: navigation, search

Contents

Get initial focus in one click

  1. Open application from the examples plug-in and show focus views (FV) 1-3, without having clicked inside any of them.
  2. Click directly on the table in either FV 1 or 2. Use a view that is currently inactive. Table and containing view should become focused, with a table row highlighted and one cell outlined, showing that it has focus.
  3. Click directly on the table in the other FV. The same should happen with that table.

Problem (Windows, SWT 3.3, Java 1.5-1.6):

After clicking on each table, table row is highlighted but cell is not given focus.

This problem disappears as soon as there is a second click on any one of the tables. At that point a cell has focus, and clicking on all other tables also focuses a cell.

This problem never appears if the first click is on the view which already has focus.

Albireo fix:

Implementing the fix from bug 216431 when on Windows and Eclipse 3.3. Call EmbeddedFrame.synthesizeWindowActivation when the frame is activated and deactivated.

The SWT bug fix is new with 3.4M5. Earlier 3.4 milestones will have the problem described above.

Notes:

This sounds like problem A from IlvFocusDebugging, but I have not been able to reproduce it on Linux/GTK, and the fix above is only for Windows.

Restore focus on return from another application

  1. Open application with Focus views 1-3 showing
  2. Click directly on on a table in FV1 or 2. A table cell gets focus.
  3. Activate some other application's window
  4. Reactivate the RCP application. Focus should return to the same table cell.

Problem (Windows, SWT 3.3-3.4, Java 1.5-1.6):

The AWT frame is given back focus, but JTable is not, even though it is the permanent focus owner.

Albireo fix:

When implementing the fix from bug 216431 (see test case above), use Display.addFilter() and consume the SWT.Deactivate and SWT.Activate events so that SWT_AWT does not process them further. Otherwise, the AWT KeyboardFocusManager becomes confused by two different attempts to activate the embedded frame.

Notes:

Keep focus when clicking on parent view tab

  1. Open application with Focus view 1 or 2 showing.
  2. Click on a table cell to give it focus
  3. Click on the table's view tab (which already is focused)

Problem (Windows, SWT 3.3-3.4, Java 1.5-1.6):

Table loses focus.

Albireo fix:

Defer deactivation of the embedded frame when the SwingControl is temporarily deactivated before getting back the focus (SWT does not reactivate the SwingControl in this case, so the frame does not get activated).

Notes:

This sounds like problem E from IlvFocusDebugging, but I have not been able to reproduce it on Linux/GTK, and the fix above is only for Windows.

Traverse out of Swing controls

  1. Open application and show Focus Traversal View
  2. Tab into one of the Swing fields
  3. Hit tab again. Focus should move to the next control in the tab order

Problem (Windows, SWT 3.3-3.4, Java 1.5-1.6):

Focus is stuck in the initial Swing fields

Albireo fix:

Under windows, AWT does not implement the "traverse out" function for embedded frames. A keyboard event dispatcher can be added to process traversal keystrokes and to transfer control out to SWT when tabbing past the last component or back-tabbing past the first component.

Notes:

Single text selection

  1. Open application and show Focus Traversal View, with at least one Swing field enabled
  2. Select some text in a swing field
  3. Move to another field. On Windows, the Swing selection should disappear. On GTK, it should disappear once something is selected in the second field (but perhaps this is Window-manager-specific behavior?)

Problem (Windows, SWT 3.3-3.4, Java 1.5-1.6):

Swing selection remains showing, even if a selection is made in another text area.

Albireo fix:

Disable the selection when the embedded AWT frame loses focus

Notes:

Do not steal focus when populating Swing controls

  1. Open application and show Focus views 1-3 simultaneously
  2. Focus on FV 3 (the SWT-only view)
  3. Exit the application. Window state should be saved.
  4. Re-run the application. FV 3 should be the focused view.

Problem (GTK, SWT 3.3-3.4, Java 1.5-1.6):

Focus is stolen by one of the other views when Swing tables are populated at startup

Albireo fix:

Notes: