clear search button
This commit is contained in:
@@ -51,6 +51,13 @@ class MainFrameController {
|
||||
|
||||
private volatile Core core
|
||||
|
||||
@ControllerAction
|
||||
void clearSearch() {
|
||||
def searchField = builder.getVariable("search-field")
|
||||
searchField.setSelectedItem(null)
|
||||
searchField.requestFocus()
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
void search(ActionEvent evt) {
|
||||
if (evt?.getActionCommand() == null)
|
||||
|
||||
@@ -154,6 +154,7 @@ class MainFrameView {
|
||||
}
|
||||
panel( constraints: BorderLayout.EAST) {
|
||||
button(text: "Search", searchAction)
|
||||
button(text : "", icon : imageIcon("/close_tab.png"), clearSearchAction)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ class SearchFieldModel extends AbstractListModel implements MutableComboBoxModel
|
||||
}
|
||||
|
||||
public void addElement(Object string) {
|
||||
if (string == null)
|
||||
return
|
||||
if (uiSettings.storeSearchHistory) {
|
||||
if (!uiSettings.searchHistory.add(string))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user