@@ -38,6 +38,7 @@ public abstract class AbstractTextMonitor extends AbstractMonitor {
38
38
protected JTextField textField ;
39
39
protected JButton sendButton ;
40
40
protected JButton clearButton ;
41
+ protected JButton copyButton ;
41
42
protected JCheckBox autoscrollBox ;
42
43
protected JCheckBox addTimeStampBox ;
43
44
protected JComboBox lineEndings ;
@@ -82,6 +83,7 @@ public void windowGainedFocus(WindowEvent e) {
82
83
83
84
sendButton = new JButton (tr ("Send" ));
84
85
clearButton = new JButton (tr ("Clear output" ));
86
+ copyButton = new JButton (tr ("Copy output" ));
85
87
86
88
upperPane .add (textField );
87
89
upperPane .add (Box .createRigidArea (new Dimension (4 , 0 )));
@@ -140,6 +142,8 @@ public void actionPerformed(ActionEvent e) {
140
142
pane .add (Box .createRigidArea (new Dimension (8 , 0 )));
141
143
pane .add (serialRates );
142
144
pane .add (Box .createRigidArea (new Dimension (8 , 0 )));
145
+ pane .add (copyButton );
146
+ pane .add (Box .createRigidArea (new Dimension (8 , 0 )));
143
147
pane .add (clearButton );
144
148
145
149
mainPane .add (pane , BorderLayout .SOUTH );
@@ -149,6 +153,7 @@ protected void onEnableWindow(boolean enable)
149
153
{
150
154
textArea .setEnabled (enable );
151
155
clearButton .setEnabled (enable );
156
+ copyButton .setEnabled (enable );
152
157
scrollPane .setEnabled (enable );
153
158
textField .setEnabled (enable );
154
159
sendButton .setEnabled (enable );
@@ -167,6 +172,10 @@ public void onClearCommand(ActionListener listener) {
167
172
clearButton .addActionListener (listener );
168
173
}
169
174
175
+ public void onCopyCommand (ActionListener listener ) {
176
+ copyButton .addActionListener (listener );
177
+ }
178
+
170
179
public void onSerialRateChange (ActionListener listener ) {
171
180
serialRates .addActionListener (listener );
172
181
}
0 commit comments