pyface.workbench.workbench_window module

A workbench window.

class pyface.workbench.workbench_window.WorkbenchWindow[source]

Bases: ApplicationWindow

A workbench window.

open()[source]

Open the window.

Overridden to make the ‘opening’ event vetoable.

Return True if the window opened successfully; False if the open event was vetoed.

close()[source]

Closes the window.

Overridden to make the ‘closing’ event vetoable.

Return True if the window closed successfully (or was not even open!), False if the close event was vetoed.

activate_editor(editor)[source]

Activates an editor.

activate_view(view)[source]

Activates a view.

add_editor(editor, title=None)[source]

Adds an editor.

If no title is specified, the editor’s name is used.

add_view(view, position=None, relative_to=None, size=(-1, -1))[source]

Adds a view.

close_editor(editor)[source]

Closes an editor.

close_view(view)[source]

Closes a view.

fixme: Currently views are never ‘closed’ in the same sense as an editor is closed. Views are merely hidden.

create_editor(obj, kind=None)[source]

Create an editor for an object.

Return None if no editor can be created for the object.

destroy_editors(editors)[source]

Destroy a list of editors.

destroy_views(views)[source]

Destroy a list of views.

edit(obj, kind=None, use_existing=True)[source]

Edit an object.

‘kind’ is simply passed through to the window’s editor manager to allow it to create a particular kind of editor depending on context etc.

If ‘use_existing’ is True and the object is already being edited in the window then the existing editor will be activated (i.e., given focus, brought to the front, etc.).

If ‘use_existing’ is False, then a new editor will be created even if one already exists.

get_editor(obj, kind=None)[source]

Return the editor that is editing an object.

Return None if no such editor exists.

get_editor_by_id(id)[source]

Return the editor with the specified Id.

Return None if no such editor exists.

get_part_by_id(id)[source]

Return the workbench part with the specified Id.

Return None if no such part exists.

get_perspective_by_id(id)[source]

Return the perspective with the specified Id.

Return None if no such perspective exists.

get_perspective_by_name(name)[source]

Return the perspective with the specified name.

Return None if no such perspective exists.

get_view_by_id(id)[source]

Return the view with the specified Id.

Return None if no such view exists.

hide_editor_area()[source]

Hide the editor area.

hide_view(view)[source]

Hide a view.

refresh()[source]

Refresh the window to reflect any changes.

reset_active_perspective()[source]

Reset the active perspective back to its original contents.

reset_all_perspectives()[source]

Reset all perspectives back to their original contents.

reset_editors()[source]

Activate the first editor in every tab.

reset_views()[source]

Activate the first view in every tab.

show_editor_area()[source]

Show the editor area.

show_view(view)[source]

Show a view.

get_memento()[source]

Return the state of the window suitable for pickling etc.

set_memento(memento)[source]

Restore the state of the window from a memento.