I'd like to specify java expressions for the variables in live templates. E.g.
varName.toUpperCase().replaceAll("a","b")
Additionally it would be nice if plugins could add predefined functions there. (Is this already possible?)
P.S. the 'components' list does not contain a really approriate category for this issue :-/
I would like to write a live template for a bound property. I want to generate code like this (example is for property 'name') :
public static final String PROP_NAME = "name";
private String name;
public void setName(String newName) {
String oldName = getName();
name = newName;
firePropertyChange(PROP_NAME, newName, oldName);
}
public String getName() {
return name;
}
So I want the user to define the name of the property ($PROP$). I would like the name of the property constant to be another variable with the default value PROP_$PROP$.toUpperCase() - Currently can't do this (as far as I know).
I was going to define this template multiple times, for String, int, boolean etc. Ideally though there would be the power to specify another variable to be selected from a list of types (int, String, boolean etc...). This would require a function to generate the getter name as for boolean properties isFoo should be used instead of getFoo. This is less important though as I can manage on a version of the template for each type.