01: package tide.editor.debugger;
02:
03: import snow.html.HTMLUtils;
04: import java.awt.Color;
05: import snow.utils.storage.StorageVector;
06: import tide.editor.linemessages.LineMessage;
07:
08: /** To use with jdb...
09: */
10: public final class BreakpointLineMessage extends LineMessage {
11: protected String mess;
12:
13: public BreakpointLineMessage(String javaName, int line,
14: String mess, long created) {
15: super (javaName, line, created);
16: this .mess = mess;
17: }
18:
19: @Override
20: public String getMessageOriginator() {
21: return "Breakpoint";
22: }
23:
24: @Override
25: public StorageVector getStorageRepresentation() {
26: StorageVector sv = new StorageVector();
27: sv.add(1);
28: sv.add("BreakpointLineMessage");
29: sv.add(javaName); // 2
30: sv.add(mess); // 3
31: sv.add(line); // 4
32: sv.add(created); // 5
33: return sv;
34: }
35:
36: public static BreakpointLineMessage createFromStorageVector(
37: StorageVector sv) {
38: return new BreakpointLineMessage((String) sv.get(2),
39: (Integer) sv.get(4), (String) sv.get(3), (Long) sv
40: .get(5));
41: }
42:
43: @Override
44: public String getMessage() {
45: return mess;
46: }
47:
48: @Override
49: public String getMessageForTableColumn() {
50: return mess;
51: }
52:
53: public final String toStringJavaForJDB() {
54: StringBuilder sb = new StringBuilder();
55: sb.append(javaName + ":" + line);
56: return sb.toString();
57: }
58:
59: @Override
60: public String toStringHTML() {
61: return HTMLUtils.createCODEHTMLFromText(mess);
62: }
63:
64: @Override
65: public int getShiftX() {
66: return 2;
67: }
68:
69: @Override
70: public String getLetter() {
71: return "B";
72: }
73:
74: @Override
75: public Color getColor() {
76: return Color.red;
77: }
78:
79: }
|