Package de.fu_berlin.inf.dpp

Examples of de.fu_berlin.inf.dpp.User


        }
        return result;
    }

    public StartHandle generateStartHandle(StopActivity stopActivity) {
        User user = stopActivity.getUser();
        return new StartHandle(user, this, stopActivity.getActivityID());
    }
View Full Code Here


public class ParticipantPropertyTester extends PropertyTester {

    public boolean test(Object receiver, String property, Object[] args,
        Object expectedValue) {
        if (receiver instanceof User) {
            User participant = (User) receiver;
            if ("hasWriteAccess".equals(property)) {
                return participant.hasWriteAccess();
            }
            if ("isRemote".equals(property)) {
                return participant.isRemote();
            }
        }
        return false;
    }
View Full Code Here

        // Reset jupiter
        sarosSession.getConcurrentDocumentServer().reset(from.getJID(), path);

        progress.worked(1);
        final User user = sarosSession.getLocalUser();

        if (file.exists()) {

            try {
                // Send the file to client
View Full Code Here

                log.warn("Received leave message but shared"
                    + " project has already ended: " + fromJID);
                return;
            }

            final User user = sarosSession.getUser(fromJID);
            if (user == null) {
                log.warn("Received leave message from buddy who"
                    + " is not part of our shared project session: " + fromJID);
                return;
            }

            // FIXME LeaveEvents need to be Activities, otherwise
            // RaceConditions can occur when two users leave a the "same" time

            if (user.isHost()) {
                sessionManager.stopSarosSession();

                SarosView.showNotification(
                    "Closing the session",
                    "Session was closed by inviter "
                        + user.getHumanReadableName() + ".");
            } else {
                // Client
                Utils.runSafeSWTSync(log, new Runnable() {
                    public void run() {
                        // FIXME see above...
View Full Code Here

                }

                ISarosSession sarosSession = sessionManager.getSarosSession();
                assert sarosSession != null;

                User fromUser = sarosSession.getUser(fromJID);

                if (fromUser == null || !fromUser.isHost()) {
                    log.error("Received userList from buddy who "
                        + "is not part of our session or is not host: "
                        + Utils.prefix(fromJID));
                    return;
                }

                // Adding new users
                User newUser;
                for (UserListEntry userEntry : userListInfo.userList) {

                    // Check if we already know this user
                    User user = sarosSession.getUser(userEntry.jid);

                    if (user == null) {
                        // This user is not part of our project
                        newUser = new User(sarosSession, userEntry.jid,
                            userEntry.colorID);
                        newUser.setPermission(userEntry.permission);
                        if (userEntry.invitationComplete)
                            newUser.invitationCompleted();

                        // Add him and send him a message, and tell him our
                        // colour
                        sarosSession.addUser(newUser);
                    } else {
                        // User already exists

                        // Check if the existing user has the colour that we
                        // expect
                        if (user.getColorID() != userEntry.colorID) {
                            log.warn("Received color id doesn't"
                                + " match known color id");
                        }

                        // Update his permission
                        user.setPermission(userEntry.permission);

                        // Update invitation status
                        if (userEntry.invitationComplete
                            && !user.isInvitationComplete()) {
                            sarosSession.userInvitationCompleted(user);
                        }
                    }
                }
                transmitter.sendUserListConfirmation(fromJID);
View Full Code Here

            checkVersion(monitor.newChild(1));

            sendInvitation(monitor.newChild(1));

            User newUser = addUserToSession();

            completeInvitation(monitor.newChild(3), projectExchangeInfos);

            sarosSessionManager.notifyPostOutgoingInvitationCompleted(
                monitor.newChild(1), newUser);
View Full Code Here

     * Adds the invited user to the current SarosSession.<br>
     */
    // TODO move to SarosSession.
    protected User addUserToSession() throws SarosCancellationException {
        synchronized (sarosSession) {
            User newUser = new User(sarosSession, peer, colorID);
            this.sarosSession.addUser(newUser);
            log.debug(Utils.prefix(peer) + " added to project, colorID: "
                + colorID);

            checkCancellation(CancelOption.NOTIFY_PEER);
View Full Code Here

            + ",action:" + action + ")";
    }

    public IActivity getActivity(ISarosSession sarosSession) {

        User user = sarosSession.getUser(source);
        if (user == null)
            throw new IllegalArgumentException("Buddy is not in shared project");

        return new ProgressActivity(user, progressID, workCurrent, workTotal,
            taskName, action);
View Full Code Here

            public void run() {
                List<User> participants = SelectionRetrieverFactory
                    .getSelectionRetriever(User.class).getSelection();

                if (participants.size() == 1) {
                    User toFollow;
                    if (editorManager.getFollowedUser() == participants.get(0)) {
                        toFollow = null;
                    } else {
                        toFollow = participants.get(0);
                    }
View Full Code Here

        this.tree.addListener(SWT.EraseItem, new Listener() {
            public void handleEvent(Event event) {
                event.detail &= ~SWT.HOT;

                if (event.item != null && event.item.getData() != null) {
                    User user = (User) Platform.getAdapterManager().getAdapter(
                        event.item.getData(), User.class);

                    if (event.item instanceof TreeItem && user != null) {
                        GC gc = event.gc;
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.User

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.