Allow the info panel's navButton to be removed on shutDown
This commit is contained in:
@@ -40,13 +40,15 @@ public class InfoPlugin extends Plugin
|
||||
@Inject
|
||||
private ClientUI ui;
|
||||
|
||||
private NavigationButton navButton;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
final InfoPanel panel = injector.getInstance(InfoPanel.class);
|
||||
panel.init();
|
||||
|
||||
final NavigationButton navButton = new NavigationButton(
|
||||
navButton = new NavigationButton(
|
||||
"Info",
|
||||
ImageIO.read(getClass().getResourceAsStream("info_icon.png")),
|
||||
() -> panel
|
||||
@@ -54,4 +56,10 @@ public class InfoPlugin extends Plugin
|
||||
|
||||
ui.getPluginToolbar().addNavigation(navButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
ui.getPluginToolbar().removeNavigation(navButton);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user