3
AAd]‡  ã               @   sP   d dl mZmZmZmZmZmZmZmZ ddl	m
Z
 ee
ƒG dd„ deƒƒZdS )é    )ÚBoolÚEventÚ	HasTraitsÚInstanceÚIntÚPropertyÚUnicodeÚprovidesé   )ÚIUndoManagerc               @   sh   e Zd ZdZedƒZeeƒZee	ƒZ
eZeZee	ƒZdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ ZdS )ÚUndoManagerz\ The UndoManager class is the default implementation of the
    IUndoManager interface.
    zapptools.undo.api.ICommandStackc             C   s   | j dk	r| j jƒ  dS )z; Redo the last undone command of the active command stack. N)Úactive_stackÚredo)Úself© r   úv/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/apptools-4.4.0-py3.6.egg/apptools/undo/undo_manager.pyr   B   s    
zUndoManager.redoc             C   s   | j dk	r| j jƒ  dS )z4 Undo the last command of the active command stack. N)r   Úundo)r   r   r   r   r   H   s    
zUndoManager.undoc             C   s
   || _ dS )z+ Handle a different stack becoming active. N)Ústack_updated)r   Únewr   r   r   Ú_active_stack_changedR   s    z!UndoManager._active_stack_changedc             C   s   | j dkrd}n| j j}|S )z Get the current clean state. NT)r   Úclean)r   Úactive_stack_cleanr   r   r   Ú_get_active_stack_cleanX   s    
z#UndoManager._get_active_stack_cleanc             C   s   | j dkrd}n| j j}|S )z Get the current redo name. NÚ )r   Ú	redo_name)r   r   r   r   r   Ú_get_redo_nameb   s    
zUndoManager._get_redo_namec             C   s   | j dkrd}n| j j}|S )z Get the current undo name. Nr   )r   Ú	undo_name)r   r   r   r   r   Ú_get_undo_namel   s    
zUndoManager._get_undo_nameN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   Zsequence_nrr   r   r   r   r   r   r   r   r   r   r   r   r   r      s   


r   N)Z
traits.apir   r   r   r   r   r   r   r	   Zi_undo_managerr   r   r   r   r   r   Ú<module>   s   (