Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse Mobile Java Development Tools
Previous Page Home Next Page

MTJ Template



By extending this extension point third party plugins are able to add mobile application templates to the templates wizard.

Developers aiming to contribute with templates will need to do the following tasks:

  • Extend the extension point;
  • Create a folder structure as described bellow;
  • Implement ITemplateProvider to build the UI and provide a dictionary of tags and values;

Configuration Markup:

<!ELEMENT extension ( template+)>

<!ATTLIST extension





MTJ Template extension point defines a way for adding templates to MTJ.

<!ELEMENT template EMPTY>

<!ATTLIST template

id          CDATA #REQUIRED

name        CDATA #REQUIRED

overview    CDATA #REQUIRED

description CDATA #REQUIRED

permissions CDATA #IMPLIED

page        CDATA #REQUIRED


  • id - ID of the template. It must be the same name as the template's folder inside a "templates" folder within the extending plugin's root directory. Example: [plugin-root] (Plugin root folder) [templates] (Templates folder) [id] (template "id" folder) [java] (template classes) [resources] (other resources)
  • name - Template Name. It will be displayed on the Template Wizard Page Title.
  • overview - This is a short description for the template. It will be displayed on the Template Wizard Page Description.
  • description - Template Description. Describes the template usage and the features the template implements.
  • permissions - A comma separated list with the required permissions' names defined by the APIs.


  • page - AbstractTemplateWizardPage class provides an abstract wizard page to be extended in order to add a custom template page with template specific fields.


Template Creation:

Templates are regular Java source files with special tags in the form $<tag-name>$. These tags will be replaced by the ITemplateProvider instance provided in the extension as described bellow. MTJ will collect all template files and use the ITemplateProvider instance's dictionary to replace all template tags by the dictionary values. The dictionary will usually have values for custom fields on the wizard.

package $package_name$;

import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class $class_name$ extends MIDlet {

 public $class_name$() {

 protected void destroyApp(boolean arg0) throws MIDletStateChangeException {


 protected void pauseApp() {


 protected void startApp() throws MIDletStateChangeException {


API Information:
[Enter API information here.]

Supplied Implementation:
[Enter information about supplied implementation of this extension point.]

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire