Inherits from
- HasTraits: enthought.traits.has_traits.HasTraits
Attributes
- active_window
The active workbench window (the last one to get focus).
active_window = Instance(Window)
- application
The Envisage application that the workbench is part of.
application = Instance(Application)
- branding
Application branding information.
branding = Instance(Branding)
- default_perspective_id
The Id of the default perspective.
default_perspective_id = Str
- exited
Fired when the workbench has exited.
exited = Event
- exiting
Fired when the workbench is about to exit.
This can be caused by either:-
- The 'exit' method being called.
- The last open window being closed.
exiting = VetoableEvent
- perspectives
The perspectives available in the workbench.
perspectives = List(Perspective)
- preferences
User preferences.
fixme: We don't really want a preference object on the workbench itself, but how else could preference pages etc. find them?!?
preferences = Instance(Preferences)
- prompt_on_exit
Should we prompt the user when they attempt to close the last open window (and hence exit the application!). This helps prevent the user from exiting the application accidentally. However, we never prompt if the user exits the workbench by choosing the 'Exit' action on the 'File' menu.
fixme: Shouldn't this be on the workbench UI?
prompt_on_exit = Bool(True)
- resource_manager
The resource manager used by the workbench. The resource manager is used to find editors, etc.
resource_manager = Instance(ResourceManager, ())
- show_tool_names
Should tool names be shown on tool bar tools?
show_tool_names = Bool(False)
- state_location
A directory on the local file system that we can read and write to at will. This is used to persist window layout information, etc.
state_location = Str
- user_perspective
The user defined perspectives manager:
user_perspective = Instance(UserPerspective)
- views
The views available in the workbench (note that this is all of the views, not just those currently visible).
views = List(View)
- window_closed
Fired when a workbench window has been closed.
window_closed = Event(WindowEvent)
- window_closing
Fired when a workbench window is closing.
window_closing = Event(VetoableWindowEvent)
- window_created
Fired when a workbench window has been created.
window_created = Event(WindowEvent)
- window_opened
Fired when a workbench window has been opened.
window_opened = Event(WindowEvent)
- window_opening
Fired when a workbench window is opening.
window_opening = Event(VetoableWindowEvent)
- window_position
The initial position of each workbench window.
window_position = Tuple((100, 100))
- window_size
The initial size of each workbench window.
window_size = Tuple((800, 600))
- windows
All of the workbench windows created by the workbench.
windows = List(Window)
Inherited from base classes
Method summary
- __init__(self, application, **traits)
- create_window(self)
- edit(self, resource, use_existing = True)
- exit(self)
- get_editor_by_id(self, id)
- get_editor_by_resource(self, resource)
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)
- 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)
- 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
- __init__(self, application, **traits)
Creates a new workbench.
- create_window(self)
Factory method that creates a new workbench window.
This does not open the window. To do that, call its 'open' method.
- edit(self, resource, use_existing = True)
Edits a resource.
If 'use_existing' is True and the resource is already being edited in the active workbench 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.
- exit(self)
Exits the workbench.
This closes all open workbench windows.
This method is not called when the user clicks the close icon. Nor when they do an Alt+F4 in Windows. It is only called when the application menu File->Exit item is selected.
- 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.