[Toolbar] Implement a public API for adding toolbars (#1908)

* [API] Implement a toolbar registry and a plugin to allow providing a toolbar for a selected object.
* Modify the mct-toolbar directive to get the toolbar structure from a provider based on selection.
* Implements the layout toolbar in the layout bundle
This commit is contained in:
Pegah Sarram
2018-06-27 13:30:01 -07:00
committed by Andrew Henry
parent de8f8d174d
commit 73e38f1955
39 changed files with 1400 additions and 1844 deletions

View File

@ -29,7 +29,8 @@ define([
'./api/objects/object-utils',
'./plugins/plugins',
'./ui/ViewRegistry',
'./ui/InspectorViewRegistry'
'./ui/InspectorViewRegistry',
'./ui/ToolbarRegistry'
], function (
EventEmitter,
legacyRegistry,
@ -39,7 +40,8 @@ define([
objectUtils,
plugins,
ViewRegistry,
InspectorViewRegistry
InspectorViewRegistry,
ToolbarRegistry
) {
/**
* Open MCT is an extensible web application for building mission
@ -76,7 +78,7 @@ define([
* Tracks current selection state of the application.
* @private
*/
this.selection = new Selection();
this.selection = new Selection(this);
/**
* MCT's time conductor, which may be used to synchronize view contents
@ -143,17 +145,13 @@ define([
/**
* Registry for views which should appear in the toolbar area while
* editing.
* editing. These views will be chosen based on the selection state.
*
* These views will be chosen based on selection state, so
* providers should be prepared to test arbitrary objects for
* viewability.
*
* @type {module:openmct.ViewRegistry}
* @type {module:openmct.ToolbarRegistry}
* @memberof module:openmct.MCT#
* @name toolbars
*/
this.toolbars = new ViewRegistry();
this.toolbars = new ToolbarRegistry();
/**
* Registry for domain object types which may exist within this