Skip to content

Commit 359dd11

Browse files
committed
Refactor MoodleSettingsForm to replace unstable textFieldWithBrowseButton with TextFieldWithBrowseButton.
1 parent 0f8b8f9 commit 359dd11

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
1010
### Fixed
1111

1212
- Replaced deprecated ProcessAdapter with ProcessListener in ComposerUtil.kt to maintain compatibility with latest IntelliJ Platform SDK
13+
- Removed usage of unstable UI DSL builder textFieldWithBrowseButton in MoodleSettingsForm by using Swing TextFieldWithBrowseButton within cell(...); satisfies UnstableApiUsage inspection
1314

1415
## [2.0.0] - 2025-04-15
1516

src/main/kotlin/il/co/sysbind/intellij/moodledev/project/MoodleSettingsForm.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ class MoodleSettingsForm(val project: Project) : PhpFrameworkConfigurable {
5858
}
5959

6060
row(MoodleBundle.getMessage("configurable.moodlePath.directory")) {
61-
moodlePath = textFieldWithBrowseButton(
62-
FileChooserDescriptorFactory.createSingleFolderDescriptor()
63-
.withTitle(MoodleBundle.message("configurable.moodlePath")),
64-
project
65-
).bindText(settings::moodlePath)
66-
.enabledIf(pluginEnabled.selected)
61+
val chooser = TextFieldWithBrowseButton()
62+
val descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
63+
.withTitle(MoodleBundle.message("configurable.moodlePath"))
64+
chooser.addBrowseFolderListener(com.intellij.openapi.ui.TextBrowseFolderListener(descriptor, project))
65+
moodlePath = cell(chooser)
66+
.bindText(settings::moodlePath)
67+
.enabledIf(pluginEnabled.selected)
6768
}
6869
}
6970

0 commit comments

Comments
 (0)