Skip to content

Commit d2bd61e

Browse files
author
Dzianis Lisiankou
committed
Merge branch 'bugfix/IJMP-1950' into 'release/v1.2.3-221'
IJMP-1950: convert new name to uppercase when renaming datasets or members See merge request ijmp/for-mainframe!589
2 parents c927aa8 + 57f647a commit d2bd61e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/RenameDialog.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ class RenameDialog(
6161
textField()
6262
.bindText(this@RenameDialog::state)
6363
.validationOnApply { validateForBlank(it) ?: validateOnInput(it) }
64-
.apply { focused() }
64+
.onApply { state = state.uppercaseIfNeeded() }
65+
.focused()
6566
}
6667
}
6768
}
@@ -78,6 +79,8 @@ class RenameDialog(
7879
* Validate a new name for the selected node component
7980
*/
8081
private fun validateOnInput(component: JTextField): ValidationInfo? {
82+
component.text = component.text.uppercaseIfNeeded()
83+
8184
val attributes = selectedNodeData.attributes
8285

8386
validateForTheSameValue(attributes?.name, component)?.let { return it }
@@ -102,4 +105,15 @@ class RenameDialog(
102105
return null
103106
}
104107

108+
/**
109+
* Convert the string to upper case if partitioned dataset, sequential dataset or dataset member is selected
110+
*/
111+
private fun String.uppercaseIfNeeded(): String {
112+
return if (node is LibraryNode || node is FileLikeDatasetNode) {
113+
this.uppercase()
114+
} else {
115+
this
116+
}
117+
}
118+
105119
}

0 commit comments

Comments
 (0)