add default variables to override/implement templates (IDEA-91704)

This commit is contained in:
peter
2012-09-18 18:39:33 +04:00
parent be7709e957
commit a5fcff9394
4 changed files with 18 additions and 2 deletions
@@ -472,7 +472,7 @@ public class OverrideImplementUtil {
if (returnType == null) {
returnType = PsiType.VOID;
}
Properties properties = new Properties();
Properties properties = FileTemplateManager.getInstance().getDefaultProperties(targetClass.getProject());
properties.setProperty(FileTemplate.ATTRIBUTE_RETURN_TYPE, returnType.getPresentableText());
properties.setProperty(FileTemplate.ATTRIBUTE_DEFAULT_RETURN_VALUE, PsiTypesUtil.getDefaultValueOfType(returnType));
properties.setProperty(FileTemplate.ATTRIBUTE_CALL_SUPER, callSuper(originalMethod, result));
@@ -180,7 +180,7 @@ public class GroovyOverrideImplementUtil {
if (returnType != null) {
returnTypeText = returnType.getPresentableText();
}
Properties properties = new Properties();
Properties properties = FileTemplateManager.getInstance().getDefaultProperties(project);
properties.setProperty(FileTemplate.ATTRIBUTE_RETURN_TYPE, returnTypeText);
properties.setProperty(FileTemplate.ATTRIBUTE_DEFAULT_RETURN_VALUE, PsiTypesUtil.getDefaultValueOfType(returnType));
@@ -40,6 +40,14 @@ calling the <b>Code | Implement Method...</b> function (<b><i>Ctrl+I</i></b>).<b
<td width="10">&nbsp;</td>
<td valign="top"><font face="verdana" size="-1">non-qualified name of the class where method is implemented</font></td>
</tr>
<tr>
<td colspan="3"><font face="verdana" size="-1">All the predefined variables from "File Header" Include template are also available
(e.g.
<font face="verdana" size="-2" color="#7F0000"><b><i>${USER}</i></b></font>,
<font face="verdana" size="-2" color="#7F0000"><b><i>${DATE}</i></b></font>,
etc)</font>
</td>
</tr>
</table>
</body>
</html>
@@ -46,6 +46,14 @@
<td width="10">&nbsp;</td>
<td valign="top"><font face="verdana" size="-1">non-qualified name of the class where method is implemented</font></td>
</tr>
<tr>
<td colspan="3"><font face="verdana" size="-1">All the predefined variables from "File Header" Include template are also available
(e.g.
<font face="verdana" size="-2" color="#7F0000"><b><i>${USER}</i></b></font>,
<font face="verdana" size="-2" color="#7F0000"><b><i>${DATE}</i></b></font>,
etc)</font>
</td>
</tr>
</table>
</body>