Add tooltips for navButtons on PluginToolbar
This commit is contained in:
@@ -32,13 +32,17 @@ public class NavigationButton
|
||||
private final JButton button = new JButton();
|
||||
private final Supplier<PluginPanel> panelSupplier;
|
||||
|
||||
private String name;
|
||||
|
||||
public NavigationButton(String name)
|
||||
{
|
||||
this.name = name;
|
||||
this.panelSupplier = null;
|
||||
}
|
||||
|
||||
public NavigationButton(String name, Supplier<PluginPanel> panelSupplier)
|
||||
{
|
||||
this.name = name;
|
||||
this.panelSupplier = panelSupplier;
|
||||
}
|
||||
|
||||
@@ -51,4 +55,9 @@ public class NavigationButton
|
||||
{
|
||||
return panelSupplier;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public class PluginToolbar extends JToolBar
|
||||
public void addNavigation(NavigationButton button)
|
||||
{
|
||||
button.getButton().addActionListener((ae) -> onClick(button));
|
||||
button.getButton().setToolTipText(button.getName());
|
||||
|
||||
buttons.add(button);
|
||||
add(button.getButton());
|
||||
|
||||
Reference in New Issue
Block a user