/** * Runs clean-up for associated resources which need explicit disposal (e.g. listeners keeping * this instance alive because they were added to the model which operationally outlives this * instance). */ public void dispose() { GuiActivator.getUIService().removePluginComponentListener(this); /* * Explicitly remove the components of the PluginComponent instances * because the latter are registered with OSGi and are thus global. */ synchronized (this) { for (PluginComponent pluginComponent : pluginComponents) container.remove((Component) pluginComponent.getComponent()); pluginComponents.clear(); } }
/** * Removes the component of a specific <code>PluginComponent</code> from this <code> * PluginContainer</code>. * * @param c the <code>PluginComponent</code> which is to have its component removed from this * <code>PluginContainer</code> */ private synchronized void removePluginComponent(PluginComponent c) { container.remove((Component) c.getComponent()); pluginComponents.remove(c); }