def setUp(self): self.stack = CommandStack() self.undo_manager = UndoManager() self.stack.undo_manager = self.undo_manager self.undo_manager.active_stack = self.stack self.command = SimpleCommand()
def setUp(self): self.undo_manager = UndoManager() self.undo_manager.undo = MagicMock() self.undo_manager.redo = MagicMock() self.component = Component() self.tool = UndoTool(component=self.component, undo_manager=self.undo_manager) self.component.tools.append(self.tool)
def _undo_manager_default(self): """ Trait initializer. """ # We make sure the undo package is entirely optional. try: from pyface.undo.api import UndoManager except ImportError: return None return UndoManager()
def _manager_default(self): manager = UndoManager() return manager
def setUp(self): self.stack = CommandStack() undo_manager = UndoManager() self.stack.undo_manager = undo_manager self.command = SimpleCommand()
def _undo_manager_default(self): return UndoManager()