File Templates: pre-defined variables?

I'm trying to figure out a way to have the "implemented method body" file
template for Code do something besides the default behavior. I'd like to have
it do this when I'm implementing an interface:

public interface ImplCreator {

void setName( String name );
String getName();

void setIsEnabled( boolean isEnabled );
boolean isEnabled();

}

I'd like the result to be:

public class ImplCreatorImpl implements ImplCreator {

public void setName( String name ) {
m_name = name;
}

public String getName() {
return m_name;
}

public void setIsEnabled( boolean isEnabled ) {
m_isEnabled = isEnabled;
}

public boolean isEnabled() {
return m_isEnabled;
}

}


Even better, I'd like it to declare the private instance variables as well, but
that's easy enough to do later.

Right now the file template is:

#if ( $RETURN_TYPE != "void" )return $DEFAULT_RETURN_VALUE;#end

But I don't know what other $ variables exist that I can use.

Any suggestions?

;ted


1 comment
Comment actions Permalink

I don't think the thing which you would like to get is possible to do with
existing file templates but you may vote for
http://www.intellij.net/tracker/idea/viewSCR?publicId=287 which seems to be
very similar to that.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Ted Young" <idea@jitterpig.com> wrote in message
news:bdio81$j3h$1@is.intellij.net...

I'm trying to figure out a way to have the "implemented method body" file
template for Code do something besides the default behavior. I'd like to

have

it do this when I'm implementing an interface:

>

public interface ImplCreator {

>

void setName( String name );
String getName();

>

void setIsEnabled( boolean isEnabled );
boolean isEnabled();

>

}

>

I'd like the result to be:

>

public class ImplCreatorImpl implements ImplCreator {

>

public void setName( String name ) {
m_name = name;
}

>

public String getName() {
return m_name;
}

>

public void setIsEnabled( boolean isEnabled ) {
m_isEnabled = isEnabled;
}

>

public boolean isEnabled() {
return m_isEnabled;
}

>

}

>
>

Even better, I'd like it to declare the private instance variables as

well, but

that's easy enough to do later.

>

Right now the file template is:

>

#if ( $RETURN_TYPE != "void" )return $DEFAULT_RETURN_VALUE;#end

>

But I don't know what other $ variables exist that I can use.

>

Any suggestions?

>

;ted

>
>


0

Please sign in to leave a comment.