private void buildMinimizedWidget() {
_widget.add(new SpanWidget("Categories:", "ResultsFilter-Label"));
for (int i = 0; i < Math.min(3, _categories.size()); i++) {
SpanPanel panel = new SpanPanel();
final String categoryName = _categories.get(i);
final CheckBox box = new CheckBox();
box.addStyleName(_css.ResultsFilterButton());
box.setText(categoryName);
box.setValue(_activeCategories.contains(categoryName));
box.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent arg0) {
boolean update = false;
if (box.getValue())
update = _activeCategories.add(categoryName);
else
update = _activeCategories.remove(categoryName);
if (update) {
refreshFilter();
}
}
});
panel.add(box);
_widget.add(panel);
}
}