Examples of ISarosSession


Examples of de.fu_berlin.inf.dpp.project.ISarosSession

   *
   * @see org.eclipse.gef.ui.parts.GraphicalEditor#initializeGraphicalViewer()
   */
  @Override
  protected void initializeGraphicalViewer() {
    ISarosSession session = sessionManager.getSarosSession();
    if (session != null) {
      setEnabled(session.getLocalUser().hasWriteAccess());
    }
  }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

    public String[] getProvidedSourceNames() {
        return new String[] { SAROS, SAROS_SESSION };
    }

    public Map<Object, Object> getCurrentState() {
        ISarosSession sarosSession = this.sarosSessionManager.getSarosSession();
        if (sarosSession == null)
            sarosSession = new NullSarosSession();

        Map<Object, Object> map = new HashMap<Object, Object>(2);
        map.put(SAROS, this.saros);
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

        });
    }

    protected void updateEnablement() {
        try {
            ISarosSession sarosSession = sessionManager.getSarosSession();
            List<User> participants = SelectionRetrieverFactory
                .getSelectionRetriever(User.class).getSelection();

            if (sarosSession != null && participants.size() == 1
                && !participants.get(0).isLocal()) {
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

     */
    public static PacketFilter getFromHostFilter(
        final SarosSessionManager sessionManager) {
        return new PacketFilter() {
            public boolean accept(Packet packet) {
                ISarosSession sarosSession = sessionManager.getSarosSession();

                return sarosSession != null
                    && sarosSession.getHost().getJID()
                        .equals(new JID(packet.getFrom()));
            }
        };
    }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

     * @param receivedOn
     */
    protected void addChatLine(final JID jid, final String message,
        final Date receivedOn) {

        ISarosSession sarosSession = sessionManager.getSarosSession();
        if (sarosSession == null)
            return;

        User user = sarosSession.getUser(jid);
        /*
         * For the case a left user notification came after the moment the user
         * left the session we need to cache his metrics.
         */
        if (user != null) {
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

     * If there is already a user followed <code>null</code> is returned, i.e.
     * this is a toggeling method, otherwise a random user with
     * {@link User.Permission#WRITE_ACCESS} is returned.
     */
    protected User getNewToFollow() {
        ISarosSession sarosSession = sessionManager.getSarosSession();
        assert sarosSession != null;

        if (toFollowUser == null) {
            for (User user : sarosSession.getParticipants()) {
                if (user.isRemote() && user.hasWriteAccess()) {
                    if (!user.equals(editorManager.getFollowedUser())) {
                        return user;
                    } else {
                        return null;
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

    /**
     * Returns <code>true</code> if the follow mode button should be enabled,
     * <code>false</code> otherwise.
     */
    protected boolean canFollow() {
        ISarosSession sarosSession = sessionManager.getSarosSession();

        if (sarosSession == null)
            return false;

        int usersWithWriteAccessCount = 0;
        for (User user : sarosSession.getParticipants()) {
            if (user.isRemote() && user.hasWriteAccess())
                usersWithWriteAccessCount++;
        }
        return usersWithWriteAccessCount == 1;
    }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

     *
     * @param sarosSessionManager
     */
    public static void leaveSession(
        final SarosSessionManager sarosSessionManager) {
        ISarosSession sarosSession = sarosSessionManager.getSarosSession();

        Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
            .getShell();

        if (sarosSession != null) {
            boolean reallyLeave;

            if (sarosSession.isHost()) {
                if (sarosSession.getParticipants().size() == 1) {
                    // Do not ask when host is alone...
                    reallyLeave = true;
                } else {
                    reallyLeave = MessageDialog.openQuestion(shell,
                        Messages.CollaborationUtils_confirm_closing,
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

     * @nonBlocking
     */
    public static void addResourcesToSarosSession(
        final SarosSessionManager sarosSessionManager,
        List<IResource> resourcesToAdd) {
        final ISarosSession sarosSession = sarosSessionManager
            .getSarosSession();
        final HashMap<IProject, List<IResource>> projectResources = acquireResources(
            resourcesToAdd, sarosSession);
        if (projectResources.isEmpty())
            return;
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

    public static void addBuddiesToSarosSession(
        final SarosSessionManager sarosSessionManager, final List<JID> buddies) {

        Utils.runSafeAsync(log, new Runnable() {
            public void run() {
                final ISarosSession sarosSession = sarosSessionManager
                    .getSarosSession();
                if (sarosSession != null) {
                    Utils.runSafeSync(log, new Runnable() {
                        public void run() {
                            Collection<User> addedUsers = sarosSession
                                .getParticipants();
                            List<JID> buddiesToAdd = new LinkedList<JID>();
                            for (JID buddy : buddies) {
                                boolean addBuddyToSession = true;
                                for (User addedUser : addedUsers) {
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.