Examples of DocShare


Examples of org.eclipse.ecf.docshare.DocShare

    // If we are already engaged in a doc share (either as initiator or as receiver)
    // Then present menu item to stop
    final List presenceContainerAdapters = getPresenceContainerAdapters();
    for (final Iterator i = presenceContainerAdapters.iterator(); i.hasNext();) {
      final IPresenceContainerAdapter pca = (IPresenceContainerAdapter) i.next();
      final DocShare docShare = getDocShareForPresenceContainerAdapter(pca);
      if (docShare != null && docShare.isSharing() && docShare.getTextEditor().equals(editorPart)) {
        return getMenuContributionForStopShare(pca.getRosterManager().getRoster(), docShare, docShare.getOtherID());
      }
    }
    return super.getContributionItems();
  }
View Full Code Here

Examples of org.eclipse.ecf.docshare.DocShare

  public DocShare getDocShare(ID containerID) {
    return (DocShare) docsharechannels.get(containerID);
  }

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

Examples of org.eclipse.ecf.docshare.DocShare

   */
  protected IContributionItem[] createContributionItemsForPresenceContainer(IPresenceContainerAdapter presenceContainerAdapter) {
    final IContainer container = (IContainer) presenceContainerAdapter.getAdapter(IContainer.class);
    if (container == null)
      return NO_CONTRIBUTIONS;
    final DocShare docShare = Activator.getDefault().getDocShare(container.getID());
    if (docShare == null)
      return NO_CONTRIBUTIONS;
    final IRoster roster = presenceContainerAdapter.getRosterManager().getRoster();
    final IContributionItem[] contributions = createContributionItemsForRoster(roster);
    if (contributions == null || contributions.length == 0)
View Full Code Here

Examples of org.eclipse.ecf.docshare.DocShare

    if (rosterEntry != null) {
      IRoster roster = rosterEntry.getRoster();
      final IContainer container = (IContainer) roster.getPresenceContainerAdapter().getAdapter(IContainer.class);
      if (container.getConnectedID() == null)
        showErrorMessage(Messages.DocShareRosterMenuHandler_ERROR_NOT_CONNECTED);
      final DocShare sender = Activator.getDefault().getDocShare(container.getID());
      if (sender == null)
        showErrorMessage(Messages.DocShareRosterMenuHandler_ERROR_NO_SENDER);
      if (sender.isSharing())
        showErrorMessage(Messages.DocShareRosterMenuHandler_ERROR_EDITOR_ALREADY_SHARING);
      final ITextEditor textEditor = getTextEditor();
      if (textEditor == null)
        showErrorMessage(Messages.DocShareRosterMenuHandler_EXCEPTION_EDITOR_NOT_TEXT);
      final String inputName = getInputName(textEditor);
      if (inputName == null)
        showErrorMessage(Messages.DocShareRosterMenuHandler_NO_FILENAME_WITH_CONTENT);
      final IUser user = roster.getUser();
      sender.startShare(user.getID(), user.getName(), rosterEntry.getUser().getID(), inputName, textEditor);
    }
    return null;
  }
View Full Code Here

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

Examples of org.eclipse.ecf.docshare2.DocShare

    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

Examples of org.eclipse.ecf.docshare2.DocShare

    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

Examples of org.eclipse.ecf.docshare2.DocShare

    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

Examples of org.eclipse.ecf.docshare2.DocShare

    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
TOP
Copyright © 2018 www.massapi.com. 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.