Esempio n. 1
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.ecf.core.IContainerListener#handleEvent(org.eclipse.ecf
  * .core.events.IContainerEvent)
  */
 public void handleEvent(IContainerEvent event) {
   final IContainerManager containerManager =
       (IContainerManager) ContainerFactory.getDefault();
   if (containerManager == null) return;
   IContainer container = containerManager.getContainer(event.getLocalContainerID());
   if (container == null) return;
   if (event instanceof IContainerConnectedEvent
       || event instanceof IContainerDisconnectedEvent) {
     // connected
     IChannelContainerAdapter cca =
         (IChannelContainerAdapter) container.getAdapter(IChannelContainerAdapter.class);
     if (cca == null) return;
     ID containerID = container.getID();
     if (event instanceof IContainerConnectedEvent) {
       try {
         if (!TeamSynchronization.contains(containerID)) {
           TeamSynchronization.put(containerID, new WorkbenchAwareRemoteShare(cca));
         }
       } catch (ECFException e) {
         TeamSynchronization.log(
             "RemoteShare could not be added or created", e); // $NON-NLS-1$
       }
     } else if (event instanceof IContainerDisconnectedEvent) {
       // disconnected
       TeamSynchronization.removeShare(containerID);
     }
   } else if (event instanceof IContainerDisposeEvent) {
     containerManager.removeListener(containerManagerListener);
     container.removeListener(containerListener);
   }
 }
Esempio n. 2
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.ecf.core.IContainerManagerListener#containerAdded(org
  * .eclipse.ecf.core.IContainer)
  */
 public void containerAdded(IContainer container) {
   IChannelContainerAdapter cca =
       (IChannelContainerAdapter) container.getAdapter(IChannelContainerAdapter.class);
   if (cca == null) return;
   container.addListener(containerListener);
 }