Skip to content

Commit 7629d24

Browse files
committed
Release 1.7
1 parent 2a74b93 commit 7629d24

File tree

3 files changed

+37
-27
lines changed

3 files changed

+37
-27
lines changed

resources/META-INF/plugin.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin>
22
<id>wu.seal.tool.jsontokotlin</id>
33
<name>JSON To Kotlin Class (JsonToKotlinClass)</name>
4-
<version>1.7-pre1</version>
4+
<version>1.7</version>
55
<vendor email="[email protected]" url="https://www.github.com/wuseal">Seal</vendor>
66

77
<description><![CDATA[
@@ -15,7 +15,13 @@
1515
]]></description>
1616

1717
<change-notes><![CDATA[
18-
1.Optimize auto input class name logic when only one class name in the kotlin file </br>
18+
1.Custom Annotation support multiple annotations on class and multiple annotations on property
19+
,With this function you could add extract annotation on class like `@Parcelize`
20+
,and also you could custom the annotation format to make it support `kotlinx.serializable`
21+
,the default value in custom option is set for `kotlinx.serializable` </br>
22+
How to use `Custom Annotation`?</br>
23+
`ALT`+`K`==>`Settings`==>`Annotation`==>Select `Others by customize`</br>
24+
Ok! You Got It! Have a good travel.
1925
]]>
2026
</change-notes>
2127

src/wu/seal/jsontokotlin/JsonToKotlinApplication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import wu.seal.jsontokotlin.feedback.sendHistoryActionInfo
1010
* Created by Seal.wu on 2017/8/21.
1111
*/
1212

13-
const val PLUGIN_VERSION = "1.7-pre1"
13+
const val PLUGIN_VERSION = "1.7"
1414

1515
class JsonToKotlinApplication : ApplicationComponent {
1616

src/wu/seal/jsontokotlin/ui/SettingsAnnotationTab.kt

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class SettingsAnnotationTab(layout: LayoutManager?, isDoubleBuffered: Boolean) :
4343

4444
subBoxPanel.minimumSize = JBDimension(480, 150)
4545

46+
subBoxPanel.border = JBEmptyBorder(0,10,0,0)
47+
4648
val subBoxLayout = BoxLayout(subBoxPanel, BoxLayout.PAGE_AXIS)
4749

4850
subBoxPanel.layout = subBoxLayout
@@ -61,7 +63,7 @@ class SettingsAnnotationTab(layout: LayoutManager?, isDoubleBuffered: Boolean) :
6163
boxPanel.add(annotationSelectPanel)
6264

6365
boxPanel.add(Box.createVerticalStrut(JBUI.scale(10)))
64-
boxPanel.add(Box.createHorizontalStrut(JBUI.scale(10)))
66+
6567
boxPanel.add(subBoxPanel)
6668

6769
subBoxPanel.isVisible = ConfigManager.targetJsonConverterLib == TargetJsonConverter.Custom
@@ -71,25 +73,26 @@ class SettingsAnnotationTab(layout: LayoutManager?, isDoubleBuffered: Boolean) :
7173

7274
border = JBEmptyBorder(0)
7375

74-
// val jbScrollPane = JBScrollPane(boxPanel)
75-
//
76-
// jbScrollPane.size = JBDimension(500, 320)
77-
// jbScrollPane.maximumSize = JBDimension(500, 320)
78-
// jbScrollPane.maximumSize = JBDimension(500, 320)
79-
//
80-
// jbScrollPane.border = null
81-
addComponentIntoVerticalBoxAlignmentLeft(boxPanel)
76+
val jbScrollPane = JBScrollPane(boxPanel)
77+
78+
jbScrollPane.size = JBDimension(500, 320)
79+
jbScrollPane.preferredSize = JBDimension(500, 320)
80+
jbScrollPane.maximumSize = JBDimension(500, 320)
81+
jbScrollPane.maximumSize = JBDimension(500, 320)
82+
83+
jbScrollPane.border = null
84+
addComponentIntoVerticalBoxAlignmentLeft(jbScrollPane)
8285

8386
}
8487

8588
private fun addAnnotationClassImportCodeSettingPanel(subBoxPanel: JPanel): JPanel {
8689
val annotationImportClass = JPanel(true)
87-
annotationImportClass.minimumSize = JBDimension(480, 60)
90+
annotationImportClass.minimumSize = JBDimension(460, 60)
8891
annotationImportClass.layout = BoxLayout(annotationImportClass, BoxLayout.PAGE_AXIS)
8992
val importClassLable = JBLabel("Annotation Import Class : ")
9093
annotationImportClass.addComponentIntoVerticalBoxAlignmentLeft(importClassLable)
9194
val annotationImportClassTextArea = JTextArea(ConfigManager.customAnnotaionImportClassString)
92-
annotationImportClassTextArea.minimumSize = JBDimension(480, 40)
95+
annotationImportClassTextArea.minimumSize = JBDimension(460, 40)
9396
annotationImportClassTextArea.addFocusListener(object : FocusListener {
9497
override fun focusLost(e: FocusEvent?) {
9598
ConfigManager.customAnnotaionImportClassString = annotationImportClassTextArea.text
@@ -101,7 +104,7 @@ class SettingsAnnotationTab(layout: LayoutManager?, isDoubleBuffered: Boolean) :
101104

102105
})
103106
val jbScrollPaneClassFormat = JBScrollPane(annotationImportClassTextArea)
104-
jbScrollPaneClassFormat.preferredSize = JBDimension(480, 40)
107+
jbScrollPaneClassFormat.preferredSize = JBDimension(460, 40)
105108
jbScrollPaneClassFormat.autoscrolls = true
106109
jbScrollPaneClassFormat.horizontalScrollBarPolicy = JBScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED
107110
jbScrollPaneClassFormat.verticalScrollBarPolicy = JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED
@@ -116,12 +119,12 @@ class SettingsAnnotationTab(layout: LayoutManager?, isDoubleBuffered: Boolean) :
116119

117120
private fun addPropertyAnnotationFormatSettingPanel(subBoxPanel: JPanel) {
118121
val annotationStringPanel = JPanel(true)
119-
annotationStringPanel.minimumSize = JBDimension(480, 60)
122+
annotationStringPanel.minimumSize = JBDimension(460, 60)
120123
annotationStringPanel.layout = BoxLayout(annotationStringPanel, BoxLayout.PAGE_AXIS)
121124
annotationStringPanel.addComponentIntoVerticalBoxAlignmentLeft(JBLabel("Property Annotation Format: "))
122125
val annotationFormatField = JTextArea(ConfigManager.customPropertyAnnotationFormatString)
123126

124-
annotationFormatField.minimumSize = JBDimension(480, 40)
127+
annotationFormatField.minimumSize = JBDimension(460, 40)
125128
annotationFormatField.addFocusListener(object : FocusListener {
126129
override fun focusLost(e: FocusEvent?) {
127130
ConfigManager.customPropertyAnnotationFormatString = annotationFormatField.text
@@ -133,7 +136,7 @@ class SettingsAnnotationTab(layout: LayoutManager?, isDoubleBuffered: Boolean) :
133136
})
134137

135138
val jbScrollPanePropertyFormat = JBScrollPane(annotationFormatField)
136-
jbScrollPanePropertyFormat.preferredSize = JBDimension(480, 40)
139+
jbScrollPanePropertyFormat.preferredSize = JBDimension(460, 40)
137140
jbScrollPanePropertyFormat.autoscrolls = true
138141
jbScrollPanePropertyFormat.horizontalScrollBarPolicy = JBScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED
139142
jbScrollPanePropertyFormat.verticalScrollBarPolicy = JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED
@@ -147,12 +150,12 @@ class SettingsAnnotationTab(layout: LayoutManager?, isDoubleBuffered: Boolean) :
147150

148151
private fun addClassAnnotationFormatSettingPanel(subBoxPanel: JPanel) {
149152
val annotationClasssFormatStringPanel = JPanel(true)
150-
annotationClasssFormatStringPanel.minimumSize = JBDimension(480, 60)
153+
annotationClasssFormatStringPanel.minimumSize = JBDimension(460, 60)
151154
annotationClasssFormatStringPanel.layout = BoxLayout(annotationClasssFormatStringPanel, BoxLayout.PAGE_AXIS)
152155
annotationClasssFormatStringPanel.addComponentIntoVerticalBoxAlignmentLeft(JBLabel("Class Annotation Format: "))
153156
val annotationClassFormatField = JTextArea(ConfigManager.customClassAnnotationFormatString)
154157

155-
annotationClassFormatField.minimumSize = JBDimension(480, 40)
158+
annotationClassFormatField.minimumSize = JBDimension(460, 40)
156159
annotationClassFormatField.addFocusListener(object : FocusListener {
157160
override fun focusLost(e: FocusEvent?) {
158161
ConfigManager.customClassAnnotationFormatString = annotationClassFormatField.text
@@ -164,7 +167,7 @@ class SettingsAnnotationTab(layout: LayoutManager?, isDoubleBuffered: Boolean) :
164167
})
165168

166169
val jbScrollPaneClassAnnotationFormat = JBScrollPane(annotationClassFormatField)
167-
jbScrollPaneClassAnnotationFormat.preferredSize = JBDimension(480, 40)
170+
jbScrollPaneClassAnnotationFormat.preferredSize = JBDimension(460, 40)
168171
jbScrollPaneClassAnnotationFormat.autoscrolls = true
169172
jbScrollPaneClassAnnotationFormat.horizontalScrollBarPolicy = JBScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED
170173
jbScrollPaneClassAnnotationFormat.verticalScrollBarPolicy = JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED
@@ -289,14 +292,15 @@ class SettingsAnnotationTab(layout: LayoutManager?, isDoubleBuffered: Boolean) :
289292
gridLayout.add(radioButtonLoganSquare)
290293
gridLayout.add(radioButtonCustom)
291294

292-
gridLayout.size = JBDimension(480, 180)
293-
gridLayout.maximumSize = JBDimension(480, 180)
294-
gridLayout.maximumSize = JBDimension(480, 180)
295+
gridLayout.size = JBDimension(480, 200)
296+
gridLayout.preferredSize = JBDimension(480, 200)
297+
gridLayout.maximumSize = JBDimension(480, 200)
298+
gridLayout.maximumSize = JBDimension(480, 200)
295299

296300

297-
size = JBDimension(480, 180)
298-
maximumSize = JBDimension(480, 180)
299-
maximumSize = JBDimension(480, 180)
301+
size = JBDimension(480, 200)
302+
maximumSize = JBDimension(480, 200)
303+
maximumSize = JBDimension(480, 200)
300304

301305
addComponentIntoVerticalBoxAlignmentLeft(gridLayout)
302306
}

0 commit comments

Comments
 (0)