Package adams.gui.plugin
Class AbstractToolPluginManager<T extends ToolPluginSupporter,P extends AbstractToolPlugin>
- java.lang.Object
-
- adams.gui.plugin.AbstractToolPluginManager<T,P>
-
- Type Parameters:
T
- the owning toolP
- the type of plugin
- Direct Known Subclasses:
ImageViewerPluginManager
public abstract class AbstractToolPluginManager<T extends ToolPluginSupporter,P extends AbstractToolPlugin> extends Object
Ancestor for classes that manage tool plugins.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected List<JMenuItem>
m_MenuItems
the plugin menu items.protected ChangeListener
m_MenuUpdateListener
the change listener to use for triggering menu updates.protected T
m_Owner
the owner.protected List<P>
m_Plugins
the plugins.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractToolPluginManager(T owner)
Initializes the manager.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addToMenuBar(JMenuBar menubar)
Adds the plugins to the menu bar.ChangeListener
getMenuUpdateListener()
Returns the listener for menu updates.abstract String[]
getPlugins()
Returns a list of plugin classnames.void
setMenuUpdateListener(ChangeListener l)
Sets the listener for menu updates.void
updateMenu()
updates the enabled state of the menu items.
-
-
-
Field Detail
-
m_Owner
protected T extends ToolPluginSupporter m_Owner
the owner.
-
m_Plugins
protected List<P extends AbstractToolPlugin> m_Plugins
the plugins.
-
m_MenuUpdateListener
protected ChangeListener m_MenuUpdateListener
the change listener to use for triggering menu updates.
-
-
Constructor Detail
-
AbstractToolPluginManager
protected AbstractToolPluginManager(T owner)
Initializes the manager.- Parameters:
owner
- the owning tool
-
-
Method Detail
-
setMenuUpdateListener
public void setMenuUpdateListener(ChangeListener l)
Sets the listener for menu updates.- Parameters:
l
- the listener, null to unset
-
getMenuUpdateListener
public ChangeListener getMenuUpdateListener()
Returns the listener for menu updates.- Returns:
- the listener, null if not available
-
getPlugins
public abstract String[] getPlugins()
Returns a list of plugin classnames.- Returns:
- all the available plugins
-
addToMenuBar
public void addToMenuBar(JMenuBar menubar)
Adds the plugins to the menu bar.- Parameters:
menubar
- the menu bar
-
updateMenu
public void updateMenu()
updates the enabled state of the menu items.
-
-