1 package org.catacomb.druid.gui.edit;
2
3
4 import org.catacomb.interlish.structure.InfoLog;
5 import org.catacomb.interlish.structure.LogMessageGenerator;
6 import org.catacomb.report.E;
7
8
9
10
11
12 public class DruLoggedButton extends DruButton implements LogMessageGenerator {
13 static final long serialVersionUID = 1001;
14
15 InfoLog infoLog;
16
17
18 public DruLoggedButton(String s) {
19 super(s);
20 }
21
22
23 public void setLog(InfoLog ilog) {
24 infoLog = ilog;
25 E.info("set log in logButton");
26 }
27
28
29 public void labelAction(String s, boolean b) {
30
31 int ival = (int)(0.5 + 4 * Math.random());
32
33 if (infoLog != null) {
34 infoLog.addInfoMessage(ival, "button press", "button " + getLabel() + " has been pressed");
35 }
36
37 super.labelAction(s, b);
38 }
39
40
41
42 }