Inherits from
- ApplicationWindow: enthought.pyface.application_window.ApplicationWindow
Attributes
- active_editor
The active editor.
active_editor = Instance(IEditor)
- active_part
The view or editor that currently has the focus.
active_part = Instance(IWorkbenchPart)
- active_perspective
The active perspective.
active_perspective = Instance(IPerspective)
- active_view
The active view.
active_view = Instance(IView)
- default_perspective_id
The Id of the default perspective.
There are two situations in which this is used:
When the window is being created from scratch (i.e., not restored).
If this is the empty string, then the first perspective in the list of perspectives is shown (if there are no perspectives then an instance of the default 'Perspective' class is used). If this is not the empty string then the perspective with this Id is shown.
When the window is being restored.
If this is the empty string, then the last perspective that was visible when the window last closed is shown. If this is not the empty string then the perspective with this Id is shown.
default_perspective_id = Str
- editor_area_id
The Id of the editor area.
editor_area_id = Constant('enthought.pyface.workbench.editors')
- editor_area_size
The (initial) size of the editor area (the user is free to resize it of course).
editor_area_size = Tuple((100, 100))
- editor_closed
Fired when an editor has been closed.
editor_closed = Delegate('layout')
- editor_closing
Fired when an editor is about to be closed.
editor_closing = Delegate('layout')
- editor_manager
The editor manager is used to create/restore editors.
editor_manager = Instance(IEditorManager)
- editor_opened
Fired when an editor has been opened (or restored).
editor_opened = Delegate('layout')
- editor_opening
Fired when an editor is about to be opened (or restored).
editor_opening = Delegate('layout')
- editors
The visible (open) editors.
editors = List(IEditor)
- layout
The window layout is responsible for creating and managing the internal structure of the window (i.e., it knows how to add and remove views and editors etc).
layout = Instance(WorkbenchWindowLayout)
- perspectives
The available perspectives. If no perspectives are specified then the a single instance of the 'Perspective' class is created.
perspectives = List(IPerspective)
- selection
The current selection within the window.
selection = List
- views
The available views (note that this is all of the views, not just those currently visible).
Views cannot be shared between windows as each view has a reference to its toolkit-specific control etc.
views = List(IView)
- workbench
The workbench that the window belongs to.
workbench = Instance('enthought.pyface.workbench.api.IWorkbench')
Method summary
- activate_editor(self, editor)
- activate_view(self, view)
- add_editor(self, editor, title = None)
- add_view(self, view, position = None, relative_to = None, size = (-Const(1), -Const(1)))
- close(self)
- close_editor(self, editor)
- close_view(self, view)
- create_editor(self, obj, kind = None)
- destroy_editors(self, editors)
- destroy_views(self, views)
- edit(self, obj, kind = None, use_existing = True)
- get_editor(self, obj, kind = None)
- get_editor_by_id(self, id)
- get_memento(self)
- get_part_by_id(self, id)
- get_perspective_by_id(self, id)
- get_perspective_by_name(self, name)
- get_view_by_id(self, id)
- hide_editor_area(self)
- hide_view(self, view)
- open(self)
- refresh(self)
- reset_active_perspective(self)
- reset_all_perspectives(self)
- reset_editors(self)
- reset_views(self)
- set_memento(self, memento)
- show_editor_area(self)
- show_view(self, view)
Methods
- activate_editor(self, editor)
Activates an editor.
- activate_view(self, view)
Activates a view.
- add_editor(self, editor, title = None)
Adds an editor.
If no title is specified, the editor's name is used.
- add_view(self, view, position = None, relative_to = None, size = (-Const(1), -Const(1)))
Adds a view.
- close(self)
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.
- close_editor(self, editor)
Closes an editor.
- close_view(self, view)
Closes a view.
fixme: Currently views are never 'closed' in the same sense as an editor is closed. Views are merely hidden.
- create_editor(self, obj, kind = None)
Create an editor for an object.
Return None if no editor can be created for the object.
- destroy_editors(self, editors)
Destroy a list of editors.
- destroy_views(self, views)
Destroy a list of views.
- edit(self, obj, kind = None, use_existing = True)
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(self, obj, kind = None)
Return the editor that is editing an object.
Return None if no such editor exists.
- get_editor_by_id(self, id)
Return the editor with the specified Id.
Return None if no such editor exists.
- get_memento(self)
Return the state of the window suitable for pickling etc.
- get_part_by_id(self, id)
Return the workbench part with the specified Id.
Return None if no such part exists.
- get_perspective_by_id(self, id)
Return the perspective with the specified Id.
Return None if no such perspective exists.
- get_perspective_by_name(self, name)
Return the perspective with the specified name.
Return None if no such perspective exists.
- get_view_by_id(self, id)
Return the view with the specified Id.
Return None if no such view exists.
- hide_editor_area(self)
Hide the editor area.
- hide_view(self, view)
Hide a view.
- open(self)
Open the window.
Overridden to make the 'opening' event vetoable.
Return True if the window opened successfully; False if the open event was vetoed.
- refresh(self)
Refresh the window to reflect any changes.
- reset_active_perspective(self)
Reset the active perspective back to its original contents.
- reset_all_perspectives(self)
Reset all perspectives back to their original contents.
- reset_editors(self)
Activate the first editor in every tab.
- reset_views(self)
Activate the first view in every tab.
- set_memento(self, memento)
Restore the state of the window from a memento.
- show_editor_area(self)
Show the editor area.
- show_view(self, view)
Show a view.