Package de.fu_berlin.inf.dpp.editor.RemoteEditorManager

Examples of de.fu_berlin.inf.dpp.editor.RemoteEditorManager.RemoteEditor


        /*
         * If the opened editor is not the active editor of the user being
         * followed, then leave follow mode
         */
        if (isFollowing()) {
            RemoteEditor activeEditor = remoteEditorManager.getEditorState(
                getFollowedUser()).getActiveEditor();

            if (activeEditor != null
                && !activeEditor.getPath().equals(
                    editorAPI.getEditorPath(editorPart))) {
                setFollowing(null);
                // follower switched to another shared editor or closed followed
                // editor (shared editor gets activated)
                SarosView
View Full Code Here


    protected void partClosedOfPath(IEditorPart editorPart, SPath path) {

        // if closing the followed editor, leave follow mode
        if (getFollowedUser() != null) {
            RemoteEditor activeEditor = remoteEditorManager.getEditorState(
                getFollowedUser()).getActiveEditor();

            if (activeEditor != null && activeEditor.getPath().equals(path)) {
                // follower closed the followed editor (no other editor gets
                // activated)
                setFollowing(null);
                SarosView.showNotification("Follow mode stopped!",
                    "You closed the followed editor.");
View Full Code Here

            if (!(remoteEditorState.isRemoteOpenEditor(path) && remoteEditorState
                .isRemoteActiveEditor(path))) {
                continue;
            }

            RemoteEditor remoteEditor = remoteEditorState.getRemoteEditor(path);

            if (user.hasWriteAccess() || user.equals(followedUser)) {
                ILineRange viewport = remoteEditor.getViewport();
                if (viewport != null) {
                    editorAPI.setViewportAnnotation(editorPart, viewport, user);
                }
            }

            ITextSelection selection = remoteEditor.getSelection();
            if (selection != null) {
                editorAPI.setSelection(editorPart, selection, user, false);
            }
        }
    }
View Full Code Here

        }
    }

    public void jumpToUser(User jumpTo) {

        RemoteEditor activeEditor = remoteEditorManager.getEditorState(jumpTo)
            .getActiveEditor();

        // you can't follow yourself
        if (sarosSession.getLocalUser().equals(jumpTo))
            return;

        if (activeEditor == null) {
            log.info(Utils.prefix(jumpTo.getJID()) + "has no editor open");
            // no active editor on target subject
            SarosView.showNotification("Following " + jumpTo.getJID().getBase()
                + "!", jumpTo.getJID().getName()
                + " has no shared file opened yet.");
            return;
        }

        IEditorPart newEditor = this.editorAPI.openEditor(activeEditor
            .getPath());

        if (newEditor == null) {
            return;
        }

        ILineRange viewport = activeEditor.getViewport();

        if (viewport == null) {
            log.warn(Utils.prefix(jumpTo.getJID())
                + "has no viewport in editor: " + activeEditor.getPath());
            return;
        }

        this.editorAPI.reveal(newEditor, viewport);
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.editor.RemoteEditorManager.RemoteEditor

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.