1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#------------------------------------------------------------------------------
# Copyright (c) 2013-2025, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------------------------------------
from atom.api import Typed, Str
from enaml.core.declarative import Declarative, d_
from enaml.widgets.container import Container
from enaml.workbench.workbench import Workbench
class Workspace(Declarative):
""" A declarative class for defining a workspace object.
"""
#: Extra information to display in the window title bar.
window_title = d_(Str())
#: The primary window content for the workspace. This will be
#: destroyed automatically when the workspace is disposed.
content = d_(Typed(Container))
#: The workbench object which owns the workspace. This will be
#: assigned when the ui plugin creates the workspace. It will
#: be available by the time the 'start' method is called.
workbench = Typed(Workbench)
def start(self):
""" Start the workspace.
This method is called when the UI plugin starts the workspace.
This can be used to load content or any other resource which
should exist for the life of the workspace.
"""
pass
def stop(self):
""" Stop the workspace.
This method is called when the UI plugin closes the workspace.
This should be used to release any resources acquired during
the lifetime of the workspace. The content Container will be
destroyed automatically after this method returns.
"""
pass
|