Document Information

Last modified:
2007/08/08 10:05 by horvathadam

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:
2007/08/08 10:05 by horvathadam

Account

Not logged in

 
 

Job Offers

To further improve qooxdoo we are seeking javascript developers. Read more...

Rich Ajax Platform (RAP)

RAP uses qooxdoo, Java and the Eclipse development model to build rich web applications. Read more...

qooxdoo Web Toolkit (QWT)

Similar to GWT this framework allows to create impressive qooxdoo applications just using Java. Read more...

Pustefix

Pustefix is a MVC-based web application framework using Java and XML/XSLT. Read more...

 
SourceForge.net Logo

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