Package de.fu_berlin.inf.dpp.activities

Examples of de.fu_berlin.inf.dpp.activities.SPath


            log.warn("Could not find path for editor " + editorPart.getTitle());
            return null;
        }

        // TODO Remove should remove empty HashSets
        if (!getEditors(new SPath(file)).remove(editorPart)) {
            log.error("EditorPart was never added to the EditorPool: "
                + editorPart.getTitle());
            return null;
        }
View Full Code Here


                    return;
                }

                EditorManager.log.debug("Dirty state reset for: "
                    + file.toString());
                editorManager.sendEditorActivitySaved(new SPath(file));
            }
        });
    }
View Full Code Here

        this.clientDocs.clear();
    }

    public synchronized JupiterActivity generate(TextEditActivity textEdit) {

        SPath path = textEdit.getPath();
        return get(path).generateJupiterActivity(textEdit.toOperation(),
            sarosSession.getLocalUser(), path);
    }
View Full Code Here

        this.param1 = param1;
        this.containedActivity = containedActivity;
    }

    public IActivity getActivity(ISarosSession sarosSession) {
        SPath sPath = path == null ? null : path.toSPath(sarosSession);
        User user = sarosSession == null ? null : sarosSession.getUser(source);
        final VCSActivity vcsActivity = new VCSActivity(type, user, sPath, url,
            directory, param1);
        vcsActivity.containedActivity.ensureCapacity(containedActivity.size());
        for (IResourceActivityDataObject ado : containedActivity) {
View Full Code Here

        activityDataObject.dispatch(activityReceiver);
    }

    protected boolean isInconsistent(ChecksumActivity checksum) {

        SPath path = checksum.getPath();
        IFile file = path.getFile();

        if (!checksum.existsFile()) {
            /*
             * If the checksum tells us that the file does not exist at the
             * host, check whether we still have it. If it exists, we do have an
             * inconsistency
             */
            return file.exists();
        }

        /*
         * If the checksum tells us, that the file exists, but we do not have
         * it, it is an inconsistency as well
         */
        if (!file.exists()) {
            return true;
        }

        FileEditorInput input = new FileEditorInput(file);
        IDocumentProvider provider = EditorManager.getDocumentProvider(input);

        try {
            provider.connect(input);
        } catch (CoreException e) {
            log.warn("Could not check checksum of file " + path.toString());
            return false;
        }

        try {
            IDocument doc = provider.getDocument(input);

            // if doc is still null give up
            if (doc == null) {
                log.warn("Could not check checksum of file " + path.toString());
                return false;
            }

            if ((doc.getLength() != checksum.getLength())
                || (doc.get().hashCode() != checksum.getHash())) {

                log.debug(String.format(
                    "Inconsistency detected: %s L(%d %s %d) H(%x %s %x)", path
                        .toString(), doc.getLength(),
                    doc.getLength() == checksum.getLength() ? "==" : "!=",
                    checksum.getLength(), doc.get().hashCode(), doc.get()
                        .hashCode() == checksum.getHash() ? "==" : "!=",
                    checksum.getHash()));
View Full Code Here

        if (this.sarosSession == null) {
            log.warn("SharedEditorListener not correctly unregistered!");
            return;
        }

        SPath path = editorAPI.getEditorPath(part);
        if (path == null) {
            log.warn("Could not find path for editor " + part.getTitle());
            return;
        }

        if (path.equals(locallyActiveEditor))
            this.localViewport = viewport;

        fireActivity(new ViewportActivity(sarosSession.getLocalUser(),
            viewport, path));
View Full Code Here

     *            The ITextSelection in the given part which represents the
     *            currently selected text in editor.
     */
    public void generateSelection(IEditorPart part, ITextSelection newSelection) {

        SPath path = editorAPI.getEditorPath(part);
        if (path == null) {
            log.warn("Could not find path for editor " + part.getTitle());
            return;
        }

        if (path.equals(locallyActiveEditor))
            localSelection = newSelection;

        int offset = newSelection.getOffset();
        int length = newSelection.getLength();

View Full Code Here

        if (changedEditor == null) {
            log.error("Could not find editor for changed document " + document);
            return;
        }

        SPath path = editorAPI.getEditorPath(changedEditor);
        if (path == null) {
            log.warn("Could not find path for editor "
                + changedEditor.getTitle());
            return;
        }
View Full Code Here

        activity.dispatch(activityReceiver);
    }

    protected void execEditorActivity(EditorActivity editorActivity) {
        User sender = editorActivity.getSource();
        SPath sPath = editorActivity.getPath();
        switch (editorActivity.getType()) {
        case Activated:
            execActivated(sender, sPath);
            break;
        case Closed:
View Full Code Here

    protected void execTextEdit(TextEditActivity textEdit) {

        log.trace("EditorManager.execTextEdit invoked");

        SPath path = textEdit.getPath();
        IFile file = path.getFile();

        if (!file.exists()) {
            log.error("TextEditActivity refers to file which"
                + " is not available locally: " + textEdit);
            // TODO A consistency check can be started here
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.activities.SPath

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.