Package org.eclipse.ecf.internal.sync.resources.core

Examples of org.eclipse.ecf.internal.sync.resources.core.ResourcesShare


    IPresenceContainerAdapter ipca = getRosterEntry().getRoster()
        .getPresenceContainerAdapter();
    IContainer container = (IContainer) ipca.getAdapter(IContainer.class);

    ResourcesShare sender = SyncResourcesCore.getResourcesShare(container
        .getID());
    IProject project = resource.getProject();
    String projectName = project.getName();

    if (!SyncResourcesCore.isSharing(projectName)) {
      run(HandlerUtil.getActiveShellChecked(event), sender, projectName);
    } else {
      sender.stopSharing(projectName);
    }

    return null;
  }
View Full Code Here


  private void startSharing(ITextEditor editor, IFile file) {
    String projectName = file.getProject().getName();
    for (Iterator it = SyncResourcesCore.getResourceShares().iterator(); it
        .hasNext();) {
      ResourcesShare share = (ResourcesShare) it.next();
      if (share.isSharing(projectName) && share(file)) {
        DocShare docShare = getDocShare(share.getContainerID());
        try {
          IAnnotationModel annotationModel = editor
              .getDocumentProvider().getAnnotationModel(
                  editor.getEditorInput());
          docShare.startSharing(share.getLocalID(), share
              .getReceiverID(), file.getFullPath().toString(),
              annotationModel);
          ISelectionProvider provider = editor.getSelectionProvider();
          if (provider instanceof IPostSelectionProvider) {
            ISelectionChangedListener listener = new SelectionChangedListener(
                share.getReceiverID(), file.getFullPath()
                    .toString(), docShare);
            ((IPostSelectionProvider) provider)
                .addPostSelectionChangedListener(listener);
            sharedEditors.put(editor, listener);
          }
        } catch (ECFException e) {
          IStatus status = new Status(IStatus.ERROR, PLUGIN_ID,
              "Could not send initiation request to " //$NON-NLS-1$
                  + share.getReceiverID(), e);
          log(status);
          StatusManager.getManager().handle(status,
              StatusManager.SHOW);
        } catch (CoreException e) {
          IStatus status = new Status(IStatus.ERROR, PLUGIN_ID,
View Full Code Here

  private void stopSharing(ITextEditor editor, IFile file) {
    String projectName = file.getProject().getName();
    for (Iterator it = SyncResourcesCore.getResourceShares().iterator(); it
        .hasNext();) {
      ResourcesShare share = (ResourcesShare) it.next();
      if (share.isSharing(projectName) && unshare(file)) {
        DocShare docShare = getDocShare(share.getContainerID());
        stopSharing(docShare, share.getReceiverID(), editor, file);
      }
    }
  }
View Full Code Here

    return SyncResourcesCore.getResourcesShare(containerID);
  }

  public static ResourcesShare addResourceShare(ID containerID,
      IChannelContainerAdapter channelAdapter) throws ECFException {
    ResourcesShare resourcesShare = SyncResourcesCore
        .getResourcesShare(containerID);
    if (resourcesShare == null) {
      resourcesShare = new WorkbenchAwareResourcesShare(containerID,
          channelAdapter);
      SyncResourcesCore.addResourcesShare(containerID, resourcesShare);
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.internal.sync.resources.core.ResourcesShare

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.