Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-11-02 20:44:30 +0000
committerslewis2007-11-02 20:44:30 +0000
commit472a907169c35a6b05ac556ddfcee72927d1c337 (patch)
treee1e446efdec6b91861b0f46cc096f247aa6d8627 /framework/bundles/org.eclipse.ecf.presence.collab.ui
parenta552d61ee8a22eefa12d463c5de4f8bfaa888773 (diff)
downloadorg.eclipse.ecf-472a907169c35a6b05ac556ddfcee72927d1c337.tar.gz
org.eclipse.ecf-472a907169c35a6b05ac556ddfcee72927d1c337.tar.xz
org.eclipse.ecf-472a907169c35a6b05ac556ddfcee72927d1c337.zip
Added handling of container dispose notification
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.presence.collab.ui')
-rw-r--r--framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/StartURLShareAndViewShare.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/StartURLShareAndViewShare.java b/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/StartURLShareAndViewShare.java
index 294e68dd7..700de9592 100644
--- a/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/StartURLShareAndViewShare.java
+++ b/framework/bundles/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/internal/presence/collab/ui/StartURLShareAndViewShare.java
@@ -20,6 +20,7 @@ import org.eclipse.ecf.core.IContainerManager;
import org.eclipse.ecf.core.IContainerManagerListener;
import org.eclipse.ecf.core.events.IContainerConnectedEvent;
import org.eclipse.ecf.core.events.IContainerDisconnectedEvent;
+import org.eclipse.ecf.core.events.IContainerDisposeEvent;
import org.eclipse.ecf.core.events.IContainerEvent;
import org.eclipse.ecf.core.start.IECFStart;
import org.eclipse.ecf.core.util.ECFException;
@@ -36,14 +37,14 @@ public class StartURLShareAndViewShare implements IECFStart {
* @see org.eclipse.ecf.core.IContainerListener#handleEvent(org.eclipse.ecf.core.events.IContainerEvent)
*/
public void handleEvent(IContainerEvent event) {
+ final IContainerManager containerManager = Activator.getDefault().getContainerManager();
+ if (containerManager == null)
+ return;
+ IContainer container = containerManager.getContainer(event.getLocalContainerID());
+ if (container == null)
+ return;
if (event instanceof IContainerConnectedEvent || event instanceof IContainerDisconnectedEvent) {
// connected
- final IContainerManager containerManager = Activator.getDefault().getContainerManager();
- if (containerManager == null)
- return;
- IContainer container = containerManager.getContainer(event.getLocalContainerID());
- if (container == null)
- return;
IChannelContainerAdapter cca = (IChannelContainerAdapter) container.getAdapter(IChannelContainerAdapter.class);
if (cca == null)
return;
@@ -58,6 +59,8 @@ public class StartURLShareAndViewShare implements IECFStart {
// disconnected
URLShare.removeURLShare(container.getID());
ViewShare.removeViewShare(container.getID());
+ } else if (event instanceof IContainerDisposeEvent) {
+ containerManager.removeListener(containerManagerListener);
}
}
}

Back to the top