3
8Ad]œ  ã               @   sH   d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd„ deƒZ	d	S )
z‚ Defines the BasicUIEditor class, which allows creating editors that define
    their function by creating an embedded Traits UI.
é    )Úabsolute_import)ÚInstanceé   )ÚUI)ÚEditorc                   sX   e Zd ZdZeeƒZdd„ Zdd„ Zdd„ Z	‡ fdd	„Z
d
d„ Zdd„ Zdd„ Z‡  ZS )ÚUIEditorz3 An editor that creates an embedded Traits UI.
    c             C   s$   | j |ƒj| jd�| _| jj| _dS )za Finishes initializing the editor by creating the underlying toolkit
            widget.
        )ÚparentN)Úinit_uiZ	trait_setÚuiÚ	editor_uiZcontrol)Úselfr   © r   ún/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/traitsui-6.1.2-py3.6.egg/traitsui/ui_editor.pyÚinit7   s    zUIEditor.initc             C   s   | j j| jƒ | j | dœ|d�S )z/ Creates the traits UI for the editor.
        )ÚobjectÚeditor)ÚviewÚcontextr   )ÚvalueZedit_traitsZ
trait_view)r   r   r   r   r   r	   B   s    zUIEditor.init_uic             C   s   dS )z^ Updates the editor when the object trait changes external to the
            editor.
        Nr   )r   r   r   r   Úupdate_editorN   s    zUIEditor.update_editorc                s&   | j dk	r| j jƒ  tt| ƒjƒ  dS )z0 Disposes of the contents of an editor.
        N)r   ÚdisposeÚsuperr   )r   )Ú	__class__r   r   r   Z   s    

zUIEditor.disposec             C   s
   | j jƒ S )zC Returns the editor's control for indicating error status.
        )r   Zget_error_controls)r   r   r   r   Úget_error_controlg   s    zUIEditor.get_error_controlc             C   s   | j j|ƒ dS )z` Restores any saved user preference information associated with the
            editor.
        N)r   Z	set_prefs)r   Zprefsr   r   r   Úrestore_prefss   s    zUIEditor.restore_prefsc             C   s
   | j jƒ S )zM Returns any user preference information associated with the editor.
        )r   Z	get_prefs)r   r   r   r   Ú
save_prefs}   s    zUIEditor.save_prefs)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r	   r   r   r   r   r   Ú__classcell__r   r   )r   r   r   '   s   
r   N)
r   Ú
__future__r   Z
traits.apir   r
   r   r   r   r   r   r   r   r   Ú<module>   s
   