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.6.4 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.3 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.2 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.1 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.6.0 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.5.1 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.5.0 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.4.32 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.4.31 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.4.30 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.4.29 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.4.28 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.4.27 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.4.26 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.4.25 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js
nutella_framework-0.4.24 framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js