use of org.eclipse.mylyn.commons.workbench.search.TextSearchControl in project eclipse-integration-commons by spring-projects.
the class DashboardMainPage method createSearchBox.
private void createSearchBox(Composite composite) {
TextSearchControl searchControl = new TextSearchControl(composite, false, null);
searchControl.getTextControl().setMessage("Search spring.io");
GridDataFactory.fillDefaults().grab(false, true).align(SWT.FILL, SWT.CENTER).hint(200, SWT.DEFAULT).applyTo(searchControl);
searchBox = searchControl.getTextControl();
searchBox.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.character == SWT.ESC && e.doit) {
clearText();
}
}
});
searchControl.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
if (e.detail == TextSearchControl.ICON_CANCEL) {
clearText();
} else {
searchSpringSource();
}
}
});
}
Aggregations