Commit 1c1db276e0d5cc58033814353eac19e72e9240f4

Authored by Elena.Budnik
1 parent bafc2a52
Exists in alias

iconCls

js/app/models/AliasNode.js
... ... @@ -17,13 +17,17 @@ Ext.define('amdaModel.AliasNode', {
17 17 objectName: 'Alias',
18 18 deletedAliases : null
19 19 },
20   -
  20 +
  21 + fields: [
  22 + {name: 'component_info', type: 'object', persist: false},
  23 + {name: 'iconCls', type: 'string', defaultValue: 'icon-scalar', persist: false}
  24 + ],
  25 +
21 26 constructor : function(config) {
22   - this.callParent(arguments);
23   -// if (this.get('leaf'))
24   -// this.set('iconCls', 'icon-scalar');
25   - if (this.get('leaf') && (!this.get('iconCls') || this.get('iconCls') == ""))
26   - this.set('iconCls', 'icon-scalar');
  27 + this.callParent(arguments);
  28 + if (this.get('leaf') &&
  29 + (!this.get('iconCls') || this.get('iconCls') == ""))
  30 + this.set('iconCls', 'icon-scalar');
27 31 },
28 32  
29 33 allMenuItems : function() {
... ...
js/app/models/InteractiveNode.js
... ... @@ -22,8 +22,7 @@ Ext.define('amdaModel.InteractiveNode', {
22 22 {name: 'moduleId', type: 'string', persist: false},
23 23 {name: 'filtered', type: 'boolean', defaultValue: false, persist: false},
24 24 {name: 'needsArgs', type:'boolean', defaultValue: false},
25   - {name: 'disable', type: 'boolean', defaultValue: false, persist: false},
26   - {name: 'component_info', type: 'object', persist: false}
  25 + {name: 'disable', type: 'boolean', defaultValue: false, persist: false}
27 26 ],
28 27  
29 28 statics: {
... ...
js/app/models/PlotObjects/PlotPanelObject.js
... ... @@ -324,8 +324,12 @@ Ext.define('amdaPlotObj.PlotPanelObject', {
324 324 recs[0].set('real-type', 1);
325 325 }
326 326 }
  327 +
  328 + // alias
327 329 if (realparamid) {
328   - recs[0].set('real-paramid',realparamid); // aliases
  330 + recs[0].set('real-paramid',realparamid);
  331 + var iconCls = (typeof data.iconCls !== "undefined") ? data.iconCls : null;
  332 + isVector = iconCls == 'icon-vector';
329 333 }
330 334  
331 335 recs[0].set('param-type', isTTCat ? 'ttcat' : 'param');
... ...
js/app/views/PlotComponents/PlotTree.js
... ... @@ -707,6 +707,7 @@ Ext.define('amdaPlotComp.PlotTree', {
707 707 return false;
708 708 var component_info = record.get('component_info');
709 709 var components = null;
  710 + var iconCls = null;
710 711 if (component_info && component_info.parentId) {
711 712 //It's a component
712 713 components = [];
... ... @@ -718,8 +719,10 @@ Ext.define('amdaPlotComp.PlotTree', {
718 719 if (component_info.index2)
719 720 components['index2'] = component_info.index2;
720 721 }
721   -
722   - this.dropParamToCreate(targetNode, position, "#" + record.get('text'), { 'components': components, 'realparamid' : record.get('info') });
  722 + if (record.get('iconCls'))
  723 + iconCls = record.get('iconCls');
  724 +
  725 + this.dropParamToCreate(targetNode, position, "#" + record.get('text'), { 'components': components, 'realparamid' : record.get('info'), 'iconCls' : iconCls });
723 726 return true;
724 727 case 'amdaModel.DerivedParamNode' :
725 728 if (!record.get('isParameter'))
... ...
php/classes/AliasMgr.php
... ... @@ -29,12 +29,13 @@ class AliasMgr extends AmdaObjectMgr {
29 29 * Add Alias in Alias.xml
30 30 */
31 31 protected function addAlias($obj) {
  32 +
32 33 $objList = $this->contentDom->getElementById($this->contentRootId);
33 34 $newObj = $this->contentDom->createElement($this->objTagName);
34 35 $newObj->setAttribute('xml:id',$this->id);
35 36 $obj_arr = (array)$obj;
36 37 foreach ($this->attributes as $key => $value) {
37   - if ($key == 'name') $newObj->setAttribute($key, $obj_arr[$key]);
  38 + $newObj->setAttribute($key, $obj_arr[$key]);
38 39 }
39 40  
40 41 if (count($obj_arr['component_info']) > 0) {
... ...
php/classes/AmdaAction.php
... ... @@ -198,6 +198,9 @@ class AmdaAction
198 198 if ($child->hasAttribute("parentId"))
199 199 $component_info["parentId"] = $child->getAttribute("parentId");
200 200  
  201 + if ($child->hasAttribute("iconCls"))
  202 + $iconCls = $child->getAttribute("iconCls");
  203 +
201 204 if ($isLeaf) $isParameter = true;
202 205  
203 206 break;
... ... @@ -572,7 +575,8 @@ class AmdaAction
572 575  
573 576 $childrenToReturn[] = array('text' => $name, 'id' => $id, 'nodeType' => $nodeType, 'info' => $info,
574 577 'help' => $help, 'leaf' => $isLeaf, 'isParameter' => $isParameter, 'dim_1' => $dim_1, 'dim_2' => $dim_2,
575   - "component_info" => isset($component_info) ? $component_info : NULL);
  578 + 'component_info' => isset($component_info) ? $component_info : NULL,
  579 + 'iconCls' => isset($iconCls) ? $iconCls : NULL );
576 580 }
577 581 }
578 582 // if $childrenToReturn we have to return []
... ...