mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
[API] Separate out ViewRegistry
This commit is contained in:
parent
1338f02541
commit
bc4ca10e53
48
src/MCT.js
48
src/MCT.js
@ -64,6 +64,46 @@ define([
|
||||
*/
|
||||
this.composition = api.Composition;
|
||||
|
||||
/**
|
||||
* Registry for views of domain objects which should appear in the
|
||||
* main viewing area.
|
||||
*
|
||||
* @type {module:openmct.ViewRegistry}
|
||||
* @memberof module:openmct.MCT#
|
||||
* @name mainViews
|
||||
*/
|
||||
|
||||
/**
|
||||
* Registry for views which should appear in the Inspector area.
|
||||
* These views will be chosen based on selection state, so
|
||||
* providers should be prepared to test arbitrary objects for
|
||||
* viewability.
|
||||
*
|
||||
* @type {module:openmct.ViewRegistry}
|
||||
* @memberof module:openmct.MCT#
|
||||
* @name inspectors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Registry for views which should appear in the status indicator area.
|
||||
* @type {module:openmct.ViewRegistry}
|
||||
* @memberof module:openmct.MCT#
|
||||
* @name indicators
|
||||
*/
|
||||
|
||||
/**
|
||||
* Registry for views which should appear in the toolbar area while
|
||||
* editing.
|
||||
*
|
||||
* These views will be chosen based on selection state, so
|
||||
* providers should be prepared to test arbitrary objects for
|
||||
* viewability.
|
||||
*
|
||||
* @type {module:openmct.ViewRegistry}
|
||||
* @memberof module:openmct.MCT#
|
||||
* @name toolbars
|
||||
*/
|
||||
|
||||
this.TimeConductor = this.conductor; // compatibility for prototype
|
||||
this.on('navigation', this.selection.clear.bind(this.selection));
|
||||
}
|
||||
@ -112,14 +152,6 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Register a new type of view.
|
||||
*
|
||||
* @param {string} region the region identifier (see mct.regions)
|
||||
* @param {module:openmct.ViewProvider} provider the provider for this view
|
||||
* @method view
|
||||
* @memberof module:openmct.MCT#
|
||||
*/
|
||||
MCT.prototype.view = function (region, definition) {
|
||||
var viewKey = region + uuid();
|
||||
var adaptedViewKey = "adapted-view-" + region;
|
||||
|
25
src/api/ui/ViewRegistry.js
Normal file
25
src/api/ui/ViewRegistry.js
Normal file
@ -0,0 +1,25 @@
|
||||
define([], function () {
|
||||
|
||||
/**
|
||||
* A ViewRegistry maintains the definitions for different kinds of views
|
||||
* that may occur in different places in the user interface.
|
||||
* @interface ViewRegistry
|
||||
*/
|
||||
function ViewRegistry() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new type of view.
|
||||
*
|
||||
* @param {module:openmct.ViewProvider} provider the provider for this view
|
||||
* @method addProvider
|
||||
* @memberof module:openmct.ViewRegistry#
|
||||
*/
|
||||
ViewRegistry.prototype.addProvider = function (provider) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
return ViewRegistry;
|
||||
});
|
Loading…
Reference in New Issue
Block a user