@@ -86,11 +86,18 @@ object ShowMessage {
86
86
* @param t exception.
87
87
* @param parentWindow owner window that will be blacked by the dialog.
88
88
*/
89
- def exception (title : String , message : String , t : Throwable , parentWindow : Option [Window ] = None ): Unit = {
89
+ def exception (
90
+ title : String ,
91
+ message : String ,
92
+ t : Throwable ,
93
+ parentWindow : Option [Window ] = None ,
94
+ resizable : Boolean = false
95
+ ): Unit = {
90
96
t.printStackTrace()
91
97
92
98
// Rename to avoid name clashes
93
- val dialogTitle = title
99
+ val _title = title
100
+ val _resizable = resizable
94
101
95
102
// Create expandable Exception.
96
103
val exceptionText = {
@@ -118,11 +125,12 @@ object ShowMessage {
118
125
onFXAndWait {
119
126
new Alert (AlertType .Error ) {
120
127
initOwner(parentWindow.orNull)
121
- this .title = dialogTitle
128
+ this .title = _title
122
129
headerText = message
123
130
contentText = Option (t.getMessage).getOrElse(" " )
124
131
// Set expandable Exception into the dialog pane.
125
132
dialogPane().expandableContent = expContent
133
+ this .resizable = _resizable
126
134
}.showAndWait()
127
135
}
128
136
}
@@ -237,7 +245,7 @@ trait ShowMessage {
237
245
* @param message Message (excluding t.getMessage(), it is automatically displayed)
238
246
* @param t exception to be displayed in the dialog
239
247
*/
240
- def showException (title : String , message : String , t : Throwable ): Unit = {
248
+ def showException (title : String , message : String , t : Throwable , resizable : Boolean = false ): Unit = {
241
249
messageLogger.foreach(_.error(s " < $title> $message" , t))
242
250
ShowMessage .exception(title, message, t, parentWindow)
243
251
}
0 commit comments