Eclipse: Java class templates
You can add 'new file wizards' to eclipse, but you'll need to write a new plugin to do it. I don't know of an easy way to do this at runtime, in the style of MS Office templates, which I think is what you're trying to do.
A new mechanism for templates might be a useful plugin, but I can't find anything that does that already.
Yes! Window -> Preferences -> Java -> Code Style -> Code Templates
Select Code in the tree panel and new Java files.
What you could do is add a normal code short cut (java --> editor --> templates),
i.e. make an editor template "newcustomclass" be the contents of the class you're talking about.
Then create the new java class in the normal way, delete all the content and then use the "newcustomclass" code template to create the new auto java class.
Here's an example for a simple exception class:
public class ${enclosing_type} extends Exception {
/**
* Constructs with the given throwable
* @param t the throwable to throw
*/
public ${enclosing_type}(Throwable t) {
super(t);
}
/**
* Constructs with the given message
* @param message the message of the exception
*/
public ${enclosing_type}(String message) {
super(message);
}
/**
* Constructs with the given message and the original throwable cause
* @param message the message of the exception
* @param t the original throwable
*/
public ${enclosing_type}(String message, Throwable t) {
super(message, t);
}
}