Inherits from
- ApplicationWindow: enthought.pyface.application_window.ApplicationWindow
Attributes
- active_editor
The active editor.
This is defined as the most recent editor to receive focus, or None if no editors are open or the previous active editor was closed in a manner that did not cause focus to change to another editor.
active_editor = Instance(Editor)
- active_perspective
The active perspective.
active_perspective = Instance(Perspective)
- active_view
The active view.
This is defined as the most recent view to receive focus, or None if no views are open or the previous active view was closed in a manner that did not cause focus to change to another view.
active_view = Instance(View)
- application
The Envisage application that the window is part of.
fixme: This is Envisage specific should be factored out into a derived class. It is not used in this module, it exists solely to allow views, editors and actions etc. to find the application that they are part of. class.
application = Instance(Application)
- default_perspective_id
The Id of the default perspective. There are two situations in which this is used: 1. 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. 2. 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.envisage.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 = Event(Editor)
- editor_closing
Fired when an editor is about to be closed.
editor_closing = Event(Editor)
- editor_opened
Fired when an editor has been opened (or restored).
editor_opened = Event(Editor)
- editor_opening
Fired when an editor is about to be opened (or restored).
editor_opening = Event(Editor)
- editors
The visible (open) editors.
editors = List(Editor)
- perspectives
The available perspectives. If no perspectives are specified then the default perspective (an instance of 'Perspective' is used).
perspectives = List(Perspective)
- resource_manager
The resource manager used by the window. The resource manager is used to find editors etc.
fixme: Should we replace this with an editor factory? Then this class won't be dependent on Envisage...
resource_manager = Instance(ResourceManager, ())
- selection
The current selection within the window.
selection = List
- state_location
A directory on the local file system that we can read and write to at will. This is used to persist layout information etc.
state_location = Str
- title_suffix
A suffix to be applied to the window title.
fixme: This is horrible! In a plugin world you can't have people adding suffixes to the window title - it just don't scale, errr, at all! This needs to be removed - if you want it in your app then put it in there!
title_suffix = Str
- views
The available views (note that this is all of the views, not just those currently visible).
views = List(View)
- window_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).
window_layout = Instance(WindowLayout)
- workbench
The workbench that created the window.
fixme: This is Envisage specific should be factored out into a derived class. It is not used in this module, it exists solely to allow views, editors and actions etc. to find the workbench that they are part of.
workbench = Instance('enthought.envisage.workbench.workbench.Workbench')
Inherited from base classes
Method summary
- activate_editor(self, editor)
- activate_view(self, view)
- add_editor(self, editor, title = None)
- add_view(self, view, position, relative_to = None, size = (-Const(1), -Const(1)))
- close(self)
- close_editor(self, editor)
- close_view(self, view)
- create_editor(self, resource)
- edit(self, resource, use_existing = True)
- get_editor_by_id(self, id)
- get_editor_by_resource(self, resource)
- get_perspective_by_id(self, id)
- get_view_by_id(self, id)
- hide_editor_area(self)
- hide_view(self, view)
- open(self)
- refresh(self)
- remove_perspective_by_id(self, id)
- reset_editors(self)
- reset_views(self)
- restore_layout(self)
- save_layout(self)
- show_editor_area(self)
- show_view(self, view)
Inherited from base classes
- __deepcopy__(self, memo)
- __getstate__(self)
- __prefix_trait__(self, name)
- __reduce_ex__(self, protocol)
- __setstate__(self, state)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- get(self, *names, **metadata)
- invoke_later(self, callable, *args, **kw)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same')
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- reset_traits(self, traits = None, **metadata)
- set(self, trait_change_notify = True, **traits)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- set_trait_later(self, obj, trait_name, new)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
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, relative_to = None, size = (-Const(1), -Const(1)))
Adds a view.
- close(self)
Closes the window.
Overridden to make the 'closing' event vetoable.
Returns 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, resource)
Creates an editor for a resource.
Returns None if no editor can be created for the resource.
- edit(self, resource, use_existing = True)
Edits a resource.
If 'use_existing' is True and the resource 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_by_id(self, id)
Returns the editor with the specified Id.
Returns None if no such editor exists.
- get_editor_by_resource(self, resource)
Returns the editor that is editing a resource.
Returns None if no such editor exists.
- get_perspective_by_id(self, id)
Returns the perspective with the specified Id.
Returns None if no such perspective exists.
- get_view_by_id(self, id)
Returns the view with the specified Id.
Returns None if no such view exists.
- hide_editor_area(self)
Hides the editor area.
- hide_view(self, view)
Hides a view.
- open(self)
Opens the window.
Overridden to make the 'opening' event vetoable.
Returns True if the window opened successfully; False if the open event was vetoed.
- refresh(self)
Refreshes the window to reflect any changes.
- remove_perspective_by_id(self, id)
Removes the perspective with the specified Id.
- reset_editors(self)
Activates the first editor in every tab.
- reset_views(self)
Activates the first view in every tab.
- restore_layout(self)
Restores the window layout.
- save_layout(self)
Saves the window layout.
- show_editor_area(self)
Shows the editor area.
- show_view(self, view)
Shows a view.