Sha256: b7863d5361a6456ba48a0449ff729ca12bc92e474b7923a767f7bcd13ad57e5d

Contents?: true

Size: 1.53 KB

Versions: 36

Compression:

Stored size: 1.53 KB

Contents

var ViewController = function(view) {
    var self = {};

    // Protected variables
    self._view = undefined;
    self._uis = [];

    //#GETTER AND SETTER
    self.__defineSetter__("view", function(view){
        self._view = view;
    });

    self.__defineGetter__("view", function(){
        return self._view;
    });

    self.render = function() {
        self._uis.forEach(function(ui) {
            ui.render(self._view);
        });
    };

    // Add ui components
    self.addUIApplication = function() {
        var uiApplication = UIApplication(self);
        self.addUiComponent(uiApplication);
        return uiApplication;
    };

    self.addUIConnectionView = function() {
        var uiConnectionView = UIConnectionView(self);
        self.addUiComponent(uiConnectionView);
        return uiConnectionView;
    };

    self.addUITab = function(name) {
        var uiTab = UITab(self, name);
        self.addUiComponent(uiTab);
        return uiTab;
    };

    self.addUINotification = function(notificationName) {
        var uiNotification = UINotification(self);
        uiNotification.name = notificationName;
        self.addUiComponent(uiNotification);
        return uiNotification;
    };

    self.addUiComponent = function(ui) {
        self._uis.push(ui);
    };

    self.newView = function() {
        return self._view.newView();
    };

    // Constructor
    self.init = function() {
        self._view = view;
    }();

    // Destructor
    self.deinit = function() {
        self._view.remove();
    };

    return self;
};

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
nutella_framework-0.7.3 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.7.2 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.7.1 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.7.0 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.21 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.20 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.19 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.18 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.17 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.16 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.15 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.13 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.12 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.11 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.10 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.9 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.8 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.7 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.6 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.5 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js