customize the get functions & the try catch block

Is there a way to customize:

1. The get functions that get generated through the Generate option? I want to have something like this:

get() { if ( == null) { = new } return ]]>;
}

2. The try catch block that gets added when I use CTRLALTT? I want to change the name of the exception from e to ex.

I could not find the templates for these files.



Thank you

Edited by: costa basil on Nov 20, 2008 1:15 AM

1 comment
Comment actions Permalink

Hello costa,

Is there a way to customize:

1. The get functions that get generated through the Generate option? I
want to have something like this:

<filedNameClass> get<fieldName>()
{
if (<fieldName> == null)
{
<fieldName> = new <fieldNameClass>
}
return <fieldName>;
}


No, this is not possible to customize. Since the template you want to use
is not applicable for all types (it won't work if ]]> is int,
for example), you should create a live template for such a getter, rather
than trying to customize the code created by "Generate".

2. The try catch block that gets added when I use CTRLALTT? I want
to change the name of the exception from e to ex.


This is also not configurable through the UI at the moment.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.