Package org.eclipse.ecf.example.collab.share

Examples of org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject


    final ClientEntry entry = isConnected(project.getWorkspace().getRoot());
    if (entry == null) {
      MessageDialog.openInformation(getWorkbench().getDisplay().getActiveShell(), Messages.SetSharedEditorSelectionAction_DIALOG_NOT_CONNECTED_TITLE, Messages.SetSharedEditorSelectionAction_DIALOG_NOT_CONNECTED_TEXT);
      return;
    }
    final EclipseCollabSharedObject collabsharedobject = entry.getSharedObject();
    if (collabsharedobject != null) {
      collabsharedobject.sendOpenAndSelectForFile(null, project.getName() + "/" + file.getProjectRelativePath().toString(), textSelection.getOffset(), textSelection.getLength()); //$NON-NLS-1$
    }
  }
View Full Code Here


      }
    });
  }

  protected void createAndAddSharedObject(final ISharedObjectContainer soContainer, final ClientEntry client, final IResource proj, IUser user, String fileDir) throws Exception {
    final EclipseCollabSharedObject sharedObject = new EclipseCollabSharedObject(soContainer, proj, user, fileDir);
    sharedObject.setListener(new SharedObjectEventListener() {
      public void memberRemoved(ID member) {
        final ID groupID = client.getContainer().getConnectedID();
        if (member.equals(groupID)) {
          if (!client.isDisposed()) {
            collabclient.disposeClient(proj, client);
View Full Code Here

    try {
      newClient.connect(targetID, ConnectContextFactory.createUsernamePasswordConnectContext(username, connectData));
    } catch (ContainerConnectException e) {
      // If we have a connect exception then we remove any previously
      // added shared object
      EclipseCollabSharedObject so = newClientEntry.getSharedObject();
      if (so != null)
        so.destroySelf();
      throw e;
    }

    // only add container if the connect was successful
    addClientForResource(newClientEntry, resource);
View Full Code Here

      ClientEntry client = isConnected(resource);
      if (client == null) {
        connected = false;
        action.setText(CONNECT_PROJECT_MENU_TEXT);
      } else {
        EclipseCollabSharedObject collab = client.getSharedObject();
        if (collab != null) {
          collab.chatGUIDestroy();
        }
      }
    }
  }
View Full Code Here

    final ClientEntry entry = isConnected(project);
    if (entry == null) {
      MessageDialog.openInformation(targetPart.getSite().getWorkbenchWindow().getShell(), Messages.OpenSharedEditorAction_DIALOG_NOT_CONNECTED_TITLE, NLS.bind(Messages.OpenSharedEditorAction_DIALOG_NOT_CONNECTED_TEXT, project.getName()));
      return;
    }
    final EclipseCollabSharedObject collabsharedobject = entry.getSharedObject();
    if (collabsharedobject != null) {
      collabsharedobject.sendLaunchEditorForFile(null, file.getProjectRelativePath().toString());
    }
  }
View Full Code Here

      ISharedObjectManager manager = container.getSharedObjectManager();
      ID[] ids = manager.getSharedObjectIDs();
      for (int i = 0; i < ids.length; i++) {
        ISharedObject object = manager.getSharedObject(ids[i]);
        if (object instanceof EclipseCollabSharedObject) {
          EclipseCollabSharedObject ecso = (EclipseCollabSharedObject) object;
          return ecso.getPresenceContainer();
        }
      }
    }
    return null;
  }
View Full Code Here

        final ClientEntry entry = isConnected(project.getWorkspace().getRoot());
        if (entry == null) {
          MessageDialog.openInformation(PlatformUI.getWorkbench().getDisplay().getActiveShell(), Messages.EditorCompoundContributionItem_EXCEPTION_NOT_CONNECTED_TITLE, Messages.EditorCompoundContributionItem_EXCEPTION_NOT_CONNECTED_MESSAGE);
          return;
        }
        final EclipseCollabSharedObject collabsharedobject = entry.getSharedObject();
        if (collabsharedobject != null) {
          collabsharedobject.sendOpenAndSelectForFile(null, project.getName() + "/" + file.getProjectRelativePath().toString(), textSelection.getOffset(), textSelection.getLength()); //$NON-NLS-1$
        }
      }
    };

    final ClientEntry entry = isConnected(project.getWorkspace().getRoot());
    if (entry == null)
      return EMPTY;
    final EclipseCollabSharedObject collabsharedobject = entry.getSharedObject();
    if (collabsharedobject == null)
      return EMPTY;
    action.setText(NLS.bind(Messages.EditorCompoundContributionItem_SHARE_SELECTION_MENU_ITEM_NAME, collabsharedobject.getWindowTitle()));
    if (menuImageDescriptor != null)
      action.setImageDescriptor(menuImageDescriptor);
    //action.setAccelerator(SWT.CTRL | SWT.SHIFT | '1');
    return new IContributionItem[] {new Separator(), new ActionContributionItem(action)};
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject

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.