[Selection] Add ActionRegistry

This commit is contained in:
Victor Woeltjen 2016-09-23 15:35:40 -07:00
parent 106632c21c
commit 9e19296b14

17
src/ui/ActionRegistry.js Normal file
View File

@ -0,0 +1,17 @@
define([], function () {
function ActionRegistry() {
this.providers = [];
}
ActionRegistry.prototype.get = function (context) {
return this.providers.filter(function (provider) {
return provider.appliesTo(context);
});
};
ActionRegistry.prototype.addProvider = function (provider) {
this.providers.push(provider);
};
return ActionRegistry;
});