Skip to content

Commit

Permalink
Add comment for editor panel
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-oh committed Jul 20, 2024
1 parent ac8cf6e commit bd97c65
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import com.github.l34130.mise.settings.MiseSettings
import com.intellij.execution.configurations.RunConfigurationBase
import com.intellij.openapi.options.ConfigurationException
import com.intellij.openapi.options.SettingsEditor
import com.intellij.openapi.ui.panel.ComponentPanelBuilder
import com.intellij.openapi.util.Key
import com.intellij.ui.components.JBCheckBox
import com.intellij.ui.dsl.builder.panel
import org.jdom.Element
import java.awt.BorderLayout
import javax.swing.BoxLayout
import javax.swing.JCheckBox
import javax.swing.JComponent
import javax.swing.JPanel

Expand Down Expand Up @@ -62,25 +61,25 @@ class RunConfigurationSettingsEditor<T : RunConfigurationBase<*>>(
private class RunConfigurationSettingsPanel<T : RunConfigurationBase<*>>(
private val configuration: T,

Check warning on line 62 in modules/core/src/main/kotlin/com/github/l34130/mise/settings/ui/RunConfigurationSettingsEditor.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Property "configuration" is never used
) : JPanel() {
private val useMiseCheckBox = JCheckBox("Enable Mise")
val enableMiseCheckBox = JBCheckBox("Enable mise")

init {
val boxLayoutWrapper = JPanel()
val bl = BoxLayout(boxLayoutWrapper, BoxLayout.PAGE_AXIS)

boxLayoutWrapper.apply {
layout = bl
add(ComponentPanelBuilder(useMiseCheckBox).createPanel())
val p = panel {
row {
cell(enableMiseCheckBox).comment(
"Load environment variables from mise configuration file(s)",
)
}
}

layout = BorderLayout()
add(boxLayoutWrapper, BorderLayout.NORTH)
add(p)
}

var state: MiseSettings
get() = MiseSettings(useMiseCheckBox.isSelected)
get() = MiseSettings(enableMiseCheckBox.isSelected)
set(value) {
useMiseCheckBox.isSelected = value.miseEnabled
enableMiseCheckBox.isSelected = value.miseEnabled
}
}
}

0 comments on commit bd97c65

Please sign in to comment.