Here is a list of things, that would be nice to have in SimTeEc in the future.
Further ideas, critism or comments are welcome
(dexters@gmx.de)!
And you are of course very welcome to implement one of those features :)
Last update: 11.03.2004 (many thanks to M. Payne for contributing a lot of suggestions)
# small effort #
Helper Methods (changed 11.03.2004) DONE
==============
!! Right now, there are only the velocity
!! generic tools added to the context. But with
!! version 0.9.3 you can also add any classes
!! from your projects classpath to the velocity
!! context
Add helper objects and/or methods to ease the manipulation of string,
date, ... variables.
Here are some ideas taken from ItelliJ IDEA's live templates
http://www.jetbrains.com/docs/help/editing/liveTemplates/defineTemplates.html#editTemplVars
string utilities:
capitalize:
Capitalizes the first letter of the name passed as a parameter.
$util.capitalize("hallo") => "Hallo"
decapitalize:
Decapitalizes the first letter of the name passed as a parameter.
$util.decapitalize("HalloWorld") => "halloWorld"
java utils:
replaceDotsWithSlash - usefull for generating output-path from package name
$util.replaceDotsWithSlash("java.util.io") => "java/util/io"
More Templates
==============
SQL
C/C++
Cobol
Fortran
Various Java stubs
HTML stubs
XML stubs
JSP stubs
Ant
Predefined Variables (changes 15.02.2004) DONE
====================
!! Right now you can use all simteec_variables in your
!! templates. To get the current date, you could for
!! example use: $velocityTools.DateTool.getDate()
Add predefined variables to the velocity context (maybe even complete java
objects like System or some eclipse objects).
$var.Date = $now = current date
$var.tempalteName = filename of the template
$var.TargetDirAbs = absolute path to the specified target directory
...
# medium effort #
Open Editor (20.03.2004) DONE
===========
!! The wizard will open the created file in the appropriate editor
After the wizard has been executed, the new file should be opend
with the editor corresponding to the new file extension.
Create Multiple Files (changes 15.02.2004) DONE
=====================
!! This can already be done using the simteec_branches
!! variable.
Add functionality for creating multiple files from one property file. This could
be based on the velocity tool texen.
http://jakarta.apache.org/velocity/texen.html
Plugin Preferences Page
=======================
Add a plugin preferences page (Window->Preferences->SimTeEc).
possible configuration options:
default template path: ________
default properties path: ________
...
Support XML-Property-Files (changed 15.02.2004)
==========================
!! Postponed, because the JDK-DOM method getNodeList does
!! not return a List. Therefore it is not useable in
!! velocity templates
Support a way to specify property files as XML. The
xml-tree could then be put as some kind of dom into the
velocity context.
I think it could help the community to build even more complex
templates and especially template bundles. But maybe this is
already to complex, or maybe not?
The templates could access it like this:
$xml.getElementsByTagName("bean"), ...
Add Template Metadata (changed 8.12.2003)
=====================
Provide a Specification about how people can add metadata
to their templates. This Data could include the generated
filetype (e.g. java, perl, sql, ...), a textual description,
the required variables names and types, etc..
For this purpose a specific velocity comment format could be
used. Any other ideas are very welcome!
Add more wizards (changed 10.12.2003)
================
File->New->Template
Page1: Select template root path
Page2: Display a tree of available categories (maybe the directory
browser could be used for this). It should be possible to create
new categories within this menue.
Enter name of the template, which should be created
action: open template in veloeditor
File->New->Template Bundle
Page1: select root path for bundles. This could be usefull to seperate
shared simteec bundles stored inside your project.
Page2: Display a tree of available categories (maybe the directory
browser could be used for this). It should be possible to create
new categories within this menue.
Page3: Enter name, description of Bundle
Page4: Select templates from a list of all available templates (maybe
a tree with checkboxed in front of templates)
action: create corresponding bundlename_bundle.xml and copy all marked
templates, to the category where the bundle should be stored, with
the bundlename as prefix.
# could take a while #
Template Bundles (changed 8.12.2003)
================
Create a group of templates, which can be used to create multiple files from
one property file. Possible bundles are:
+-- Java
! +-- J2EE
! ! +-- EntityFramework
! ! ! +-- CMPEntityBean.vm
! ! ! +-- ValueObject.vm
! ! ! +-- SessionFacade.vm
! ! ! +-- OracleSQL.vm
! ! ! +-- ...
! ! !
! ! +-- ...
! !
! +-- Pattern
! ! +-- Singleton
! ! +-- AbstractFactory
! ! +-- Composite
! ! +-- ...
! !
! +-- Other
! ! +-- Typsafe Enumeration
! ! +-- ...
! !
! +-- ...
!
+-- Perl
+-- C/C++
+-- ...
It would be nice, if these bundles could be distributed easily and if
they could be browsed from within eclipse.
Therefore a webpage could be provided, where people can upload
new bundles or templates.
Bundles should be able to carry metainformation, like a name,
a description of what it does and what files will be created.
Shortcut Support (changed 10.12.2003)
================
Add support for shortcuts (Window->Preferences->Workbench->Keys)
Simteec
+----- new
+----- new with current file as template
+----- new with current file as properties
+----- new with current file as template and last used properties
+----- new with current file as properties and last used template
+----- replace content with current file as template
+----- replace content with current file as properties
+----- ...
+----- new with current class as properties
+----- ...
"new with current class as properties" = The current class will be parsed and
it's properties (method names, variable names, etc..) will be added to the
velocity context before parsing the template. This could be used to generate
hibernate files, struts form beans, etc. A very rough implementation could
just put the class file into the context. The template could then use reflection
to get the properties of that class.
A more advanced approach could provide an api with all relevant class information.
A preliminary API could look like this:
Object
getName - returns the current classname as String
getVisibility - returns String
isFinal - returns boolean
getMethods - returns list of Method-Objects
getAttributes - returns list of Attribute-Objects
Method
getName - returns String
getVisibility - returns String
isFinal - returns boolean
isStatic - returns boolean
getReturnType - returns String
getParameters - returns list of Parameters-Objects
Attribute
getName - returns String
getVisibility - returns String
isFinal - returns boolean
isStatic - returns boolean
getType - returns String
Parameters
getName - returns String
getType - returns String
The templates could access it like this:
$obj.getName, $obj.getAttributes, ...
A college mentioned an interesting project: http://qdox.sourceforge.net/
QDox would perfectly fit the needs for this plugin and i think
a little more investigation will follow.
Add Context Menues (changed 15.02.2004) PARTLY DONE
==================
!! right-click support for property files is implemented
Right-click on a class:
see "Shortcut Support"
The available options could be limited by the currently selected filetype.
For example: "new with current file as properties" is only available if
the selected file has the ending ".prop"
# i'am dreaming #
Replace eclipse's editor templates with SimTeEc
(Window->Preferences->Java->Editor->Templates
Integrate SimTeEc
These page was generated using SIMTEEC on Tue Apr 06 19:39:51 CEST 2004.