@Test public void testReset() { this.undoManager.undoableEditHappened(this.managedModel); this.undoManager.undoableEditHappened(this.managedModel); this.undoManager.undo(); Assert.assertTrue(this.undoManager.canUndo()); Assert.assertTrue(this.undoManager.canRedo()); this.undoManager.reset(this.managedModel); Assert.assertFalse(this.undoManager.canUndo()); Assert.assertFalse(this.undoManager.canRedo()); this.managedModel.changeState(); this.undoManager.undoableEditHappened(this.managedModel); Assert.assertEquals(UndoManagerTest.MODEL_CLONE, this.undoManager.undo()); }
public void reset(final M initialState) { this.availableRedos.clear(); this.availableUndos.clear(); this.availableUndos.add(initialState.clone()); }
UndoManager { public void reset(final M initialState) { this.availableRedos.clear(); this.availableUndos.clear(); this.availableUndos.add(initialState.clone()); } }
UndoManager { public void reset(final M initialState) { this.availableRedos.clear(); this.availableUndos.clear(); this.availableUndos.add(initialState.clone()); } UndoManager(final M initialState); }
UndoManager { public void reset(final M initialState) { this.availableRedos.clear(); this.availableUndos.clear(); this.availableUndos.add(initialState.clone()); } UndoManager(final M initialState); void reset(final M initialState); void setLimit(final int limit); void undoableEditHappened(final M changedState); M undo(); M redo(); boolean canUndo(); boolean canRedo(); }
UndoManager { public void reset(final M initialState) { this.availableRedos.clear(); this.availableUndos.clear(); this.availableUndos.add(initialState.clone()); } UndoManager(final M initialState); void reset(final M initialState); void setLimit(final int limit); void undoableEditHappened(final M changedState); M undo(); M redo(); boolean canUndo(); boolean canRedo();  }