Changes update activator to activate and add its plugins after the ui service is loaded, to avoid a problem where the plugin menu is missing.

cusax-fix
Damian Minkov 13 years ago
parent f356a1f780
commit 622430427f

@ -110,6 +110,9 @@ protected void addComponentToContainer(
*/
private synchronized void addPluginComponent(PluginComponent c)
{
if (logger.isInfoEnabled())
logger.info("Will add following plugin component: " + c);
/*
* Try to respect positionIndex of PluginComponent to some extent:
* PluginComponents with positionIndex equal to 0 go at the beginning,

@ -516,6 +516,19 @@ private static boolean isLatestVersion()
*/
private static void showGenericNewVersionAvailableDialog()
{
if(!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
showGenericNewVersionAvailableDialog();
}
});
return;
}
/*
* Before showing the dialog, we'll enterCheckForUpdates() in order to
* notify that it is not safe to enter "Check for Updates" again. If we
@ -653,6 +666,19 @@ public void actionPerformed(ActionEvent e)
*/
private static void showWindowsNewVersionAvailableDialog()
{
if(!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
showWindowsNewVersionAvailableDialog();
}
});
return;
}
/*
* Before showing the dialog, we'll enterCheckForUpdates() in order to
* notify that it is not safe to enter "Check for Updates" again. If we

@ -27,7 +27,7 @@
* @author Lyubomir Marinov
*/
public class UpdateActivator
implements BundleActivator
extends AbstractServiceDependentActivator
{
/**
* The <tt>Logger</tt> used by the <tt>UpdateActivator</tt> class and its
@ -165,18 +165,15 @@ static UIService getUIService()
}
/**
* Starts this bundle
*
* @param bundleContext <tt>BundleContext</tt> provided by OSGi framework
* @throws Exception if something goes wrong during start
* The dependent service is available and the bundle will start.
* @param dependentService the UIService this activator is waiting.
*/
public void start(BundleContext bundleContext) throws Exception
@Override
public void start(Object dependentService)
{
if (logger.isDebugEnabled())
logger.debug("Update checker [STARTED]");
UpdateActivator.bundleContext = bundleContext;
ConfigurationService cfg = getConfiguration();
if (OSUtils.IS_WINDOWS)
@ -215,9 +212,6 @@ public void start(BundleContext bundleContext) throws Exception
updateService.checkForUpdates(false);
}
if (logger.isDebugEnabled())
logger.debug("Update checker [REGISTERED]");
if (cfg.getBoolean(CHECK_FOR_UPDATES_DAILY_ENABLED_PROP,
false))
{
@ -240,6 +234,29 @@ public void run()
24*60*60,
TimeUnit.SECONDS);
}
if (logger.isDebugEnabled())
logger.debug("Update checker [REGISTERED]");
}
/**
* This activator depends on UIService.
* @return the class name of uiService.
*/
@Override
public Class<?> getDependentServiceClass()
{
return UIService.class;
}
/**
* Setting context to the activator, as soon as we have one.
*
* @param context the context to set.
*/
public void setBundleContext(BundleContext context)
{
bundleContext = context;
}
/**

Loading…
Cancel
Save