Fixes check for update menu entry L&F and plugin container behaviour when initialize components.

cusax-fix
Damian Minkov 13 years ago
parent 032e5811d2
commit 02b5ab7f02

@ -224,6 +224,8 @@ public Iterable<PluginComponent> getPluginComponents()
*/
private void initPluginComponents()
{
GuiActivator.getUIService().addPluginComponentListener(this);
// Look for PluginComponents registered in the OSGi BundleContext.
ServiceReference[] serRefs = null;
@ -256,8 +258,6 @@ private void initPluginComponents()
addPluginComponent(component);
}
}
GuiActivator.getUIService().addPluginComponentListener(this);
}
/**

@ -25,7 +25,7 @@ public class CheckForUpdatesMenuItemComponent
/**
* The "Check for Updates" menu item.
*/
private final JMenuItem checkForUpdatesMenuItem;
private JMenuItem checkForUpdatesMenuItem;
/**
* Initializes a new "Check for Updates" menu item.
@ -35,18 +35,6 @@ public class CheckForUpdatesMenuItemComponent
public CheckForUpdatesMenuItemComponent(Container container)
{
super(container);
checkForUpdatesMenuItem
= new JMenuItem(
Resources.getResources().getI18NString(
"plugin.updatechecker.UPDATE_MENU_ENTRY"));
checkForUpdatesMenuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
UpdateActivator.getUpdateService().checkForUpdates(true);
}
});
}
/**
@ -57,6 +45,21 @@ public void actionPerformed(ActionEvent e)
*/
public JMenuItem getComponent()
{
if(checkForUpdatesMenuItem == null)
{
checkForUpdatesMenuItem
= new JMenuItem(
Resources.getResources().getI18NString(
"plugin.updatechecker.UPDATE_MENU_ENTRY"));
checkForUpdatesMenuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
UpdateActivator.getUpdateService().checkForUpdates(true);
}
});
}
return checkForUpdatesMenuItem;
}

Loading…
Cancel
Save