You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2012/06/12 19:46:25 UTC

svn commit: r1349454 - /openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/application/js/view/panels/JndiClass.js

Author: tveronezi
Date: Tue Jun 12 17:46:24 2012
New Revision: 1349454

URL: http://svn.apache.org/viewvc?rev=1349454&view=rev
Log:
https://issues.apache.org/jira/browse/TOMEE-224
* load class/ejb info

Modified:
    openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/application/js/view/panels/JndiClass.js

Modified: openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/application/js/view/panels/JndiClass.js
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/application/js/view/panels/JndiClass.js?rev=1349454&r1=1349453&r2=1349454&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/application/js/view/panels/JndiClass.js (original)
+++ openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/application/js/view/panels/JndiClass.js Tue Jun 12 17:46:24 2012
@@ -30,141 +30,136 @@ TOMEE.JndiClass = function (cfg) {
         }
     });
 
-    return {
-        show:function (params) {
-            var el = panel.getContentEl();
-            el.empty();
+    var elBottomBar = TOMEE.el.getElMap({
+        elName:'main',
+        tag:'form',
+        cls:'well form-inline',
+        attributes:{
+            style:'height: 27px;margin-bottom: 0px;padding-top: 1px;padding-left: 1px;padding-bottom: 1px;padding-right: 1px;'
+        },
+        children:[
+            {
+                tag:'div',
+                cls:'pull-right',
+                children:[
+                    {
+                        elName:'fileSelector',
+                        tag:'select',
+                        attributes:{
+                            style:'margin-right: 2px;'
+                        }
+                    },
+                    {
+                        elName:'loadBtn',
+                        tag:'button',
+                        cls:'btn',
+                        html:TOMEE.I18N.get('application.log.load')
+                    }
+                ]
+            }
+        ]
+    });
 
-            var cls = params.data.cls;
+    var elements = TOMEE.el.getElMap({
+        elName:'main',
+        tag:'div',
 
-            /*
-            Data format
+        children:[
             {
-                cls: {
-                    type: 'String',
-                        //CONTEXT, BEAN, OTHER
-                        componentType: 'String',
-                        //STATEFUL, STATELESS, SINGLETON, BMP_ENTITY, CMP_ENTITY, MESSAGE_DRIVEN, MANAGED
-                        beanClass: 'impl class name',
-                        interfaces: ['InterfaceA', 'InterfaceB'],
-                        methods: [{
-                        name: 'methodName',
-                        returns: 'Class type',
-                        parameters: ['ClassA', 'ClassB']
-                    }, {
-                        name: 'methodName',
-                        returns: 'Class type',
-                        parameters: ['ClassA', 'ClassB']
-                    }]
+                elName:'content',
+                tag:'div',
+                attributes:{
+                    style:'padding: 5px'
                 }
             }
-            */
-            var getFieldCfg = function (bean, getLabel, getValue) {
-                var fieldId = TOMEE.Sequence.next('cls_property');
-                var fieldConfig = {
+        ]
+    });
+
+    elements.main.append(elBottomBar.main);
+    panel.getContentEl().append(elements.main);
+
+    var setHeight = function (height) {
+        var mySize = height - TOMEE.el.getBorderSize(elements.main);
+        var gridSize = mySize - elBottomBar.main.outerHeight(true);
+
+        elements.main.height(mySize);
+        elements.content.height(gridSize);
+    };
+
+    var getField = function (bean, getLabel, getValue) {
+        var fieldId = TOMEE.Sequence.next('cls_property');
+        return TOMEE.el.getElMap({
+            elName: 'main',
+            tag:'div',
+            cls:'control-group',
+            attributes: {
+                style: 'margin-bottom: 5px;'
+            },
+            children:[
+                {
+                    tag:'label',
+                    cls:'control-label',
+                    attributes:{
+                        'for':fieldId
+                    },
+                    html:getLabel(bean)
+                },
+                {
                     tag:'div',
-                    cls:'control-group',
+                    cls:'controls',
                     children:[
                         {
-                            tag:'label',
-                            cls:'control-label',
+                            tag:'input',
+                            cls:'input input-xlarge',
                             attributes:{
-                                'for':fieldId
-                            },
-                            html:getLabel(bean)
-                        },
-                        {
-                            tag:'div',
-                            cls:'controls',
-                            children:[
-                                {
-                                    tag:'input',
-                                    cls:'input input-xlarge',
-                                    attributes:{
-                                        style: 'margin-bottom: 5px;',
-                                        'type':'text',
-                                        'id':fieldId,
-                                        'value':getValue(bean)
-                                    }
-                                }
-                            ]
-
+                                'type':'text',
+                                'id':fieldId,
+                                'value':getValue(bean)
+                            }
                         }
                     ]
-                };
-                return fieldConfig;
-            };
 
-            var fields = [];
-            fields.push(getFieldCfg(cls, function (bean) {
-                return 'type';
-            }, function (bean) {
-                return bean['type'];
-            }));
-            fields.push(getFieldCfg(cls, function (bean) {
-                return 'componentType';
-            }, function (bean) {
-                return bean['componentType'];
-            }));
+                }
+            ]
+        }).main;
+    };
 
-            var elBottomBar = TOMEE.el.getElMap({
-                elName:'main',
-                tag:'form',
-                cls:'well form-inline',
-                attributes:{
-                    style:'height: 27px;margin-bottom: 0px;padding-top: 1px;padding-left: 1px;padding-bottom: 1px;padding-right: 1px;'
-                },
-                children:[
-                    {
-                        tag:'div',
-                        cls:'pull-right',
-                        children:[
-                            {
-                                elName:'fileSelector',
-                                tag:'select',
-                                attributes:{
-                                    style:'margin-right: 2px;'
-                                }
-                            },
-                            {
-                                elName:'loadBtn',
-                                tag:'button',
-                                cls:'btn',
-                                html:TOMEE.I18N.get('application.log.load')
-                            }
-                        ]
-                    }
-                ]
-            });
+    return {
+        show:function (params) {
+            elements.content.empty();
 
-            var elements = TOMEE.el.getElMap({
-                elName:'main',
-                tag:'div',
+            var cls = params.data.cls;
 
+                      //form-horizontal
+            var div = TOMEE.el.getElMap({
+                elName: 'main',
+                tag:'form',
+                cls:'form-horizontal',
                 children:[
                     {
-                        tag:'div',
-                        attributes:{
-                            style:'padding: 5px'
-                        },
-                        children:[
+                        elName: 'fieldset',
+                        tag:'fieldset',
+                        children: [
                             {
-                                tag:'form',
-                                cls:'form-horizontal',
-                                children:[
-                                    {
-                                        tag:'fieldset',
-                                        children:fields
-                                    }
-                                ]
+
                             }
                         ]
                     }
                 ]
             });
+            div.fieldset.append(getField(cls, function (bean) {
+                return 'type';
+            }, function (bean) {
+                return bean['type'];
+            }));
+            div.fieldset.append(getField(cls, function (bean) {
+                return 'componentType';
+            }, function (bean) {
+                return bean['componentType'];
+            }));
+
+            elements.content.append(div.main);
 
-            elements.main.append(elBottomBar.main);
-            panel.getContentEl().append(elements.main);
             panel.showAt({
                 modal:true
             });