Ability to override filter fts shortcut listener #PL-5940

This commit is contained in:
Maxim Gorbunkov 2015-09-10 06:24:38 +00:00
parent e152fc774d
commit b75f01b9e5

View File

@ -309,12 +309,7 @@ public class FilterDelegateImpl implements FilterDelegate {
ftsSearchCriteriaField.setWidth(theme.get("cuba.gui.filter.ftsSearchCriteriaField.width"));
ftsSearchCriteriaField.setInputPrompt(getMessage("Filter.enterSearchPhrase"));
ftsSearchCriteriaField.requestFocus();
filterHelper.addShortcutListener(ftsSearchCriteriaField, new FilterHelper.ShortcutListener("ftsSearch", new KeyCombination(KeyCombination.Key.ENTER, null)) {
@Override
public void handleShortcutPressed() {
applyFts();
}
});
filterHelper.addShortcutListener(ftsSearchCriteriaField, createFtsSearchShortcutListener());
controlsLayout.add(ftsSearchCriteriaField);
searchBtn = componentsFactory.createComponent(Button.class);
@ -342,6 +337,15 @@ public class FilterDelegateImpl implements FilterDelegate {
controlsLayout.add(ftsSwitch);
}
protected FilterHelper.ShortcutListener createFtsSearchShortcutListener() {
return new FilterHelper.ShortcutListener("ftsSearch", new KeyCombination(KeyCombination.Key.ENTER, null)) {
@Override
public void handleShortcutPressed() {
applyFts();
}
};
}
protected void createFtsSwitch() {
ftsSwitch = componentsFactory.createComponent(CheckBox.class);
ftsSwitch.setCaption(getMessage("Filter.ftsSwitch"));