Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370355 - Combo does not show focus ring in some cases
Summary: Combo does not show focus ring in some cases
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.8 M6   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-01 12:16 EST by Felipe Heidrich CLA
Modified: 2012-03-09 12:10 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe Heidrich CLA 2012-02-01 12:16:20 EST
steps to reproduce the problem on Eclipse:

"when hovering over a Java problem, you can enrich the hover and then click on the 'Configure Problem Severity' icon. This opens the preference page and sets the focus on the correct preference"
The focus control is not decorated with focus ring, even when the ALT key is pressed. Thus, it can't be identified in the UI.

Here is snippet that shows the same problem:
public class Snippet {


	public static void main(final String[] args) {
		final Display display = new Display();
		
		Shell shell = new Shell(display);
		shell.setLayout(new RowLayout());
		
		Label label = new Label(shell, SWT.SINGLE);
		label.setText("text:");
		final Combo combo = new Combo(shell, SWT.DROP_DOWN | SWT.READ_ONLY);
		combo.setItems(new String[] {"hello", "hi"});
		combo.select(0);
		Button button = new Button(shell, SWT.PUSH);
		button.setText("button");
		
		display.addFilter(SWT.KeyDown, new Listener() {
			public void handleEvent(Event event) {
				if (event.keyCode == SWT.F1) {
					combo.redraw();
					System.out.println("redrawing");
				}
			}
		});
		shell.setSize(200, 200);
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		
		display.dispose();
	}
}
Comment 1 Felipe Heidrich CLA 2012-02-01 12:17:16 EST
Note that redrawing the combo (either by entering/exit the combo or using F1 in the snippet) will cause the combo to render correctly (showing the focus ring).
Comment 3 Dani Megert CLA 2012-02-02 02:05:37 EST
Verified in N20120201-2112 that it works when I press 'Alt'.