Package javax.swing.undo

Examples of javax.swing.undo.UndoableEdit.undo()


        assertEquals(3, pos.getOffset());
    }

    public void testCreatePositionAfterUndone() throws BadLocationException {
        UndoableEdit ue = content.remove(3, 8);
        ue.undo();
        Position pos = content.createPosition(5);
        assertEquals(5, pos.getOffset());
        ue.redo();
        assertEquals(3, pos.getOffset());
        ue.undo();
View Full Code Here


        ue.undo();
        Position pos = content.createPosition(5);
        assertEquals(5, pos.getOffset());
        ue.redo();
        assertEquals(3, pos.getOffset());
        ue.undo();
        assertEquals(5, pos.getOffset());
    }

    public void testCreatePositionAfterInsert() throws BadLocationException {
        UndoableEdit ue = content.insertString(10, "big ");
View Full Code Here

    public void testCreatePositionAfterInsert() throws BadLocationException {
        UndoableEdit ue = content.insertString(10, "big ");
        Position pos = content.createPosition(12);
        assertEquals(12, pos.getOffset());
        ue.undo();
        assertEquals(10, pos.getOffset());
        ue.redo();
        assertEquals(12, pos.getOffset());
    }
View Full Code Here

        int[] offsets = new int[v.size()];
        for (int i = 0; i < pos.size(); i++) {
            offsets[i] = pos.get(i).getOffset();
        }
        UndoableEdit ue = content.remove(0, 9);
        ue.undo();
        for (int i = 0; i < pos.size(); i++) {
            assertEquals(offsets[i], pos.get(i).getOffset());
        }
    }
View Full Code Here

        insertEdit = content.insertString(0, "01234");
    }

    public void testUndoInsertEnd() throws BadLocationException {
        UndoableEdit ue = content.insertString(5, "567");
        ue.undo();
        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoInsertStart() throws BadLocationException {
        UndoableEdit ue = content.insertString(0, "321");
View Full Code Here

        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoInsertStart() throws BadLocationException {
        UndoableEdit ue = content.insertString(0, "321");
        ue.undo();
        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoInsertMiddle() throws BadLocationException {
        UndoableEdit ue = content.insertString(3, "999");
View Full Code Here

        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoInsertMiddle() throws BadLocationException {
        UndoableEdit ue = content.insertString(3, "999");
        ue.undo();
        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoRemoveEnd() throws BadLocationException {
        UndoableEdit ue = content.remove(3, 2);
View Full Code Here

        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoRemoveEnd() throws BadLocationException {
        UndoableEdit ue = content.remove(3, 2);
        ue.undo();
        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoRemoveStart() throws BadLocationException {
        UndoableEdit ue = content.remove(0, 2);
View Full Code Here

        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoRemoveStart() throws BadLocationException {
        UndoableEdit ue = content.remove(0, 2);
        ue.undo();
        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoRemoveMiddle() throws BadLocationException {
        UndoableEdit ue = content.remove(3, 2);
View Full Code Here

        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoRemoveMiddle() throws BadLocationException {
        UndoableEdit ue = content.remove(3, 2);
        ue.undo();
        assertEquals("01234\n", content.getString(0, content.length()));
    }

    public void testUndoPresentationInsertName() {
        final String name = BasicSwingTestCase.isHarmony() ? "addition" : "";
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.