Пример #1
0
 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)
Пример #2
0
    def _undo_manager_default(self):
        """ Trait initializer. """

        # We make sure the undo package is entirely optional.
        try:
            from apptools.undo.api import UndoManager
        except ImportError:
            return None

        return UndoManager()
Пример #3
0
 def _undo_manager_default(self):
     return UndoManager()
    def _undo_manager_default(self):
        from apptools.undo.api import UndoManager

        undo_manager = UndoManager()
        return undo_manager
Пример #5
0
    def setUp(self):
        self.stack = CommandStack()
        undo_manager = UndoManager()
        self.stack.undo_manager = undo_manager

        self.command = SimpleCommand()
Пример #6
0
 def _undo_manager_default(self):
     """ Return the default undo manager """
     from apptools.undo.api import UndoManager
     undo_manager = UndoManager(active_stack=self.command_stack)
     self.command_stack.undo_manager = undo_manager
     return undo_manager