Jump to: navigation, search

Difference between revisions of "DSDP/MTJ/Requirements/MIDlet templates"

< DSDP‎ | MTJ‎ | Requirements
(ID: templates:FR004 - New MIDlet From Template Wizard.)
(ID: templates:FR002 - MTJ shall define an extension point for MIDlet templates)
 
(8 intermediate revisions by the same user not shown)
Line 21: Line 21:
  
 
==='''ID''': templates:FR002 - MTJ shall define an extension point for MIDlet templates===
 
==='''ID''': templates:FR002 - MTJ shall define an extension point for MIDlet templates===
'''Description:''' An '''''Extension Point''''' were third party plugins can provide MIDlet templates
+
'''Description:''' An '''''Extension Point''''' where third party plugins can provide MIDlet templates to be used by MTJ upon creation of MIDlets from templates.
to be used by MTJ upon creation of MIDlets from templates.
+
 
 +
* 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 a ITemplateProvider to build the UI and provide a dictionary of tags and values;
 +
 
 +
'''Template Creation:'''
 +
<br>
 +
* 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'''.
 +
 
 +
* <b>Example:</b>
 +
<pre>
 +
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 {
 +
 
 +
}
 +
 
 +
}
 +
</pre>
  
 
The extension point will be composed by the following elements:
 
The extension point will be composed by the following elements:
  
 
*'''template'''
 
*'''template'''
 +
** <font color="green"><b>id</b></font> (String Attribute) <font color="#960018"><b>[REQUIRED]</b></font><p>Description: Template ID.</p>
 
** <font color="green"><b>name</b></font> (String Attribute) <font color="#960018"><b>[REQUIRED]</b></font><p>Description: MIDlet Template Name.</p>
 
** <font color="green"><b>name</b></font> (String Attribute) <font color="#960018"><b>[REQUIRED]</b></font><p>Description: MIDlet Template Name.</p>
 +
** <font color="green"><b>overview</b></font> (String Attribute) <font color="#960018"><b>[REQUIRED]</b></font><p>Description: A short description of the template features.</p>
 
** <font color="green"><b>description</b></font> (String Attribute) <font color="#960018"><b>[REQUIRED]</b></font><p>Description: MIDlet Template Description. Describes the template usage and the features the template implements.</p>
 
** <font color="green"><b>description</b></font> (String Attribute) <font color="#960018"><b>[REQUIRED]</b></font><p>Description: MIDlet Template Description. Describes the template usage and the features the template implements.</p>
 
** <font color="green"><b>permissions</b></font> (String Attribute) <font color="#960018"><b>[OPTIONAL]</b></font><p>Description: A comma separated list with the required permissions' names defined by the APIs (permission1,permission2,...,permissionN).</p>
 
** <font color="green"><b>permissions</b></font> (String Attribute) <font color="#960018"><b>[OPTIONAL]</b></font><p>Description: A comma separated list with the required permissions' names defined by the APIs (permission1,permission2,...,permissionN).</p>
** <font color="green"><b>provider</b></font> (Java Attribute) <font color="#960018"><b>[REQUIRED]</b></font><p>Description: MIDletTemplateProvider Interface defines methods for creation of code sections such as attributes, methods, inner classes, etc. The provider does not know anything about the MIDlet construction process.</p>
+
** <font color="green"><b>provider</b></font> (Java Attribute) <font color="#960018"><b>[REQUIRED]</b></font><p>Description: ITemplateProvider Interface defines methods for creation of template custom fields on the widget and provide a dictionary of values to replace the template tags for.</p>
  
 
*'''''Sequence compositor'''''
 
*'''''Sequence compositor'''''
 
** <font color="blue">template</font> (Element reference) ('''1 - *''')
 
** <font color="blue">template</font> (Element reference) ('''1 - *''')
 +
 +
'''Usage:''' After filling the plugin extension fields described above. It is necessary to create a structure as described below inside your plugin project:
 +
 +
<pre>
 +
Conventions:
 +
<..> := Folders; [..] := Files;
 +
 +
<project-root>
 +
  +<templates> (Templates folder)
 +
      +<template-id> (The same name used in your template extension definition id described above.)
 +
          +<java> (Class Templates in the form <template-name>.template)
 +
              -[tt1.template] (Template class)   
 +
              -[tt1.template] (Template class)
 +
          +<resources> (Resource files used by the template, these will be copied to the suite root folder)
 +
              -[image.png](Image Resource)
 +
              -[menu.txt](Text file Resource)
 +
              +<sub-folder>(Sub Folder)
 +
        ...
 +
</pre>
  
 
'''Priority:''' 1
 
'''Priority:''' 1
Line 90: Line 146:
 
==='''ID''': templates:FR005 - New MIDlet From Template Wizard shall display a customize page.===
 
==='''ID''': templates:FR005 - New MIDlet From Template Wizard shall display a customize page.===
  
'''Description:''' New MIDlet From Template Wizard shall display a custom page depending on the selected template in order to setup template specific fields. The custom page will have a common part for every template and a custom one as show on the [https://bugs.eclipse.org/bugs/attachment.cgi?id=116837 related image].
+
'''Description:''' New MIDlet From Template Wizard shall display a custom page depending on the selected template in order to setup template specific fields. The custom page will have a common part for every template and a custom one as show on the [https://bugs.eclipse.org/bugs/attachment.cgi?id=122971 related image].
  
 
'''Priority:''' 1
 
'''Priority:''' 1
Line 100: Line 156:
 
'''Community Review:''' TBD  
 
'''Community Review:''' TBD  
  
'''Related Bugs:''' TBD
+
'''Related Bugs:''' {{bug|261539}}
  
'''Related Images:''' [https://bugs.eclipse.org/bugs/attachment.cgi?id=116837 New MIDlet From Template Wizard]
+
'''Related Images:''' [https://bugs.eclipse.org/bugs/attachment.cgi?id=122971 New MIDlet From Template Wizard]
  
 
----
 
----
  
 
[[Category:DSDP]] [[Category:MTJ]]
 
[[Category:DSDP]] [[Category:MTJ]]

Latest revision as of 08:20, 15 February 2009

Core

This section lists the main core requirements for the MIDlet templates feature.

ID: templates:FR001 - MTJ shall support the creation of MIDlets from templates.

Description: MTJ shall provide an extensible and flexible way for third party plugins to contribute with templates for MIDlet creation. These templates will help users to learn API's usage and reduce the programming effort.

Priority: 1

Owner: David Marques

Status: Proposed on 05-Feb-2009

Community Review: TBD

Related Bugs: bug 239979


ID: templates:FR002 - MTJ shall define an extension point for MIDlet templates

Description: An Extension Point where third party plugins can provide MIDlet templates to be used by MTJ upon creation of MIDlets from templates.

  • 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 a ITemplateProvider to build the UI and provide a dictionary of tags and values;

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.
  • Example:
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 {

	}

}

The extension point will be composed by the following elements:

  • template
    • id (String Attribute) [REQUIRED]

      Description: Template ID.

    • name (String Attribute) [REQUIRED]

      Description: MIDlet Template Name.

    • overview (String Attribute) [REQUIRED]

      Description: A short description of the template features.

    • description (String Attribute) [REQUIRED]

      Description: MIDlet Template Description. Describes the template usage and the features the template implements.

    • permissions (String Attribute) [OPTIONAL]

      Description: A comma separated list with the required permissions' names defined by the APIs (permission1,permission2,...,permissionN).

    • provider (Java Attribute) [REQUIRED]

      Description: ITemplateProvider Interface defines methods for creation of template custom fields on the widget and provide a dictionary of values to replace the template tags for.

  • Sequence compositor
    • template (Element reference) (1 - *)

Usage: After filling the plugin extension fields described above. It is necessary to create a structure as described below inside your plugin project:

Conventions:
<..> := Folders; [..] := Files;

<project-root>
   +<templates> (Templates folder)
       +<template-id> (The same name used in your template extension definition id described above.)
           +<java> (Class Templates in the form <template-name>.template)
               -[tt1.template] (Template class)    
               -[tt1.template] (Template class)
           +<resources> (Resource files used by the template, these will be copied to the suite root folder)
               -[image.png](Image Resource)
               -[menu.txt](Text file Resource)
               +<sub-folder>(Sub Folder)
        ...

Priority: 1

Owner: David Marques

Status: Proposed on 05-Feb-2009

Community Review: TBD

Related Bugs: bug 261542


User Interface

This section lists the main User Interface requirements for the Library Support feature.

ID: templates:FR003 - User must be able to create MIDlet from Template through the context sensitive menu.

Description: The context sensitive menu shall display the option New > Java ME MIDlet From Template when one of the following items are selected:

  • MTJ Project;
  • Source folder;

Priority: 1

Owner: David Marques

Status: Proposed on 05-Feb-2009

Community Review: TBD

Related Bugs: bug 261537

Related Images: Context Sensitive Menu


ID: templates:FR004 - New MIDlet From Template Wizard.

Description: MTJ shall open wizard upon context sensitive menu option New > Java ME MIDlet From Template selection. It must display all available templates and build a MIDlet from the selected template.

Priority: 1

Owner: David Marques

Status: Proposed on 05-Feb-2009

Community Review: TBD

Related Bugs: bug 261539

Related Images: New MIDlet From Template Wizard


ID: templates:FR005 - New MIDlet From Template Wizard shall display a customize page.

Description: New MIDlet From Template Wizard shall display a custom page depending on the selected template in order to setup template specific fields. The custom page will have a common part for every template and a custom one as show on the related image.

Priority: 1

Owner: David Marques

Status: Proposed on 05-Feb-2009

Community Review: TBD

Related Bugs: bug 261539

Related Images: New MIDlet From Template Wizard