Revision 29f07c5d
Added by Katja Luther about 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/SearchComposite.java | ||
---|---|---|
12 | 12 |
import org.eclipse.swt.SWT; |
13 | 13 |
import org.eclipse.swt.custom.SashForm; |
14 | 14 |
import org.eclipse.swt.custom.ScrolledComposite; |
15 |
import org.eclipse.swt.events.TraverseEvent; |
|
16 |
import org.eclipse.swt.events.TraverseListener; |
|
15 | 17 |
import org.eclipse.swt.layout.GridData; |
16 | 18 |
import org.eclipse.swt.layout.GridLayout; |
17 | 19 |
import org.eclipse.swt.widgets.Button; |
... | ... | |
53 | 55 |
|
54 | 56 |
txtSearch = new Text(composite, SWT.BORDER); |
55 | 57 |
txtSearch.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1)); |
58 |
txtSearch.addTraverseListener(new TraverseListener() { |
|
59 |
|
|
60 |
@Override |
|
61 |
public void keyTraversed(TraverseEvent e) { |
|
62 |
if (e.detail == SWT.TRAVERSE_RETURN){ |
|
63 |
btnSearchButton.setFocus(); |
|
64 |
} |
|
65 |
|
|
66 |
} |
|
67 |
}); |
|
56 | 68 |
|
57 | 69 |
btnSearchButton = new Button(composite, SWT.NONE); |
58 | 70 |
btnSearchButton.setImage(ImageResources.getImage(ImageResources.SEARCH_ICON)); |
Also available in: Unified diff
fix #8044: focus on search field results in search for enter