scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java | 16 ++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
New commits: commit 3c72945de874aceb12a405c03f5b0c8b3937f5cf Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Wed Mar 27 09:54:17 2019 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Wed Mar 27 12:37:17 2019 +0100 Beanshell: Wrap long error messages Change-Id: I5e607f4b94733700810d37c289f6cc29492da5f2 Reviewed-on: https://gerrit.libreoffice.org/69798 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java index 5cb701e5bb79..91bd98894798 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java @@ -42,6 +42,7 @@ import java.util.Map; import javax.swing.JButton; import javax.swing.JComponent; +import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -265,9 +266,20 @@ public class ScriptEditorForBeanShell implements ScriptEditor, ActionListener { frame.setVisible(true); } + // Wraps long error messages + class NarrowOptionPane extends JOptionPane { + private static final long serialVersionUID = 1L; + public int getMaxCharactersPerLineCount() { + return 100; + } + } + private void showErrorMessage(String message) { - JOptionPane.showMessageDialog(frame, message, - "Error", JOptionPane.ERROR_MESSAGE); + JOptionPane optionPane = new NarrowOptionPane(); + optionPane.setMessage(message); + optionPane.setMessageType(JOptionPane.ERROR_MESSAGE); + JDialog dialog = optionPane.createDialog(null, "Error"); + dialog.setVisible(true); } private void initUI() { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits