Skip to content

Commit b822078

Browse files
committed
refactoring
1 parent 4e890e2 commit b822078

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/main/kotlin/com/vk/admstorm/ssh/EnterPasswordDialog.kt

+9-10
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@ class EnterPasswordDialog(project: Project) : DialogWrapper(project, true, IdeMo
2929
}
3030
}
3131

32-
private var myPasswordInput = JBPasswordField()
33-
private val myRememberCheckBox = JBCheckBox("Remember", true)
34-
35-
fun getPassword() = String(myPasswordInput.password)
36-
fun isRemember() = myRememberCheckBox.isSelected
37-
32+
private var passwordInput = JBPasswordField()
33+
private val rememberCheckBox = JBCheckBox("Remember", true)
3834
private val warningLabel = JLabel().apply { foreground = JBColor.RED }
3935

36+
fun getPassword() = String(passwordInput.password)
37+
fun isRemember() = rememberCheckBox.isSelected
38+
4039
init {
4140
title = "Enter PIN"
4241

4342
init()
4443

45-
myPasswordInput.addKeyListener(object : KeyAdapter() {
44+
passwordInput.addKeyListener(object : KeyAdapter() {
4645
override fun keyReleased(e: KeyEvent) {
4746
if (getPassword().any { it in 'А'..'я' || it == 'ё' || it == 'Ё' }) {
4847
warningLabel.text = "PIN should contain only English characters and numbers!"
@@ -53,12 +52,12 @@ class EnterPasswordDialog(project: Project) : DialogWrapper(project, true, IdeMo
5352
})
5453
}
5554

56-
override fun getPreferredFocusedComponent() = myPasswordInput
55+
override fun getPreferredFocusedComponent() = passwordInput
5756

5857
override fun createSouthAdditionalPanel(): JPanel {
5958
return panel {
6059
row {
61-
cell(myRememberCheckBox)
60+
cell(rememberCheckBox)
6261
}
6362
}
6463
}
@@ -70,7 +69,7 @@ class EnterPasswordDialog(project: Project) : DialogWrapper(project, true, IdeMo
7069
}.topGap(TopGap.NONE)
7170

7271
row {
73-
cell(myPasswordInput)
72+
cell(passwordInput)
7473
.align(AlignX.FILL)
7574
}.bottomGap(BottomGap.NONE)
7675

0 commit comments

Comments
 (0)