Merge lp:~tapaal-contributor/tapaal/copy-from-messages into lp:tapaal

Proposed by Lena Ernstsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1139
Merged at revision: 1138
Proposed branch: lp:~tapaal-contributor/tapaal/copy-from-messages
Merge into: lp:tapaal
Diff against target: 56 lines (+15/-6)
1 file modified
src/pipe/gui/MessengerImpl.java (+15/-6)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/copy-from-messages
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+407724@code.launchpad.net

Commit message

Possible to copy from specific messages, including error verification messages

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote :

Tested and works.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/pipe/gui/MessengerImpl.java'
2--- src/pipe/gui/MessengerImpl.java 2011-08-29 23:00:27 +0000
3+++ src/pipe/gui/MessengerImpl.java 2021-08-26 09:43:37 +0000
4@@ -1,8 +1,6 @@
5 package pipe.gui;
6
7-import java.awt.Color;
8-import java.awt.Dimension;
9-import java.awt.Insets;
10+import java.awt.*;
11
12 import javax.swing.JOptionPane;
13 import javax.swing.JScrollPane;
14@@ -17,7 +15,7 @@
15 }
16
17 public void displayInfoMessage(String message, String title) {
18- showMessageBox(message, title, JOptionPane.INFORMATION_MESSAGE);
19+ showMessageBox(getTextArea(message), title, JOptionPane.INFORMATION_MESSAGE);
20 }
21
22 public void displayErrorMessage(String message) {
23@@ -25,7 +23,7 @@
24 }
25
26 public void displayErrorMessage(String message, String title) {
27- showMessageBox(message, title, JOptionPane.ERROR_MESSAGE);
28+ showMessageBox(getTextArea(message), title, JOptionPane.ERROR_MESSAGE);
29 }
30
31 private void showMessageBox(Object message, String title, int messageType) {
32@@ -36,7 +34,7 @@
33 public void displayWrappedErrorMessage(String message, String title) {
34 JTextArea textArea = new JTextArea(message);
35 textArea.setEditable(false);
36- textArea.setEnabled(false);
37+ textArea.setEnabled(true);
38 textArea.setDisabledTextColor(Color.BLACK);
39 textArea.setLineWrap(true);
40 textArea.setWrapStyleWord(true);
41@@ -47,4 +45,15 @@
42
43 showMessageBox(scrollPane, title, JOptionPane.ERROR_MESSAGE);
44 }
45+
46+ private JTextArea getTextArea(String message) {
47+ JTextArea textArea = new JTextArea(message);
48+ textArea.setEditable(false);
49+ textArea.setEnabled(true);
50+ textArea.setLineWrap(false);
51+ textArea.setDisabledTextColor(Color.BLACK);
52+ textArea.setBackground(Color.getColor("FFe0d0"));
53+
54+ return textArea;
55+ }
56 }

Subscribers

People subscribed via source and target branches