mi = new JMenuItem("Reload");
mi.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
pluginCL.reload(".",getPluginListener());
}
});
"I would change the above segment as shown below.
mi = new JMenuItem("Reload");
mi.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
pluginCL.reload(".",getPluginListener());
// Allow the Plugins to register themselves
doPlugins(new PluginAction()
{
public void action(Plugin plugin)
{
plugin.addToMenuBar(mb);
}
});
}
});
"This would ensure that the newly added plugins are displayed in the menu."He's absolutely right--the menu's action handler does the reload of the plugins themselves, but never gives the plugins a chance to register themselves with the menubar. Good catch.