Package javax.swing.text.AbstractDocumentTest

Examples of javax.swing.text.AbstractDocumentTest.DisAbstractedDocument


     * Initializes fixture for tests.
     */
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        doc = new DisAbstractedDocument(new GapContent());
        change = null;
        insert = null;
        remove = null;
        undo = null;
    }
View Full Code Here


    /**
     * Tests which events are fired at text insert
     * when content doesn't support undo.
     */
    public void testInsertString02() throws Exception {
        doc = new DisAbstractedDocument(new NoUndoContent());
        doc.addDocumentListener(this);
        doc.addUndoableEditListener(this);
        doc.insertString(0, "test string\nthe second line", null);
        checkCalledEvents(false, true, false, false);
    }
View Full Code Here

    /**
     * Tests which events are fired at RTL-text insert
     * when content doesn't support undo.
     */
    public void testInsertString03() throws Exception {
        doc = new DisAbstractedDocument(new NoUndoContent());
        doc.addDocumentListener(this);
        doc.addUndoableEditListener(this);
        doc.insertString(0, "\u05DC\u05DD", null);
        checkCalledEvents(false, true, false, false);
        assertNotNull(insert.getChange(doc.getBidiRootElement()));
View Full Code Here

    /**
     * Tests which events are fired at text remove
     * when content doesn't support undo.
     */
    public void testRemove01() throws Exception {
        doc = new DisAbstractedDocument(new NoUndoContent());
        doc.insertString(0, "test string\nthe second line", null);
        doc.addDocumentListener(this);
        doc.addUndoableEditListener(this);
        doc.remove(0, 4);
        checkCalledEvents(false, false, true, false);
View Full Code Here

    /**
     * Tests which events are fired at RTL-text remove
     * when content doesn't support undo.
     */
    public void testRemove02() throws Exception {
        doc = new DisAbstractedDocument(new NoUndoContent());
        doc.insertString(0, "\u05DC\u05DD test string", null);
        doc.addDocumentListener(this);
        doc.addUndoableEditListener(this);
        doc.remove(0, 2);
        checkCalledEvents(false, false, true, false);
View Full Code Here

    /**
     * Tests which events are fired when content support undo for
     * remove but doesn't support one for insert.
     */
    public void testInsertRemove() throws Exception {
        doc = new DisAbstractedDocument(new GapContent() {
            private static final long serialVersionUID = 1L;

            @Override
            public UndoableEdit insertString(int where, String str) throws BadLocationException {
                super.insertString(where, str);
View Full Code Here

        super.setUp();
        StyleContextTest.sc = StyleContext.getDefaultStyleContext();
        as = new AttributeSet[] { StyleContextTest.addAttribute(1),
                StyleContextTest.addAttribute(null, 2, 2),
                StyleContextTest.addAttribute(null, 5, 2) };
        doc = new DisAbstractedDocument(new GapContent());
        doc.insertString(0, "0123456789", as[0]);
        doc.writeLock();
        BranchElement branch = doc.new BranchElement(null, as[1]);
        leaf1 = doc.new LeafElement(null, as[2], 0, 3);
        leaf2 = doc.new LeafElement(branch, as[2], 5, 8);
View Full Code Here

    private AbstractDocument doc;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        doc = new DisAbstractedDocument(new GapContent());
        doc.setDocumentFilter(new Filter());
        // Additional filter
        emptyFilter = new EmptyFilter();
    }
View Full Code Here

     * Initializes fixture for tests.
     */
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        doc = new DisAbstractedDocument(new GapContent());
        change = null;
        insert = null;
        remove = null;
        undo = null;
    }
View Full Code Here

    /**
     * Tests which events are fired at text insert
     * when content doesn't support undo.
     */
    public void testInsertString02() throws Exception {
        doc = new DisAbstractedDocument(new NoUndoContent());
        doc.addDocumentListener(this);
        doc.addUndoableEditListener(this);
        doc.insertString(0, "test string\nthe second line", null);
        checkCalledEvents(false, true, false, false);
    }
View Full Code Here

TOP

Related Classes of javax.swing.text.AbstractDocumentTest.DisAbstractedDocument

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.