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