|
|
|
|
@ -37,7 +37,6 @@
|
|
|
|
|
* @author Yana Stamcheva
|
|
|
|
|
* @author Lyubomir Marinov
|
|
|
|
|
* @author Symphorien Wanko
|
|
|
|
|
* @author Damian Minkov
|
|
|
|
|
*/
|
|
|
|
|
public class SystrayServiceJdicImpl
|
|
|
|
|
implements SystrayService
|
|
|
|
|
@ -163,6 +162,33 @@ private void initSystray()
|
|
|
|
|
{
|
|
|
|
|
UIService uiService = OsDependentActivator.getUIService();
|
|
|
|
|
|
|
|
|
|
if (uiService == null)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* Delay the call to the #initSystray() method until the UIService
|
|
|
|
|
* implementation becomes available.
|
|
|
|
|
*/
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
OsDependentActivator.bundleContext.addServiceListener(
|
|
|
|
|
new DelayedInitSystrayServiceListener(),
|
|
|
|
|
'('
|
|
|
|
|
+ Constants.OBJECTCLASS
|
|
|
|
|
+ '='
|
|
|
|
|
+ UIService.class.getName()
|
|
|
|
|
+ ')');
|
|
|
|
|
}
|
|
|
|
|
catch (InvalidSyntaxException ise)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* Oh, it should not really happen. Besides, it is not clear at
|
|
|
|
|
* the time of this writing what is supposed to happen in the
|
|
|
|
|
* case of such an exception here.
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
menu = TrayMenuFactory.createTrayMenu(this, systray.isSwing());
|
|
|
|
|
|
|
|
|
|
boolean isMac = OSUtils.IS_MAC;
|
|
|
|
|
@ -378,7 +404,6 @@ public void popupMenuCanceled(PopupMenuEvent e)
|
|
|
|
|
if ((activePopupHandler == null) && (pmh != null))
|
|
|
|
|
setActivePopupMessageHandler(pmh);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwingUtilities.invokeLater(new Runnable()
|
|
|
|
|
{
|
|
|
|
|
public void run()
|
|
|
|
|
@ -707,4 +732,35 @@ else if (serviceEvent.getType() == ServiceEvent.UNREGISTERING)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implements a <tt>ServiceListener</tt> which waits for an
|
|
|
|
|
* <tt>UIService</tt> implementation to become available, invokes
|
|
|
|
|
* {@link #initSystray()} and unregisters itself.
|
|
|
|
|
*/
|
|
|
|
|
private class DelayedInitSystrayServiceListener
|
|
|
|
|
implements ServiceListener
|
|
|
|
|
{
|
|
|
|
|
public void serviceChanged(ServiceEvent serviceEvent)
|
|
|
|
|
{
|
|
|
|
|
if (serviceEvent.getType() == ServiceEvent.REGISTERED)
|
|
|
|
|
{
|
|
|
|
|
UIService uiService = OsDependentActivator.getUIService();
|
|
|
|
|
|
|
|
|
|
if (uiService != null)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* This ServiceListener has successfully waited for an
|
|
|
|
|
* UIService implementation to become available so it no
|
|
|
|
|
* longer need to listen.
|
|
|
|
|
*/
|
|
|
|
|
OsDependentActivator.bundleContext.removeServiceListener(
|
|
|
|
|
this);
|
|
|
|
|
|
|
|
|
|
if (!initialized)
|
|
|
|
|
initSystray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|