From 753edd83c364bb384fa3ffedd8dd468535724043 Mon Sep 17 00:00:00 2001 From: juewe Date: Tue, 25 Jun 2024 07:16:59 +0200 Subject: [PATCH] Add a clear button for log content --- .../luke/app/desktop/components/LogsPanelProvider.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java index 2124ffd7d6c..8ac40085e87 100644 --- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java +++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java @@ -86,6 +86,16 @@ public final class LogsPanelProvider { clipboard.setContents(selection, null); }); header.add(copyBtn); + + JButton clearBtn = + new JButton( + MessageUtils.getLocalizedMessage("button.clear")); + clearBtn.setMargin(new Insets(3, 3, 3, 3)); + clearBtn.addActionListener( + e -> { + logTextArea.setText(null); + }); + header.add(clearBtn); panel.add(header, BorderLayout.PAGE_START); panel.add(new JScrollPane(logTextArea), BorderLayout.CENTER);