Package org.eclipse.ecf.docshare2

Examples of org.eclipse.ecf.docshare2.DocShare


      }
    });
  }

  protected void lock(IModelChange[] remoteChanges) {
    DocShare docShare = SyncResourcesUI.getDocShare(getContainerID());
    if (docShare != null) {
      List paths = new ArrayList(remoteChanges.length);
      for (int i = 0; i < remoteChanges.length; i++) {
        if (remoteChanges[i] instanceof FileChangeMessage) {
          String path = ((FileChangeMessage) remoteChanges[i]).getPath();
          paths.add(path);
        }
      }
      docShare.lock((String[]) paths.toArray(new String[paths.size()]));
    }
    super.lock(remoteChanges);
  }
View Full Code Here


    super.lock(remoteChanges);
  }

  protected void unlock(IModelChange[] remoteChanges) {
    super.unlock(remoteChanges);
    DocShare docShare = SyncResourcesUI.getDocShare(getContainerID());
    if (docShare != null) {
      List paths = new ArrayList(remoteChanges.length);
      for (int i = 0; i < remoteChanges.length; i++) {
        if (remoteChanges[i] instanceof FileChangeMessage) {
          String path = ((FileChangeMessage) remoteChanges[i]).getPath();
          paths.add(path);
        }
      }
      docShare.unlock((String[]) paths.toArray(new String[paths.size()]));
    }
  }
View Full Code Here

    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(
View Full Code Here

    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 (DocShare) docshareChannels.get(containerID);
  }

  public static DocShare addDocShare(ID containerID,
      IChannelContainerAdapter channelAdapter) throws ECFException {
    DocShare docShare = (DocShare) docshareChannels.get(containerID);
    if (docShare == null) {
      return (DocShare) docshareChannels.put(containerID,
          new WorkbenchAwareDocShare(channelAdapter));
    }
    return docShare;
View Full Code Here

    }
  };

  void sendMessage(IModelChangeMessage changeMessage) {
    try {
      channel.sendMessage(targetID, new FileSystemDocumentChangeMessage(path, changeMessage).serialize());
    } catch (ECFException e) {
      DocShareActivator.log(new Status(IStatus.ERROR, DocShareActivator.PLUGIN_ID, "Could not send message to " + targetID, e)); //$NON-NLS-1$
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.docshare2.DocShare

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.