mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 05:37:53 +00:00
[API] Clean up Composition API
This commit is contained in:
parent
5a129de73d
commit
851d0f0d63
19
src/MCT.js
19
src/MCT.js
@ -49,6 +49,21 @@ define([
|
||||
*/
|
||||
this.conductor = new TimeConductor();
|
||||
|
||||
/**
|
||||
* An interface for interacting with the composition of domain objects.
|
||||
* The composition of a domain object is the list of other domain
|
||||
* objects it "contains" (for instance, that should be displayed
|
||||
* beneath it in the tree.)
|
||||
*
|
||||
* `composition` may be called as a function, in which case it acts
|
||||
* as [`composition.get`]{@link module:openmct.CompositionAPI#get}.
|
||||
*
|
||||
* @type {module:openmct.CompositionAPI}
|
||||
* @memberof module:openmct.MCT#
|
||||
* @name composition
|
||||
*/
|
||||
this.composition = api.Composition;
|
||||
|
||||
this.TimeConductor = this.conductor; // compatibility for prototype
|
||||
this.on('navigation', this.selection.clear.bind(this.selection));
|
||||
}
|
||||
@ -66,7 +81,7 @@ define([
|
||||
*
|
||||
* @type {module:openmct.ObjectAPI}
|
||||
* @memberof module:openmct.MCT#
|
||||
* @name Objects
|
||||
* @name objects
|
||||
*/
|
||||
MCT.Objects = api.Objects;
|
||||
|
||||
@ -76,7 +91,7 @@ define([
|
||||
*
|
||||
* @type {module:openmct.TelemetryAPI}
|
||||
* @memberof module:openmct.MCT#
|
||||
* @name Telemetry
|
||||
* @name telemetry
|
||||
*/
|
||||
|
||||
MCT.prototype.legacyExtension = function (category, extension) {
|
||||
|
@ -19,13 +19,14 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve the composition (if any) of this domain object. The
|
||||
* composition of a domain object is the list of other domain objects
|
||||
* An interface for interacting with the composition of domain objects.
|
||||
* The composition of a domain object is the list of other domain objects
|
||||
* it "contains" (for instance, that should be displayed beneath it
|
||||
* in the tree.)
|
||||
* @method Composition
|
||||
*
|
||||
* @interface CompositionAPI
|
||||
* @returns {module:openmct.CompositionCollection}
|
||||
* @memberof module:openmct.MCT#
|
||||
* @memberof module:openmct
|
||||
*/
|
||||
function composition(object) {
|
||||
var provider = getProvider(object);
|
||||
@ -35,8 +36,28 @@ define([
|
||||
}
|
||||
|
||||
return new CompositionCollection(object, provider);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the composition (if any) of this domain object.
|
||||
*
|
||||
* @method get
|
||||
* @returns {module:openmct.CompositionCollection}
|
||||
* @memberof module:openmct.CompositionAPI#
|
||||
*/
|
||||
composition.get = composition;
|
||||
|
||||
/**
|
||||
* Add a composition provider.
|
||||
*
|
||||
* Plugins can add new composition providers to change the loading
|
||||
* behavior for certain domain objects.
|
||||
*
|
||||
* @method addProvider
|
||||
* @param {module:openmct.CompositionProvider} provider the provider to add
|
||||
* @returns {module:openmct.CompositionCollection}
|
||||
* @memberof module:openmct.CompositionAPI#
|
||||
*/
|
||||
composition.addProvider = function (provider) {
|
||||
PROVIDER_REGISTRY.unshift(provider);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user