@@ -27,6 +27,7 @@ import wooga.gradle.github.publish.tasks.GithubPublish
2727import java.awt.GraphicsEnvironment.isHeadless
2828import java.util.concurrent.CompletableFuture
2929import javax.naming.ConfigurationException
30+ import javax.swing.JButton
3031import javax.swing.JFrame
3132import javax.swing.JOptionPane.DEFAULT_OPTION
3233import javax.swing.JOptionPane.OK_OPTION
@@ -263,18 +264,33 @@ val releaseBody by lazy(NONE) {
263264 val result = CompletableFuture <String >()
264265
265266 SwingUtilities .invokeLater {
266- val textArea = JTextArea (releaseBody)
267+ val initialReleaseBody = """
268+ # Highlights
269+ -
270+
271+ # Details
272+
273+ """ .trimIndent() + releaseBody
274+
275+ val textArea = JTextArea (initialReleaseBody)
267276
268277 val parentFrame = JFrame ().apply {
269278 isUndecorated = true
270279 setLocationRelativeTo(null )
271280 isVisible = true
272281 }
273282
283+ val resetButton = JButton (" Reset" ).apply {
284+ addActionListener {
285+ textArea.text = initialReleaseBody
286+ }
287+ }
288+
274289 result.complete(try {
275290 when (showOptionDialog(
276291 parentFrame, JScrollPane (textArea), " Release Body" ,
277- DEFAULT_OPTION , QUESTION_MESSAGE , null , null , null
292+ DEFAULT_OPTION , QUESTION_MESSAGE , null ,
293+ arrayOf(" OK" , resetButton), null
278294 )) {
279295 OK_OPTION -> textArea.text!!
280296 else -> releaseBody
0 commit comments