diff options
author | Yana Stamcheva <yana@jitsi.org> | 2012-08-23 17:22:17 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2012-08-23 17:22:17 +0000 |
commit | f9176ff1420d9cee294d9e8523ebba9f649edccd (patch) | |
tree | a3dbd5b8a7fc26ce19cb2391e6e2607669466926 | |
parent | fba0d73ad955199ed740f24f14e5345001726aca (diff) | |
download | jitsi-f9176ff1420d9cee294d9e8523ebba9f649edccd.zip jitsi-f9176ff1420d9cee294d9e8523ebba9f649edccd.tar.gz jitsi-f9176ff1420d9cee294d9e8523ebba9f649edccd.tar.bz2 |
Adds plugin components in the Swing thread.
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java b/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java index 5c753dd..8d95a58 100644 --- a/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/menus/ToolsMenu.java @@ -122,10 +122,16 @@ public class ToolsMenu { for (ServiceReference serRef : serRefs) { - PluginComponent component = (PluginComponent) GuiActivator + final PluginComponent component = (PluginComponent) GuiActivator .bundleContext.getService(serRef); - this.add((Component)component.getComponent()); + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + add((Component) component.getComponent()); + } + }); } } @@ -212,11 +218,17 @@ public class ToolsMenu */ public void pluginComponentAdded(PluginComponentEvent event) { - PluginComponent c = event.getPluginComponent(); + final PluginComponent c = event.getPluginComponent(); if(c.getContainer().equals(Container.CONTAINER_TOOLS_MENU)) { - this.add((Component) c.getComponent()); + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + add((Component) c.getComponent()); + } + }); this.revalidate(); this.repaint(); @@ -230,11 +242,17 @@ public class ToolsMenu */ public void pluginComponentRemoved(PluginComponentEvent event) { - PluginComponent c = event.getPluginComponent(); + final PluginComponent c = event.getPluginComponent(); if(c.getContainer().equals(Container.CONTAINER_TOOLS_MENU)) { - this.remove((Component) c.getComponent()); + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + remove((Component) c.getComponent()); + } + }); } } |