Package javax.swing.undo

Examples of javax.swing.undo.AbstractUndoableEdit


        caught = ex;
      }
    harness.check(caught instanceof CannotRedoException);

    // Check #3: Exception for dead edit.
    AbstractUndoableEdit aue = new AbstractUndoableEdit();
    aue.undo();
    aue.die();
    try
      {
        aue.redo();
        caught = null;
      }
    catch (Exception ex)
      {
        caught = ex;
View Full Code Here


public class canUndo
  implements Testlet
{
  public void test(TestHarness harness)
  {
    AbstractUndoableEdit edit;

    edit = new AbstractUndoableEdit();

    // Check #1.
    harness.check(edit.canUndo());  

    // Check #2.
    edit.undo();
    harness.check(!edit.canUndo());

    // Check #3.
    edit.redo();
    harness.check(edit.canUndo());

    // Check #4.
    edit.die();
    harness.check(!edit.canUndo());
  }
View Full Code Here

     */
    public void testToString() {
        String ref = "[";
        Vector<?> edits = getEdits(insert);
        for (int i = 0; i < edits.size(); i++) {
            AbstractUndoableEdit edit = (AbstractUndoableEdit) edits.get(i);
            if (i != 0) {
                ref += ", ";
            }
            ref += edit.toString();
        }
        ref += "]";
        assertEquals(ref, insert.toString());
    }
View Full Code Here

            return null;
        }
    };

    public void testFireUndoableEditUpdate() {
        UndoableEditEvent undoEvent = new UndoableEditEvent(doc, new AbstractUndoableEdit());
        doc.addUndoableEditListener(this);
        doc.fireUndoableEditUpdate(undoEvent);
        checkCalledEvents(false, false, false, true);
        assertSame(undoEvent, undo);
    }
View Full Code Here

        UndoableEditEvent event = new UndoableEditEvent(source, null);
        assertEquals(source, event.getSource());
    }

    public void testGetEdit() throws Exception {
        UndoableEdit edit = new AbstractUndoableEdit();
        UndoableEditEvent event = new UndoableEditEvent(source, edit);
        assertEquals(edit, event.getEdit());
    }
View Full Code Here

        assertEquals(edit, event.getEdit());
    }

    public void testEventProperlyInitialized() throws Exception {
        UndoableEditEvent event = new UndoableEditEvent(new Object(),
                new AbstractUndoableEdit());
        assertNotNull(event.getSource());
        assertNotNull(event.getEdit());
    }
View Full Code Here

            // check if the update level allows us to set the new name.
            if (renameUpdateLevel < 0 || updateLevel <= renameUpdateLevel) {

                renameUpdateLevel = updateLevel;

                presentationNamingEdit = new AbstractUndoableEdit() {
                    private static final long serialVersionUID = -48210551859313000L;

                    public String getPresentationName() {
                        return newName;
                    }
View Full Code Here

  public RelationshipUndoableEdit(DbRelationship relationship) {
    this.relationship = relationship;
  }

  public void addDbJoinAddUndo(final DbJoin join) {
    this.addEdit(new AbstractUndoableEdit() {
     

      @Override
      public void redo() throws CannotRedoException {
        relationship.addJoin(join);
View Full Code Here

      }
    });
  }

  public void addDbJoinRemoveUndo(final DbJoin join) {
    this.addEdit(new AbstractUndoableEdit() {

     

      @Override
      public void redo() throws CannotRedoException {
View Full Code Here

    });
  }

  public void addNameUndo(final DbRelationship relationship,
      final String oldName, final String newName) {
    this.addEdit(new AbstractUndoableEdit() {

     

      @Override
      public void redo() throws CannotRedoException {
View Full Code Here

TOP

Related Classes of javax.swing.undo.AbstractUndoableEdit

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.