aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/KillDialog.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/KillDialog.kt')
-rw-r--r--src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/KillDialog.kt34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/KillDialog.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/KillDialog.kt
new file mode 100644
index 0000000..5ef0bbc
--- /dev/null
+++ b/src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/KillDialog.kt
@@ -0,0 +1,34 @@
+package xyz.brysonsteck.ServerCraft.dialogs
+
+import javafx.scene.control.Button
+import javafx.event.EventHandler
+import javafx.event.ActionEvent
+
+class KillDialog: Dialog {
+ override val type: String
+ override val title: String
+ override val msg: String
+ override val neutralButton: Button?
+ override val yesButton: Button?
+ override val noButton: Button?
+
+ constructor() {
+ type = "warning"
+ title = "Server is still running!"
+ msg = "You should only kill the server if absolutely necessary, i.e. not being responsive after long periods of time. Data loss may occur. Continue anyway?"
+ hold = false
+
+ noButton = Button("No")
+ noButton.onAction = EventHandler<ActionEvent>() {
+ result = false
+ dialog.hide()
+ }
+ yesButton = Button("Yes")
+ yesButton.onAction = EventHandler<ActionEvent>() {
+ result = true
+ dialog.hide()
+ }
+ yesButton.isDefaultButton = true
+ neutralButton = null
+ }
+} \ No newline at end of file