extension ================= .. js:class:: Extension(name) :extends: Emitter :mixins: AjaxMixin :mixins: LoggerMixin The basis of an extension. .. js:attribute:: name read-only :type: String The name of the workspace. .. js:function:: addView(viewClass) Adds a view class to the extension. A view can be party of only one extension. :param JClass(BaseView) viewClass: The view class to add. :throws Error: If *viewClass* is not a JClass extending BaseView. :throws Error: If the *viewClass* is already assigned to another extension. :throws Error: If a *viewClass* with the same name is alrady registered. :return: The main menu entry of the class (viewClass._members.mainMenuEntry). :rtype: Object|null .. js:function:: (menuItems) Adds the given menu items to the main menu. :param Array menuItems: The items to add. .. js:function:: addViews(viewClasses) Adds multiple views to the extension. Calls :js:func:`addView` for each element of the provided Array. :param Array(JClass(BaseView)) viewClasses: An Array of view classes. :throws Error: If *viewClasses* is not an Array. .. js:function:: getView(viewName) Retrieves the view class for the view with this name. :param String viewName: The name of the view to retrieve. :return: The view class or *null* if there is none for the given name. :rtype: BaseView .. js:attribute:: views read-only :type: Object(name => JClass(BaseView)) The object that holds all the views by their name. Safe aginst manipulation. .. js:function:: closeAllInstances() Closes all know instances of this extension. Is syncronus. .. js:function:: load(callback) class-member Loades all extensions. :callback String|null err: *null* on success else the error description. .. js:function:: byName(name) class-member Retrieves the view class by its name. :param String name: The new of the view class. :return: The view class. :rtype: JClass(BaseView) .. js:attribute:: extensions read-only class-member :type: Object(name => Extension) The object that holds all the extensions by their name. Safe aginst manipulation.