Examples of undo()


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

    public void testCreatePositionAfterUndone() throws BadLocationException {
        UndoableEdit undoable;
        content = new StringContent(10);
        content.insertString(0, "0123456789");
        undoable = content.remove(3, 5);
        undoable.undo();
        Position pos = content.createPosition(5);
        assertEquals(5, pos.getOffset());
        undoable.redo();
        assertEquals(3, pos.getOffset());
        undoable.undo();
View Full Code Here

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

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

    public void testCreatePositionAfterInsert() throws BadLocationException {
        UndoableEdit undoable;
View Full Code Here

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

        content = new StringContent(10);
        content.insertString(0, "0123456789");
        undoable = content.insertString(10, "big ");
        Position pos = content.createPosition(12);
        assertEquals(12, pos.getOffset());
        undoable.undo();
        assertEquals(10, pos.getOffset());
        undoable.redo();
        assertEquals(12, pos.getOffset());
    }
View Full Code Here

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

        UndoableEdit ue = content.insertString(2, "^^^");
        assertNotNull(ue);
        content.getChars(0, content.length(), text);
        assertEquals(20, text.array.length);
        assertEquals("01^^^2345\n", content.getString(0, content.length()));
        ue.undo();
        assertEquals("012345\n", content.getString(0, content.length()));
        ue.redo();
        assertEquals("01^^^2345\n", content.getString(0, content.length()));
    }
View Full Code Here

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

        assertEquals(redoName, undoable.getRedoPresentationName());
        assertEquals(undoName, undoable.getUndoPresentationName());
        assertTrue(undoable.isSignificant());
        assertFalse(undoable.canRedo());
        assertTrue(undoable.canUndo());
        undoable.undo();
        assertTrue(undoable.canRedo());
        assertFalse(undoable.canUndo());
        undoable.redo();
        assertFalse(undoable.canRedo());
        assertTrue(undoable.canUndo());
View Full Code Here

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

        content.getChars(0, content.length(), text);
        assertEquals(8, text.count);
        assertEquals(20, text.array.length);
        assertNotNull(undoable);
        assertEquals("0111111\n", content.getString(0, content.length()));
        undoable.undo();
        assertEquals("012345^11111\n", content.getString(0, content.length()));
        undoable.redo();
        assertEquals("0111111\n", content.getString(0, content.length()));
    }
View Full Code Here

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

        assertEquals(redoName, undoable.getRedoPresentationName());
        assertEquals(undoName, undoable.getUndoPresentationName());
        assertTrue(undoable.isSignificant());
        assertFalse(undoable.canRedo());
        assertTrue(undoable.canUndo());
        undoable.undo();
        assertTrue(undoable.canRedo());
        assertFalse(undoable.canUndo());
        undoable.redo();
        assertFalse(undoable.canRedo());
        assertTrue(undoable.canUndo());
View Full Code Here

Examples of journal.io.api.Journal.undo()

            assertEquals("DATA" + i++, new String(record, "UTF-8"));
        }

        // Replay the journal backward by undoing:
        int j = 1000;
        for (Location location : journal.undo()) {
            byte[] record = journal.read(location, Journal.ReadType.ASYNC);
            assertEquals("DATA" + --i, new String(record, "UTF-8"));
        }

        // Delete locations:
View Full Code Here

Examples of lpa.command.Command.undo()

                if (apply_strategies) {
                    CompoundCommand c = grid.applyStrategies();
                    if (!undoStack.isEmpty()) {
                        Command last_edge_action = undoStack.pop();
                        last_edge_action.undo();
                        c.add(last_edge_action);
                    }
                    c.execute();
                    undoStack.add(c);
                }
View Full Code Here

Examples of net.sf.rej.gui.Undoable.undo()

    }

    public void undo() {
        for (int i = this.actions.size() - 1; i >= 0; i--) {
            Undoable action = this.actions.get(i);
            action.undo();
        }
    }

    public boolean isEmpty() {
        return this.actions.isEmpty();
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.