Bug 187022 - [Browser] moving focus from Browser to Text makes Text caret disappear
Summary: [Browser] moving focus from Browser to Text makes Text caret disappear
Status: RESOLVED DUPLICATE of bug 181410
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-15 11:04 EDT by nitrobd CLA
Modified: 2007-05-15 13:27 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nitrobd CLA 2007-05-15 11:04:28 EDT
I have noticed that if focus is in a Browser and then moved to a Text (or Spinner, for that matter, and possibly other SWT components as well), the caret of the Text (Spinner, etc.) will become invisible (focus is successfully moved, no problems there).

I have put up a small application to illustrate the bug (code below). Run it and try to (1) move the focus to any of the Text's when the Browser has focus (this will make the caret disappear) and (2) move the focus from one Text to the other (this will make the caret appear as expected).

import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;

public class Playground extends ApplicationWindow {

	public Playground() {
		super(null);
	}

	@Override
	protected Control createContents(Composite parent) {
		getShell().setText("Bug report application");
		getShell().setSize(700, 500);

		Composite comp = new Composite(parent, SWT.NONE);
		RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
		rowLayout.wrap = false;
		comp.setLayout(rowLayout);

		Text location = new Text(comp, SWT.BORDER);
		location.setText("http://www.google.com/");
		RowData textData = new RowData(640, 15);
		location.setLayoutData(textData);

		Browser browser = new Browser(comp, SWT.BORDER);
		browser.setUrl("http://www.google.com/");
		RowData browserData = new RowData(650, 350);
		browser.setLayoutData(browserData);

		Text location2 = new Text(comp, SWT.BORDER);
		location2.setText("http://www.google.com/");
		textData = new RowData(640, 15);
		location2.setLayoutData(textData);

		return comp;
	}

	public static void main(String[] args) {
		Playground app = new Playground();
		app.setBlockOnOpen(true);
		app.open();
		Display.getCurrent().dispose();
	}
}
Comment 1 Grant Gayed CLA 2007-05-15 13:27:00 EDT

*** This bug has been marked as a duplicate of bug 181410 ***