@@ -7,6 +7,12 @@ import com.intellij.util.ui.JBUI
77import wu.seal.jsontokotlin.ConfigManager
88import wu.seal.jsontokotlin.TargetJsonConverter
99import wu.seal.jsontokotlin.addComponentIntoVerticalBoxAlignmentLeft
10+ import java.awt.Color
11+ import java.awt.FlowLayout
12+ import java.awt.GridLayout
13+ import java.awt.LayoutManager
14+ import java.awt.event.FocusEvent
15+ import java.awt.event.FocusListener
1016import javax.swing.*
1117import javax.swing.border.EmptyBorder
1218
@@ -16,11 +22,11 @@ import javax.swing.border.EmptyBorder
1622 * property config panel
1723 * Created by seal wu on 2017/9/18.
1824 */
19- class PropertyPanel (layout : java.awt. LayoutManager ? , isDoubleBuffered : Boolean ) : JPanel(layout, isDoubleBuffered) {
25+ class PropertyPanel (layout : LayoutManager ? , isDoubleBuffered : Boolean ) : JPanel(layout, isDoubleBuffered) {
2026
21- constructor (layout: java.awt. LayoutManager ? ) : this (layout, false )
27+ constructor (layout: LayoutManager ? ) : this (layout, false )
2228
23- constructor (isDoubleBuffered: Boolean ) : this (java.awt. FlowLayout (), isDoubleBuffered)
29+ constructor (isDoubleBuffered: Boolean ) : this (FlowLayout (), isDoubleBuffered)
2430
2531
2632 init {
@@ -67,7 +73,7 @@ class PropertyPanel(layout: java.awt.LayoutManager?, isDoubleBuffered: Boolean)
6773 val line = com.intellij.util.xml.ui.TextPanel ()
6874 line.maximumSize = JBDimension (480 , 1 )
6975 line.minimumSize = JBDimension (480 , 1 )
70- line.background = java.awt. Color .GRAY
76+ line.background = Color .GRAY
7177
7278 add(line)
7379
@@ -102,17 +108,17 @@ class PropertyPanel(layout: java.awt.LayoutManager?, isDoubleBuffered: Boolean)
102108/* *
103109 * Comment Config Panel
104110 */
105- class CommentConfigPanel (layout : java.awt. LayoutManager ? , isDoubleBuffered : Boolean ) : JPanel(layout, isDoubleBuffered) {
111+ class CommentConfigPanel (layout : LayoutManager ? , isDoubleBuffered : Boolean ) : JPanel(layout, isDoubleBuffered) {
106112
107- constructor (layout: java.awt. LayoutManager ? ) : this (layout, false )
113+ constructor (layout: LayoutManager ? ) : this (layout, false )
108114
109- constructor (isDoubleBuffered: Boolean ) : this (java.awt. FlowLayout (), isDoubleBuffered)
115+ constructor (isDoubleBuffered: Boolean ) : this (FlowLayout (), isDoubleBuffered)
110116
111117 init {
112118
113119 val bordWidth = JBUI .scale(10 )
114120 border = EmptyBorder (bordWidth, bordWidth, bordWidth, bordWidth)
115- setLayout(java.awt. GridLayout (6 , 1 , 10 , 10 ))
121+ setLayout(GridLayout (6 , 1 , 10 , 10 ))
116122
117123 val radioButtonOpen = JRadioButton (" On" )
118124
@@ -144,11 +150,11 @@ class CommentConfigPanel(layout: java.awt.LayoutManager?, isDoubleBuffered: Bool
144150/* *
145151 * Target JsonLib ConfigPanel container
146152 */
147- class TargetJsonLibConfigPanelContainer (layout : java.awt. LayoutManager ? , isDoubleBuffered : Boolean ) : JPanel(layout, isDoubleBuffered) {
153+ class TargetJsonLibConfigPanelContainer (layout : LayoutManager ? , isDoubleBuffered : Boolean ) : JPanel(layout, isDoubleBuffered) {
148154
149- constructor (layout: java.awt. LayoutManager ? ) : this (layout, false )
155+ constructor (layout: LayoutManager ? ) : this (layout, false )
150156
151- constructor (isDoubleBuffered: Boolean ) : this (java.awt. FlowLayout (), isDoubleBuffered)
157+ constructor (isDoubleBuffered: Boolean ) : this (FlowLayout (), isDoubleBuffered)
152158
153159 init {
154160 val boxLayout = BoxLayout (this , BoxLayout .PAGE_AXIS )
@@ -164,37 +170,37 @@ class TargetJsonLibConfigPanelContainer(layout: java.awt.LayoutManager?, isDoubl
164170 subBoxPanel.layout = subBoxLayout
165171 val annotationStringPanel = JPanel (true )
166172 annotationStringPanel.maximumSize = JBDimension (480 , 30 )
167- annotationStringPanel.layout = java.awt. FlowLayout (java.awt. FlowLayout .LEFT )
173+ annotationStringPanel.layout = FlowLayout (FlowLayout .LEFT )
168174 annotationStringPanel.add(JBLabel (" Property Annotation Format: " ))
169175 val annotationFormatField = JTextField (ConfigManager .customAnnotaionFormatString)
170176 val fieldDefaultFont = annotationFormatField.font
171- annotationFormatField.addFocusListener(object : java.awt.event. FocusListener {
172- override fun focusLost (e : java.awt.event. FocusEvent ? ) {
177+ annotationFormatField.addFocusListener(object : FocusListener {
178+ override fun focusLost (e : FocusEvent ? ) {
173179 ConfigManager .customAnnotaionFormatString = annotationFormatField.text
174180 }
175181
176- override fun focusGained (e : java.awt.event. FocusEvent ? ) {
182+ override fun focusGained (e : FocusEvent ? ) {
177183 }
178184
179185 })
180- annotationStringPanel.add(annotationFormatField, java.awt. FlowLayout .CENTER )
186+ annotationStringPanel.add(annotationFormatField, FlowLayout .CENTER )
181187 subBoxPanel.addComponentIntoVerticalBoxAlignmentLeft(annotationStringPanel)
182188
183189 val annotationImportClass = JPanel (true )
184- annotationImportClass.layout = java.awt. FlowLayout (java.awt. FlowLayout .LEFT )
190+ annotationImportClass.layout = FlowLayout (FlowLayout .LEFT )
185191 val importClassLable = JBLabel (" Property Annotation Import Class : " )
186- importClassLable.border = JBEmptyBorder (3 ,0 , 3 , 0 )
192+ importClassLable.border = JBEmptyBorder (3 , 0 , 3 , 0 )
187193 annotationImportClass.add(importClassLable)
188194 val annotationImportClassTextArea = JTextArea (ConfigManager .customAnnotaionImportClassString)
189195 annotationImportClassTextArea.font = fieldDefaultFont
190196 annotationImportClassTextArea.preferredSize = JBDimension (480 , 30 )
191- annotationImportClassTextArea.addFocusListener(object : java.awt.event. FocusListener {
192- override fun focusLost (e : java.awt.event. FocusEvent ? ) {
197+ annotationImportClassTextArea.addFocusListener(object : FocusListener {
198+ override fun focusLost (e : FocusEvent ? ) {
193199 ConfigManager .customAnnotaionImportClassString = annotationImportClassTextArea.text
194200
195201 }
196202
197- override fun focusGained (e : java.awt.event. FocusEvent ? ) {
203+ override fun focusGained (e : FocusEvent ? ) {
198204 }
199205
200206 })
@@ -217,16 +223,17 @@ class TargetJsonLibConfigPanelContainer(layout: java.awt.LayoutManager?, isDoubl
217223/* *
218224 * Target JsonLib ConfigPanel
219225 */
220- class TargetJsonLibConfigPanel (layout : java.awt. LayoutManager ? , isDoubleBuffered : Boolean , callBack : (selected: Boolean ) -> Unit ) : JPanel(layout, isDoubleBuffered) {
226+ class TargetJsonLibConfigPanel (layout : LayoutManager ? , isDoubleBuffered : Boolean , callBack : (selected: Boolean ) -> Unit ) : JPanel(layout, isDoubleBuffered) {
221227
222- constructor (layout: java.awt. LayoutManager ? , callBack: (selected: Boolean ) -> Unit ) : this (layout, false , callBack)
228+ constructor (layout: LayoutManager ? , callBack: (selected: Boolean ) -> Unit ) : this (layout, false , callBack)
223229
224- constructor (isDoubleBuffered: Boolean , callBack: (selected: Boolean ) -> Unit ) : this (java.awt. FlowLayout (), isDoubleBuffered, callBack)
230+ constructor (isDoubleBuffered: Boolean , callBack: (selected: Boolean ) -> Unit ) : this (FlowLayout (), isDoubleBuffered, callBack)
225231
226232 init {
227- setLayout(java.awt. GridLayout (4 , 2 , 10 , 10 ))
233+ setLayout(GridLayout (4 , 2 , 10 , 10 ))
228234
229235 val radioButtonNone = JRadioButton (" None" )
236+ val radioButtonNoneWithCamelCase = JRadioButton (" None (Camel Case)" )
230237 val radioButtonGson = JRadioButton (" Gson" )
231238 val radioButtonJackson = JRadioButton (" Jackson" )
232239 val radioButtonFastjson = JRadioButton (" Fastjson" )
@@ -238,6 +245,11 @@ class TargetJsonLibConfigPanel(layout: java.awt.LayoutManager?, isDoubleBuffered
238245 ConfigManager .targetJsonConverterLib = TargetJsonConverter .None
239246 callBack(ConfigManager .targetJsonConverterLib == TargetJsonConverter .Custom )
240247
248+ }
249+ radioButtonNoneWithCamelCase.addActionListener {
250+ ConfigManager .targetJsonConverterLib = TargetJsonConverter .NoneWithCamelCase
251+ callBack(ConfigManager .targetJsonConverterLib == TargetJsonConverter .Custom )
252+
241253 }
242254 radioButtonGson.addActionListener {
243255 ConfigManager .targetJsonConverterLib = TargetJsonConverter .Gson
@@ -271,6 +283,10 @@ class TargetJsonLibConfigPanel(layout: java.awt.LayoutManager?, isDoubleBuffered
271283
272284 radioButtonNone.isSelected = true
273285
286+ } else if (ConfigManager .targetJsonConverterLib == TargetJsonConverter .NoneWithCamelCase ) {
287+
288+ radioButtonNoneWithCamelCase.isSelected = true
289+
274290 } else if (ConfigManager .targetJsonConverterLib == TargetJsonConverter .Gson ) {
275291
276292 radioButtonGson.isSelected = true
@@ -295,6 +311,7 @@ class TargetJsonLibConfigPanel(layout: java.awt.LayoutManager?, isDoubleBuffered
295311
296312 val buttonGroupProperty = ButtonGroup ()
297313 buttonGroupProperty.add(radioButtonNone)
314+ buttonGroupProperty.add(radioButtonNoneWithCamelCase)
298315 buttonGroupProperty.add(radioButtonGson)
299316 buttonGroupProperty.add(radioButtonJackson)
300317 buttonGroupProperty.add(radioButtonFastjson)
@@ -303,6 +320,7 @@ class TargetJsonLibConfigPanel(layout: java.awt.LayoutManager?, isDoubleBuffered
303320 buttonGroupProperty.add(radioButtonCustom)
304321
305322 add(radioButtonNone)
323+ add(radioButtonNoneWithCamelCase)
306324 add(radioButtonGson)
307325 add(radioButtonJackson)
308326 add(radioButtonFastjson)
0 commit comments