private ExclusiveOptionsPanel<SearchRuleOption> createRuleSelector(StringSearchRule[] rules) {
SearchRuleOption[] options = Arrays2.transform(rules, SearchRuleOption.class, SearchRuleOption.CONVERTER);
ExclusiveOptionsPanel<SearchRuleOption> selector = new ExclusiveOptionsPanel<SearchRuleOption>(
options, null, Orientation.HORIZONTAL);
selector.addSelectionListener(new SelectedOptionListener() {
@Override
public void selectionChanged(Option[] selected) {
StringSearchRule rule = (StringSearchRule) selected[0];
model.setSearchRule(rule);