3
7ßL]H  ã               @   s0   d dl mZmZ d dlmZ G dd„ deƒZdS )é    )Ú	HasTraitsÚInstance)ÚEditorc                   s@   e Zd ZdZeeƒZedƒZ‡ fdd„Zdd„ Z	dd„ Z
‡  ZS )	ÚTraitsEditorz/ An Editor that displays a Traits UI View.
    ztraitsui.ui.UIc                s    | j r| j | dœS tt| ƒjƒ S )zI Use the model object for the Traits UI context, if appropriate.
        )ÚobjectÚeditor)ÚmodelÚsuperr   Útrait_context)Úself)Ú	__class__© ú>/tmp/pip-install-5sebvq2j/pyface/pyface/tasks/traits_editor.pyr
      s    zTraitsEditor.trait_contextc             C   s   | j d|d�| _| jj| _dS )zE Create and set the toolkit-specific contents of the editor.
        Zsubpanel)ÚkindÚparentN)Zedit_traitsÚuiÚcontrol)r   r   r   r   r   Úcreate#   s    zTraitsEditor.createc             C   s$   d| _ | jdk	r| jjƒ  d| _dS )zJ Destroy the toolkit-specific control that represents the editor.
        N)r   r   Zdispose)r   r   r   r   Údestroy)   s    

zTraitsEditor.destroy)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r
   r   r   Ú__classcell__r   r   )r   r   r      s   r   N)Z
traits.apir   r   Zpyface.tasks.editorr   r   r   r   r   r   Ú<module>   s   