pyface.workbench.action.view_chooser module

A UI that allows the user to choose a view.

class pyface.workbench.action.view_chooser.Category[source]

Bases: HasTraits

A view category.

class pyface.workbench.action.view_chooser.WorkbenchWindowTreeNode(**traits)[source]

Bases: TreeNode

A tree node for workbench windows that displays the window’s views.

The views are grouped by their category.

get_children(object)[source]

Get the object’s children.

class pyface.workbench.action.view_chooser.IViewTreeNode(**traits)[source]

Bases: TreeNode

A tree node for objects that implement the ‘IView’ interface.

This node does not recognise objects that can be adapted to the ‘IView’ interface, only those that actually implement it. If we wanted to allow for adaptation we would have to work out a way for the rest of the ‘TreeNode’ code to access the adapter, not the original object. We could, of course override every method, but that seems a little, errr, tedious. We could probably do with something like in the Pyface tree where there is a method that returns the actual object that we want to manipulate.

is_node_for(obj)[source]

Returns whether this is the node that handles a specified object.

get_icon(obj, is_expanded)[source]

Returns the icon for a specified object.

class pyface.workbench.action.view_chooser.ViewChooser[source]

Bases: HasTraits

Allow the user to choose a view.

This implementation shows views in a tree grouped by category.