aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/CommonDialog.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/CommonDialog.kt')
-rw-r--r--src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/CommonDialog.kt34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/CommonDialog.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/CommonDialog.kt
new file mode 100644
index 0000000..6a8f14d
--- /dev/null
+++ b/src/main/kotlin/xyz/brysonsteck/ServerCraft/dialogs/CommonDialog.kt
@@ -0,0 +1,34 @@
+package xyz.brysonsteck.ServerCraft.dialogs
+
+import javafx.scene.control.Button
+import javafx.event.EventHandler
+import javafx.event.ActionEvent
+
+class CommonDialog: Dialog {
+ override var type: String
+ override var title: String
+ override var msg: String
+ override val neutralButton: Button?
+ override val yesButton: Button?
+ override val noButton: Button?
+
+ constructor(type: String, title: String, msg: String) {
+ this.type = type
+ this.title = title
+ this.msg = msg
+
+ 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