Add Kotlin Data Class, Sealed Class and Annotation file templates
#KT-20775 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
2162c39ab3
commit
597bc061e2
@@ -341,6 +341,9 @@ action.new.file.description=Creates new Kotlin class or file
|
||||
action.new.file.dialog.title=New Kotlin Class/File
|
||||
action.new.file.dialog.file.title=File
|
||||
action.new.file.dialog.class.title=Class
|
||||
action.new.file.dialog.data.class.title=Data Class
|
||||
action.new.file.dialog.sealed.class.title=Sealed Class
|
||||
action.new.file.dialog.annotation.title=Annotation
|
||||
action.new.file.dialog.interface.title=Interface
|
||||
action.new.file.dialog.enum.title=Enum class
|
||||
action.new.file.dialog.object.title=Object
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}
|
||||
|
||||
#end
|
||||
#parse("File Header.java")
|
||||
annotation class ${NAME}()
|
||||
@@ -0,0 +1,5 @@
|
||||
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}
|
||||
|
||||
#end
|
||||
#parse("File Header.java")
|
||||
data class ${NAME}()
|
||||
@@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<body>
|
||||
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse">
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<font face="verdana" size="-1">
|
||||
This is a built-in template used by <b>IDEA</b> each time you create a
|
||||
Kotlin data class
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}
|
||||
|
||||
#end
|
||||
#parse("File Header.java")
|
||||
sealed class ${NAME}
|
||||
@@ -91,11 +91,26 @@ class NewKotlinFileAction : CreateFileFromTemplateAction(
|
||||
KotlinIcons.INTERFACE,
|
||||
"Kotlin Interface"
|
||||
)
|
||||
.addKind(
|
||||
KotlinBundle.message("action.new.file.dialog.data.class.title"),
|
||||
KotlinIcons.CLASS,
|
||||
"Kotlin Data Class"
|
||||
)
|
||||
.addKind(
|
||||
KotlinBundle.message("action.new.file.dialog.enum.title"),
|
||||
KotlinIcons.ENUM,
|
||||
"Kotlin Enum"
|
||||
)
|
||||
.addKind(
|
||||
KotlinBundle.message("action.new.file.dialog.sealed.class.title"),
|
||||
KotlinIcons.CLASS,
|
||||
"Kotlin Sealed Class"
|
||||
)
|
||||
.addKind(
|
||||
KotlinBundle.message("action.new.file.dialog.annotation.title"),
|
||||
KotlinIcons.ANNOTATION,
|
||||
"Kotlin Annotation"
|
||||
)
|
||||
.addKind(
|
||||
KotlinBundle.message("action.new.file.dialog.object.title"),
|
||||
KotlinIcons.OBJECT,
|
||||
|
||||
Reference in New Issue
Block a user