use of com.google.gwt.user.client.ui.TextBox in project activityinfo by bedatadriven.
the class SearchResultsPage method createSearchBox.
private void createSearchBox() {
textboxSearch = new TextBox();
textboxSearch.setSize("2em", "2em");
textboxSearch.setStylePrimaryName("searchBox");
textboxSearch.addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
QueryChecker checker = new QueryChecker();
if (checker.checkQuery(textboxSearch.getText())) {
eventBus.fireEvent(new SearchEvent(textboxSearch.getText()));
} else {
showError(checker.getFails());
}
}
}
});
BorderLayoutData bld = new BorderLayoutData(LayoutRegion.NORTH);
bld.setSize(40);
bld.setMargins(new Margins(16));
add(textboxSearch, bld);
}
Aggregations