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 JButton button = new JButton();
|
||||||
private final Supplier<PluginPanel> panelSupplier;
|
private final Supplier<PluginPanel> panelSupplier;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
public NavigationButton(String name)
|
public NavigationButton(String name)
|
||||||
{
|
{
|
||||||
|
this.name = name;
|
||||||
this.panelSupplier = null;
|
this.panelSupplier = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NavigationButton(String name, Supplier<PluginPanel> panelSupplier)
|
public NavigationButton(String name, Supplier<PluginPanel> panelSupplier)
|
||||||
{
|
{
|
||||||
|
this.name = name;
|
||||||
this.panelSupplier = panelSupplier;
|
this.panelSupplier = panelSupplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,4 +55,9 @@ public class NavigationButton
|
|||||||
{
|
{
|
||||||
return panelSupplier;
|
return panelSupplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ public class PluginToolbar extends JToolBar
|
|||||||
public void addNavigation(NavigationButton button)
|
public void addNavigation(NavigationButton button)
|
||||||
{
|
{
|
||||||
button.getButton().addActionListener((ae) -> onClick(button));
|
button.getButton().addActionListener((ae) -> onClick(button));
|
||||||
|
button.getButton().setToolTipText(button.getName());
|
||||||
|
|
||||||
buttons.add(button);
|
buttons.add(button);
|
||||||
add(button.getButton());
|
add(button.getButton());
|
||||||
|
|||||||
Reference in New Issue
Block a user