Refresh infoboxes only when needed
Refresh infoboxes only when removeIf and remove actually removes anything to avoid constant refreshing for no reason. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -77,17 +77,19 @@ public class InfoBoxManager
|
|||||||
public void removeInfoBox(InfoBox infoBox)
|
public void removeInfoBox(InfoBox infoBox)
|
||||||
{
|
{
|
||||||
log.debug("Removing InfoBox {}", infoBox);
|
log.debug("Removing InfoBox {}", infoBox);
|
||||||
infoBoxes.remove(infoBox);
|
if (infoBoxes.remove(infoBox))
|
||||||
|
{
|
||||||
refreshInfoBoxes();
|
refreshInfoBoxes();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeIf(Predicate<InfoBox> filter)
|
public void removeIf(Predicate<InfoBox> filter)
|
||||||
{
|
{
|
||||||
log.debug("Removing InfoBoxes for filter {}", filter);
|
log.debug("Removing InfoBoxes for filter {}", filter);
|
||||||
infoBoxes.removeIf(filter);
|
if (infoBoxes.removeIf(filter))
|
||||||
|
{
|
||||||
refreshInfoBoxes();
|
refreshInfoBoxes();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<InfoBox> getInfoBoxes()
|
public List<InfoBox> getInfoBoxes()
|
||||||
|
|||||||
Reference in New Issue
Block a user