Skip to content

Commit 50b84fb

Browse files
authored
Migrate from UI DSL v1 to v2 - 4 (#3834)
1 parent 5a4e5ed commit 50b84fb

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

jetbrains-core/src/software/aws/toolkits/jetbrains/services/ecs/exec/EnableDisableExecuteCommandWarning.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import com.intellij.openapi.project.Project
77
import com.intellij.openapi.ui.DialogWrapper
88
import com.intellij.openapi.ui.Messages
99
import com.intellij.ui.components.JBLabel
10-
import com.intellij.ui.layout.panel
10+
import com.intellij.ui.dsl.builder.bindSelected
11+
import com.intellij.ui.dsl.builder.panel
1112
import software.aws.toolkits.jetbrains.core.help.HelpIds
1213
import software.aws.toolkits.jetbrains.settings.EcsExecCommandSettings
1314
import software.aws.toolkits.resources.message
@@ -23,22 +24,21 @@ class EnableDisableExecuteCommandWarning(private val project: Project, private v
2324
private val component by lazy {
2425
panel {
2526
row {
26-
warningIcon(grow)
27-
label(message("ecs.execute_command_enable_warning")).constraints(grow).visible(enable)
28-
label(message("ecs.execute_command_disable_warning")).constraints(grow).visible(!enable)
27+
cell(warningIcon)
28+
label(message("ecs.execute_command_enable_warning")).visible(enable)
29+
label(message("ecs.execute_command_disable_warning")).visible(!enable)
2930
}
3031

3132
row {
3233
checkBox(
33-
message("ecs.execute_command.production_warning.checkbox_label", serviceName),
34-
{ confirmNonProduction },
35-
{ confirmNonProduction = it }
36-
).withErrorOnApplyIf(message("general.confirm_proceed")) { !it.isSelected }
37-
.constraints(grow)
34+
message("ecs.execute_command.production_warning.checkbox_label", serviceName)
35+
)
36+
.bindSelected({ confirmNonProduction }, { confirmNonProduction = it })
37+
.errorOnApply(message("general.confirm_proceed")) { !it.isSelected }
3838
}
3939

4040
row {
41-
checkBox(message("general.notification.action.hide_forever"), { dontDisplayWarning }, { dontDisplayWarning = it })
41+
checkBox(message("general.notification.action.hide_forever")).bindSelected({ dontDisplayWarning }, { dontDisplayWarning = it })
4242
}
4343
}
4444
}

jetbrains-core/src/software/aws/toolkits/jetbrains/services/ecs/exec/TaskRoleNotFoundWarningDialog.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.intellij.openapi.project.Project
77
import com.intellij.openapi.ui.DialogWrapper
88
import com.intellij.openapi.ui.Messages
99
import com.intellij.ui.components.JBLabel
10-
import com.intellij.ui.layout.panel
10+
import com.intellij.ui.dsl.builder.panel
1111
import software.aws.toolkits.resources.message
1212
import javax.swing.Action
1313
import javax.swing.JComponent
@@ -18,8 +18,8 @@ class TaskRoleNotFoundWarningDialog(project: Project) : DialogWrapper(project) {
1818
private val component by lazy {
1919
panel {
2020
row {
21-
warningIcon(grow)
22-
warningMessage(grow).also { it.component.setCopyable(true) }
21+
cell(warningIcon)
22+
cell(warningMessage).also { it.component.setCopyable(true) }
2323
}
2424
}
2525
}

resources/resources/software/aws/toolkits/resources/MessagesBundle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,14 +698,14 @@ ecs.execute_command_disable_failed=Execute Command could not be disabled for {0}
698698
ecs.execute_command_disable_in_progress=Cannot execute action since Execute Command is being disabled for {0}
699699
ecs.execute_command_disable_progress_indicator_message=Disabling Command Execution for {0}
700700
ecs.execute_command_disable_success=Execute Command for {0} has been disabled.
701-
ecs.execute_command_disable_warning=Disabling command execution will change the state of resources in your AWS account, including but not limited to stopping and restarting the service.\n Do you wish to continue?
701+
ecs.execute_command_disable_warning=<html>Disabling command execution will change the state of resources in your AWS account, including but not limited to stopping and restarting the service.<br> Do you wish to continue?</html>
702702
ecs.execute_command_disable_warning_title=Disable Execute Command Warning
703703
ecs.execute_command_enable=Enable Command Execution
704704
ecs.execute_command_enable_failed=Execute Command could not be enabled for {0}
705705
ecs.execute_command_enable_in_progress=Cannot execute action since Execute Command is being enabled for {0}
706706
ecs.execute_command_enable_progress_indicator_message=Enabling Command Execution for {0}
707707
ecs.execute_command_enable_success=Execute Command for {0} has been enabled.
708-
ecs.execute_command_enable_warning=Enabling command execution will change the state of resources in your AWS account, including but not limited to stopping and restarting the service.\nAltering the state of resources while the Execute Command is enabled can lead to unpredictable results.\n Do you wish to continue?
708+
ecs.execute_command_enable_warning=<html>Enabling command execution will change the state of resources in your AWS account, including but not limited to stopping and restarting the service.<br>Altering the state of resources while the Execute Command is enabled can lead to unpredictable results.<br> Do you wish to continue?</html>
709709
ecs.execute_command_enable_warning_title=Enable Execute Command Warning
710710
ecs.execute_command_failed=ECS Execute Command Failed
711711
ecs.execute_command_no_command=Command to execute must be entered

0 commit comments

Comments
 (0)