Document Information

Last modified:
2011/02/22 12:31 (external edit)

This is documentation for qooxdoo 0.7.x only. You might be interested in consulting the latest docs.

JSEclipse templates

JSEclipse is a good Javascript editor, that is integrated in Eclipse.

Here are some sample templates (Window | Preferences | JSEclipse | Templates), that simplify adding new items:

Creating a class

qx.Class.define('${Class}', {
        extend: ${Base},
 
        construct: function() {
                arguments.callee.base.apply(this, arguments);
        },
        members: {
                ${func}: function() {
                }
        }
});

A less compact template, with more fields, and places for javadoc comments. While importing, write your name after the @author keyword in the javadoc comment.

/**
*
* DESCRIPTION
* 
* @package ${package}
* @class ${Class}
* @author (your name comes here)
*/
qx.Class.define('${package}.${Class}', 
{
	extend: ${Base},
    /**
    * @param ${param_name_constr} {${param_type_constr}} description
    * @return {${return_type_constr}} 
    */
    construct : function( ${param_name_constr}  ) 
    {
    	this.base(arguments);        
    },
 
	events : 
    {
    	"${event_name}" : "${event_type}"
	},
 
    statics : 
    {
    	${static_variable} : ${static_variable_init_value},
 
    	/**
	 * @param ${param_name_static} {${param_type_static}} description
    	 * @return {${return_type_static}} 
	 */
    	${func} : function( ${param_name_static}  ) 
	    {
 
    	}
    },
 
    properties : 
    {
       /**
        * description
        */
    	${property_name} :  
    	{
        	init     : ${property_init_value},
        	apply : "${property_apply_function_name}",
        	check : "${property_type}",
        	event : "${property_event_name}"
        }
	},
 
    members: 
    {
    	/**
        * @param ${param_name} {${param_type}} description
        * @return {${return_type}} 
        */
        ${func} : function( ${param_name}  ) 
        {
 
        }
    }    
});

Entry point to the application

Supposing you have generated qooxdoo with the setting:

--use-setting=qx.application:mynamespace.App
qx.Class.define('mynamespace.App', {
	extend: qx.application.Gui,
 
	members: {
		main: function() {
			${cursor}
		}
	}
});

Creating a static class

qx.Class.define('${Class}', {
        type: 'static',
 
        statics: {
                ${func}: function() {
                }
        }
});

Appearance entry

For creating an appearance entry in a theme:

'${AppearanceName}': {
        style: function(states) {
                return {
                        ${prop}: ${value}
                }
        }
}

Creating an Interface

To create an interface, you might use this template. While importing, you should write your name after the @author part in the template editor.

/**
*
* DESCRIPTION
* 
* @package ${package}
* @class ${Class}
* @author (your name comes here)
*/
qx.Interface.define('${package}.${Class}', 
 {
   extend: ${SuperInterfaces},
 
   properties: 
   {
   	"${propertyName}": {}
   },
 
   members:
   {
     ${method_name}: function() { }
   },
 
   statics:
   {
     ${constant} : ${constant_value},
     ${static_method}: function() 
     {  
     }
   },
 
   events :
   {
     ${keydown} : ${type}
   }
});

Information

Last modified:
2011/02/22 12:31 (external edit)

Account

 
 
A book on qooxdoo RIAs, authored  by community members
JS Tutorial, JavaScript Tutorial, JavaScript Guide, Learn JavaScript JS, How To Learn JS, Learning JavaScript
 

Bad Behavior has blocked 0 potential spam attempts in the last 7 days.