Skip to content

Commit 6107e79

Browse files
committed
Use better name for disabling/enabling next button
1 parent fd46c43 commit 6107e79

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/kotlin/com/coder/gateway/views/steps/CoderLocateRemoteProjectStepView.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import javax.swing.ListCellRenderer
7171
import javax.swing.SwingConstants
7272
import javax.swing.event.DocumentEvent
7373

74-
class CoderLocateRemoteProjectStepView(private val enableNextButton: (Boolean) -> Unit) : CoderWorkspacesWizardStep, Disposable {
74+
class CoderLocateRemoteProjectStepView(private val setNextButtonEnabled: (Boolean) -> Unit) : CoderWorkspacesWizardStep, Disposable {
7575
private val cs = CoroutineScope(Dispatchers.Main)
7676
private val coderClient: CoderRestClientService = ApplicationManager.getApplication().getService(CoderRestClientService::class.java)
7777

@@ -98,7 +98,7 @@ class CoderLocateRemoteProjectStepView(private val enableNextButton: (Boolean) -
9898
cbIDE = cell(IDEComboBox(ideComboBoxModel).apply {
9999
renderer = IDECellRenderer()
100100
addActionListener {
101-
enableNextButton(this.selectedItem != null)
101+
setNextButtonEnabled(this.selectedItem != null)
102102
ApplicationManager.getApplication().invokeLater {
103103
logger.info("Selected IDE: ${this.selectedItem}")
104104
when (this.selectedItem?.status) {
@@ -178,7 +178,7 @@ class CoderLocateRemoteProjectStepView(private val enableNextButton: (Boolean) -
178178
is SshException -> {
179179
logger.error("Can't connect to workspace ${selectedWorkspace.name}. Reason: $e")
180180
withContext(Dispatchers.Main) {
181-
enableNextButton(false)
181+
setNextButtonEnabled(false)
182182
cbIDE.renderer = object : ColoredListCellRenderer<IdeWithStatus>() {
183183
override fun customizeCellRenderer(list: JList<out IdeWithStatus>, value: IdeWithStatus?, index: Int, isSelected: Boolean, cellHasFocus: Boolean) {
184184
background = UIUtil.getListBackground(isSelected, cellHasFocus)
@@ -192,7 +192,7 @@ class CoderLocateRemoteProjectStepView(private val enableNextButton: (Boolean) -
192192
else -> {
193193
logger.error("Could not resolve any IDE for workspace ${selectedWorkspace.name}. Reason: $e")
194194
withContext(Dispatchers.Main) {
195-
enableNextButton(false)
195+
setNextButtonEnabled(false)
196196
cbIDE.renderer = object : ColoredListCellRenderer<IdeWithStatus>() {
197197
override fun customizeCellRenderer(list: JList<out IdeWithStatus>, value: IdeWithStatus?, index: Int, isSelected: Boolean, cellHasFocus: Boolean) {
198198
background = UIUtil.getListBackground(isSelected, cellHasFocus)

src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private const val SESSION_TOKEN = "session-token"
8989

9090
private const val MOUSE_OVER_TEMPLATE_NAME_COLUMN_ON_ROW = "MOUSE_OVER_TEMPLATE_NAME_COLUMN_ON_ROW"
9191

92-
class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) : CoderWorkspacesWizardStep, Disposable {
92+
class CoderWorkspacesStepView(val setNextButtonEnabled: (Boolean) -> Unit) : CoderWorkspacesWizardStep, Disposable {
9393
private val cs = CoroutineScope(Dispatchers.Main)
9494
private var localWizardModel = CoderWorkspacesWizardModel()
9595
private val coderClient: CoderRestClientService = service()
@@ -122,7 +122,7 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
122122
rowHeight = 48
123123
setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
124124
selectionModel.addListSelectionListener {
125-
enableNextButtonCallback(selectedObject != null && selectedObject?.agentStatus == RUNNING && selectedObject?.agentOS == OS.LINUX)
125+
setNextButtonEnabled(selectedObject != null && selectedObject?.agentStatus == RUNNING && selectedObject?.agentOS == OS.LINUX)
126126
if (selectedObject?.agentStatus == RUNNING && selectedObject?.agentOS != OS.LINUX) {
127127
notificationBanner.apply {
128128
component.isVisible = true

0 commit comments

Comments
 (0)