Navigation:  Application Architecture > Structure of a ClearCanvas Application >

Main Menus and Toolbars

Previous pageReturn to chapter overviewNext page

At this point we know enough to fully understand how the desktop constructs the action models that determine the structure of the main menus and toolbars.

The DesktopWindow class contains a ToolSet that holds all of the tools that extend DesktopToolExtensionPoint.  This tool set exposes an Actions property which is the set of all actions from all tools contained in the tool set.  Call this the set of desktop actions DA.

DesktopWindow has an ActiveWorkspace property, which refers to the currently active workspace (only one workspace can be active at a time).  This workspace hosts an application component.

IApplicationComponent exposes an ExportedActions property.  The source of these actions is left to the implementation of the component, but we can call this the set of workspace actions WA.

The desktop operates on the principle that at any given moment, the set of actions that is visible on the main menus and toolbars (call this visible actions VA) is the union of DA and WA for the active workspace:

VA = DA + WA

In the case where there are no workspaces open, WA is empty, and VA = DA.

As for determining which actions appear on the menus and which on the toolbars, the desktop relies on the site, which you’ll recall is the first segment of the action path.  Actions that intend to be placed on the main menu must have a path that begins with the site “global-menus” and those that wish to be placed on the main toolbars must have a path that begins with the site “global-toolbars”.