IntelliJ Java Code Templates Configuration: Difference between revisions
Jump to navigation
Jump to search
m (Ovidiu moved page IntelliJ Java Class Templates Configuration to IntelliJ Java Code Templates Configuration without leaving a redirect) |
No edit summary |
||
Line 4: | Line 4: | ||
=Overview= | =Overview= | ||
Settings -> Editor -> Code & Style -> File and Code Templates -> Templates tab | |||
=Class Template= | |||
<pre> | |||
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |||
#parse("File Header.java") | |||
public class ${NAME} { | |||
// Constants ------------------------------------------------------------------------------------------------------- | |||
// Static ---------------------------------------------------------------------------------------------------------- | |||
// Attributes ------------------------------------------------------------------------------------------------------ | |||
// Constructors ---------------------------------------------------------------------------------------------------- | |||
// Public ---------------------------------------------------------------------------------------------------------- | |||
// Package protected ----------------------------------------------------------------------------------------------- | |||
// Protected ------------------------------------------------------------------------------------------------------- | |||
// Private --------------------------------------------------------------------------------------------------------- | |||
// Inner classes --------------------------------------------------------------------------------------------------- | |||
} | |||
<pre> | |||
=Interface Template= | |||
<pre> | |||
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |||
#parse("File Header.java") | |||
public interface ${NAME} { | |||
// Constants ------------------------------------------------------------------------------------------------------- | |||
// Static ---------------------------------------------------------------------------------------------------------- | |||
// Public ---------------------------------------------------------------------------------------------------------- | |||
} | |||
</pre> | |||
=File Header= | |||
Then go to the "Includes" tab and edit File Header: | |||
<pre> | |||
/** | |||
* @author Ovidiu Feodorov <ovidiu@novaordis.com> | |||
* @since ${DATE} | |||
*/ | |||
</pre> | |||
=Method Template= | |||
Preferences -> Editor -> File and Code Templates -> Code tab -> Implemented Method Body | |||
Replace the content with | |||
<pre> | |||
throw new NotYetImplementedException("${METHOD_NAME}() NOT YET IMPLEMENTED"); | |||
</pre> |
Revision as of 16:31, 20 December 2016
Internal
Overview
Settings -> Editor -> Code & Style -> File and Code Templates -> Templates tab
Class Template
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse("File Header.java") public class ${NAME} { // Constants ------------------------------------------------------------------------------------------------------- // Static ---------------------------------------------------------------------------------------------------------- // Attributes ------------------------------------------------------------------------------------------------------ // Constructors ---------------------------------------------------------------------------------------------------- // Public ---------------------------------------------------------------------------------------------------------- // Package protected ----------------------------------------------------------------------------------------------- // Protected ------------------------------------------------------------------------------------------------------- // Private --------------------------------------------------------------------------------------------------------- // Inner classes --------------------------------------------------------------------------------------------------- } <pre> =Interface Template= <pre> #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse("File Header.java") public interface ${NAME} { // Constants ------------------------------------------------------------------------------------------------------- // Static ---------------------------------------------------------------------------------------------------------- // Public ---------------------------------------------------------------------------------------------------------- }
File Header
Then go to the "Includes" tab and edit File Header:
/** * @author Ovidiu Feodorov <ovidiu@novaordis.com> * @since ${DATE} */
Method Template
Preferences -> Editor -> File and Code Templates -> Code tab -> Implemented Method Body
Replace the content with
throw new NotYetImplementedException("${METHOD_NAME}() NOT YET IMPLEMENTED");