The dip.shell module implements the infrastructure for defining and interfacing with a shell.
Plugins must provide appropriate support for the following extension points:
Base class: Model
The BaseManagedModelTool class is a base class for tools that handle managed models. It automatically manages the different lists of views and provides a convenient interface to the changing of the active view and model.
Create the views for a managed model.
This must be implemented by a sub-class.
Parameter: | model – is the model. |
---|---|
Returns: | the list of views. |
Open a model at a storage location.
Parameter: | location – is the storage location. |
---|
Determine if the view is to be prevented from being closed.
Parameter: | view – is the view. |
---|---|
Returns: | True if the close of the view is to be prevented. |
Base class: Adapter
The BaseShellAdapter class is a base class for adapters to the IShell interface. It implements housekeeping common to all shells.
Close a view if possible.
Parameter: | view – is the view. If it is not specified then the current view is closed. |
---|---|
Returns: | True if the view was closed. |
This determines if the main area policy allows for a new view to be added.
Returns: | True if a new view is allowed. |
---|
Open the model at a location and add it to a tool.
Parameters: |
|
---|
Base class: ViewFactory
The BaseShellFactory class is a base class for shell factories. It creates views that implement the IContainer and IShell interfaces.
The template from which the window title is derived. Tokens in the template are replaced by their corresponding values:
[view] is replaced by the name of the active view.
Note that, as with window_title, [*] will be replaced with the application modification state by the toolkit.
Create the shell instance.
Parameters: |
|
---|---|
Returns: | the shell. |
Create the view that implements the shell. This should be reimplemented by a sub-class.
Parameters: |
|
---|---|
Returns: | the shell. |
Base class: Interface
The ICloseViewVeto interface defines the API to be implemented by a tool that wants to exert control over whether or not a view can be closed.
Determine if the view is to be prevented from being closed.
Parameter: | view – is the view. |
---|---|
Returns: | True if the close of the view is to be prevented. |
Base class: IDirty
The IManagedModel interface defines the API of a managed model.
Base class: ITool
The IManagedModelTool interface defines the API for a tool that handles one or more managed models.
Check if the tool can handle a particular model.
Parameter: | model – is the model. |
---|---|
Returns: | True if a tool can handle the model. |
Base class: ITool
The IModelManagerTool interface defines the API made available to implementations of the IManagedModelTool interface.
This handles open_model() on behalf of an implementation of the IManagedModelTool interface.
Parameters: |
|
---|
This handles veto() on behalf of an implementation of the IManagedModelTool interface.
Parameters: |
|
---|---|
Returns: | True if the close of the view is to be prevented. |
Base class: Interface
The IModelPublisher interface defines the API to be implemented by a tool that publishes a model to other tools that implement the IModelSubscriber interface. A model is published by the shell to all subscribers when one of the publishing tool’s views becomes current.
Base class: Interface
The IModelSubscriber interface defines the API to be implemented by a tool that subscribes to the publication of a model by other tools that implement the IModelPublisher interface. A model is published by the shell to all subscribers when one of the publishing tool’s views becomes current.
Base class: Interface
The IOpenModel interface defines the API to be implemented by a tool that can open a model typically from a location provided on the command line.
Open a model at a storage location.
Parameter: | location – is the storage location. |
---|
Base class: Interface
The IQuitVeto interface defines the API to be implemented by an object that is allowed to veto a user’s request to quit the application.
Base class: Interface
The IShell interface defines the API of a shell.
The following action identifiers are considered to be well known. A shell would normally be expected to honour them.
dip.ui.actions.close dip.ui.actions.export dip.ui.actions.import dip.ui.actions.new dip.ui.actions.open dip.ui.actions.quit dip.ui.actions.save dip.ui.actions.save_as dip.ui.actions.whats_this
The following action collection identifiers are considered to be well known. A shell, if it supports the concept of action collections, would normally be expected to honour them.
dip.ui.collections.edit dip.ui.collections.file dip.ui.collections.help dip.ui.collections.print dip.ui.collections.tools dip.ui.collections.undo dip.ui.collections.view
The following area identifiers, used to position views, are defined. A shell may interpret these in any way. An empty string implies the main area.
dip.shell.areas.left dip.shell.areas.right dip.shell.areas.bottom dip.shell.areas.top
The template from which the window title is derived. Tokens in the template are replaced by their corresponding values:
[view] is replaced by the name of the active view.
Note that, as with window_title, [*] will be replaced with the application modification state by the toolkit.
Close a view if possible.
Parameter: | view – is the view. If it is not specified then the current view is closed. |
---|---|
Returns: | True if the view was closed. |
This determines if the main area policy allows for a new view to be added.
Returns: | True if a new view is allowed. If not then the user will be informed. |
---|
Open the model at a location and add it to a tool.
Parameters: |
|
---|
Base class: Interface
The ITool interface defines the API to be implemented by a tool.
Base class: Model
The SimpleViewTool class is a base class for shell tools implemented as a single view and that allows for the use of an action that toggles the visibility of the view.