DerivedParamNode.js 2.17 KB
/** 
 * Project  : AMDA-NG4
 * Name     : DerivedParamNode.js
 * @class   amdaModel.DerivedParamNode
 * @extends amdaModel.InteractiveNode
 * @brief   Model of Node corresponding to a derived parameter
 * @author  CDA
 * @version $Id: DerivedParamNode.js 2544 2014-10-03 10:21:56Z elena $
 * @todo
 *******************************************************************************
 *    FT Id     :   Date   : Name - Description
 *******************************************************************************
 *  :           :08/06/2011: CDA - Migration extjs4
 *  :           :09/06/2011: elena - all generic methods are now of InteractiveNode class
 */

Ext.define('amdaModel.DerivedParamNode', {

    extend: 'amdaModel.InteractiveNode',
    
    statics:{
        nodeType: 'derivedParam',
        objectName: 'Parameter'
    },
 
     fields:[
	    {name: 'isScatter', type: 'boolean', defaultValue: true}
	    ],
	    
    constructor : function(config){	
        this.callParent(arguments);

        this.set('nodeType',amdaModel.DerivedParamNode.nodeType);
        this.set('moduleId',myDesktopApp.dynamicModules.param.id);
        this.set('objectDataModel',amdaModel.Parameter.$className);
        this.set('ownerTreeId',amdaUI.ExplorerUI.RESRC_TAB.TREE_ID);
	if (this.get('leaf')) this.set('iconCls', 'icon-scalar');
    },
    
    localMenuItems : function() {
        var menuItems =
                [{
                    fnId : 'leaf-plotParam',
                    text : 'Plot Parameter',
                    hidden : true
                }, {
                    fnId : 'leaf-downParam',
                    text : 'Download Parameter',
                    hidden : true
                }];     
        return menuItems;
    },
    
    getAllContextMenuItems: function(){
        
        var menuItems = this.allMenuItems(amdaModel.DerivedParamNode.objectName);
        var locMenuItems = this.localMenuItems();
        
        return  Ext.Array.merge(menuItems,locMenuItems);       
    },

    getMultiContextMenuItems: function(){
        return this.allMenuMultiItems(amdaModel.DerivedParamNode.objectName);
    },
    
    isParameter : function(){
        return this.get('isParameter');
    }

});