Scratch: move 'Make module' checkbox closer to modules combobox

^KT-28910
This commit is contained in:
Natalia Selezneva
2018-12-26 10:14:07 +03:00
parent 404c3ea57b
commit 022b21efa0
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.idea.scratch.ui
import com.intellij.application.options.ModulesComboBox
import com.intellij.execution.ui.ConfigurationModuleSelector
import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.ActionPlaces
@@ -72,6 +71,14 @@ class ScratchTopPanel private constructor(val scratchFile: ScratchFile) : JPanel
add(JLabel("Use classpath of module"))
add(moduleChooser)
isMakeBeforeRunCheckbox = JCheckBox("Make before Run")
add(isMakeBeforeRunCheckbox)
isMakeBeforeRunCheckbox.addItemListener {
scratchFile.saveOptions {
copy(isMakeBeforeRun = isMakeBeforeRunCheckbox.isSelected)
}
}
add(JSeparator(SwingConstants.VERTICAL))
isReplCheckbox = JCheckBox("Use REPL")
@@ -84,16 +91,6 @@ class ScratchTopPanel private constructor(val scratchFile: ScratchFile) : JPanel
add(JSeparator(SwingConstants.VERTICAL))
isMakeBeforeRunCheckbox = JCheckBox("Make before Run")
add(isMakeBeforeRunCheckbox)
isMakeBeforeRunCheckbox.addItemListener {
scratchFile.saveOptions {
copy(isMakeBeforeRun = isMakeBeforeRunCheckbox.isSelected)
}
}
add(JSeparator(SwingConstants.VERTICAL))
scratchFile.options.let {
isReplCheckbox.isSelected = it.isRepl
isMakeBeforeRunCheckbox.isSelected = it.isMakeBeforeRun