ge search panel: show "No results found" if search is empty, clear on empty lookup
This commit is contained in:
@@ -126,6 +126,7 @@ class GrandExchangeSearchPanel extends JPanel
|
|||||||
|
|
||||||
if (Strings.isNullOrEmpty(lookup))
|
if (Strings.isNullOrEmpty(lookup))
|
||||||
{
|
{
|
||||||
|
searchItemsPanel.removeAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,6 +198,12 @@ class GrandExchangeSearchPanel extends JPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
SwingUtilities.invokeLater(() ->
|
SwingUtilities.invokeLater(() ->
|
||||||
|
{
|
||||||
|
if (ITEMS_LIST.isEmpty())
|
||||||
|
{
|
||||||
|
showSearchString("No results found.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (GrandExchangeItems item : ITEMS_LIST)
|
for (GrandExchangeItems item : ITEMS_LIST)
|
||||||
{
|
{
|
||||||
@@ -206,10 +213,10 @@ class GrandExchangeSearchPanel extends JPanel
|
|||||||
searchItemsPanel.add(panel);
|
searchItemsPanel.add(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEMS_LIST.clear();
|
|
||||||
|
|
||||||
// Remove searching label after search is complete
|
// Remove searching label after search is complete
|
||||||
showSearchString(null);
|
showSearchString(null);
|
||||||
|
ITEMS_LIST.clear();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user