Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.Document.replace()


        Document doc = new Document();
        PyEditStub pyEdit = new PyEditStub(doc, new PydevFileEditorInputStub());
        pyParserManager.attachParserTo(pyEdit);
        checkParserChanged(pyEdit, 1);

        doc.replace(0, 0, "\r\ntest");
        checkParserChanged(pyEdit, 2);

        pyParserManager.attachParserTo(pyEdit);
        checkParserChanged(pyEdit, 3);
View Full Code Here


        checkParserChanged(pyEdit, 2);

        pyParserManager.attachParserTo(pyEdit);
        checkParserChanged(pyEdit, 3);

        doc.replace(0, 0, "\r\ntest"); //after this change, only 1 reparse should be asked, as the editor and doc is the same
        checkParserChanged(pyEdit, 4);

        pyParserManager.notifyEditorDisposed(pyEdit);
        doc.replace(0, 0, "\r\ntest"); //after this change, only 1 reparse should be asked, as the editor and doc is the same
        waitABit();
View Full Code Here

        doc.replace(0, 0, "\r\ntest"); //after this change, only 1 reparse should be asked, as the editor and doc is the same
        checkParserChanged(pyEdit, 4);

        pyParserManager.notifyEditorDisposed(pyEdit);
        doc.replace(0, 0, "\r\ntest"); //after this change, only 1 reparse should be asked, as the editor and doc is the same
        waitABit();
        assertEquals(4, pyEdit.parserChanged);

        assertEquals(0, pyParserManager.getParsers().size());
    }
View Full Code Here

        PyEditStub pyEdit1 = new PyEditStub(doc, input);
        PyEditStub pyEdit2 = new PyEditStub(doc, input);
        pyParserManager.attachParserTo(pyEdit1);
        checkParserChanged(pyEdit1, 1);

        doc.replace(0, 0, "\r\ntest");
        checkParserChanged(pyEdit1, 2);

        pyParserManager.attachParserTo(pyEdit2);
        checkParserChanged(pyEdit1, 3);
        checkParserChanged(pyEdit2, 1);
View Full Code Here

        checkParserChanged(pyEdit1, 3);
        checkParserChanged(pyEdit2, 2);

        assertNull(pyParserManager.getParser(pyEdit1));
        doc2.replace(0, 0, "\r\ntest");
        checkParserChanged(pyEdit1, 3);
        checkParserChanged(pyEdit2, 3);

        doc.replace(0, 0, "\r\ntest"); //no one's listening this one anymore
        waitABit();
View Full Code Here

        checkParserChanged(pyEdit1, 3);
        checkParserChanged(pyEdit2, 3);

        pyParserManager.notifyEditorDisposed(pyEdit2);
        assertNull(pyParserManager.getParser(pyEdit2));
        doc2.replace(0, 0, "\r\ntest"); //no one's listening this one anymore
        doc.replace(0, 0, "\r\ntest"); //no one's listening this one anymore
        waitABit();
        checkParserChanged(pyEdit1, 3);
        checkParserChanged(pyEdit2, 3);
        assertEquals(0, pyParserManager.getParsers().size());
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.