History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEABKL-3623
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Eugene Vigdorchik
Reporter: Christian Schneider
Votes: 1
Watchers: 2
Available Workflow Actions

Mark as Stalled
Operations

If you were logged in you would be able to see more operations.
IDEA: Backlog

Custom expressions in Live Templates

Created: 15 May 06 16:18   Updated: 14 Oct 06 09:05
Component/s: Editor. Editing Text
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 4,192
Severity: High


 Description  « Hide
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 :-/



 All   Comments   Work Log   Change History      Sort Order:
Tom Hughes - 14 Oct 06 09:05
I would like to do something similar. I'm not sure whether java expressions are the way to go or more functions.

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.