Skip to content

Commit

Permalink
ge search panel: show "No results found" if search is empty, clear on…
Browse files Browse the repository at this point in the history
… empty lookup
  • Loading branch information
Adam- committed Apr 18, 2018
1 parent e03defc commit 9252c02
Showing 1 changed file with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ private void priceLookup(boolean exactMatch)

if (Strings.isNullOrEmpty(lookup))
{
searchItemsPanel.removeAll();
return;
}

Expand Down Expand Up @@ -198,18 +199,24 @@ private void priceLookup(boolean exactMatch)

SwingUtilities.invokeLater(() ->
{
for (GrandExchangeItems item : ITEMS_LIST)
if (ITEMS_LIST.isEmpty())
{
GrandExchangeItemPanel panel = new GrandExchangeItemPanel(item.getIcon(), item.getName(),
item.getItemId(), item.getGePrice(), item.getHaPrice());

searchItemsPanel.add(panel);
showSearchString("No results found.");
}
else
{
for (GrandExchangeItems item : ITEMS_LIST)
{
GrandExchangeItemPanel panel = new GrandExchangeItemPanel(item.getIcon(), item.getName(),
item.getItemId(), item.getGePrice(), item.getHaPrice());

ITEMS_LIST.clear();
searchItemsPanel.add(panel);
}

// Remove searching label after search is complete
showSearchString(null);
// Remove searching label after search is complete
showSearchString(null);
ITEMS_LIST.clear();
}
});
}

Expand Down

0 comments on commit 9252c02

Please sign in to comment.