exopy.measurement.editors.base_editor module

Base classes for all editors.

class exopy.measurement.editors.base_editor.BaseEditor(parent=None, **kwargs)[source]

Bases: exopy.utils.enaml_destroy_hook.add_destroy_hook.<locals>.Destroyable

Base class for all editors.

declaration

Declaration defining this editor.

selected_task

Currently selected task in the tree.

tree_visible

Should the tree be visible when this editor is selected.

tree_enabled

Should the tree be enabled when this editor is selected.

react_to_selection(workbench)[source]

Take any necessary actions when the editor is selected.

This method is called by the framework at the appropriate time.

Parameters

workbench (Workbench) – Reference to the application workbench.

react_to_unselection(workbench)[source]

Take any necessary actions when the editor is unselected.

This method is called by the framework at the appropriate time.

Parameters

workbench (Workbench) – Reference to the application workbench.

name

A value of type unicode.

By default, plain strings will be promoted to unicode strings. Pass strict=True to the constructor to enable strict unicode checking.

class exopy.measurement.editors.base_editor.Editor(parent=None, **kwargs)[source]

Bases: enaml.core.declarative.Declarative

A declarative class for contributing a measurement editor.

Editor object can be contributed as extensions child to the ‘editors’ extension point of the ‘exopy.measurement’ plugin.

id

Unique name used to identify the editor. The usual format is top_level_package_name.tool_name

description

Editor description.

rank

Rank of this editor. Editors are displayed by rank and alphabetical order

new(workbench, default=True)[source]

Create a new instance of the editor.

Parameters
  • workbench (Workbench) – Reference to the application workbench.

  • default (bool) – Whether to use default parameters or not when creating the object.

is_meant_for(workbench, selected_task)[source]

Determine if the editor is fit to be used for the selected task.

Parameters
  • workbench (Workbench) – Reference to the application workbench.

  • selected_task (BaseTask) – Currently selected task.

Returns

answer

Return type

bool