1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.log4j.chainsaw;
19
20 import java.awt.Cursor;
21 import java.awt.Point;
22 import java.awt.Toolkit;
23 import java.util.ArrayList;
24 import java.util.List;
25
26 import javax.swing.ImageIcon;
27
28 import org.apache.log4j.chainsaw.icons.ChainsawIcons;
29
30
31
32
33
34
35 public class ChainsawColumns {
36 private static final List columnNames = new ArrayList();
37
38 static {
39 columnNames.add(ChainsawConstants.LOGGER_COL_NAME);
40 columnNames.add(ChainsawConstants.LOG4J_MARKER_COL_NAME_LOWERCASE.toUpperCase());
41 columnNames.add(ChainsawConstants.TIMESTAMP_COL_NAME);
42 columnNames.add(ChainsawConstants.LEVEL_COL_NAME);
43 columnNames.add(ChainsawConstants.THREAD_COL_NAME);
44 columnNames.add(ChainsawConstants.MESSAGE_COL_NAME);
45 columnNames.add(ChainsawConstants.NDC_COL_NAME);
46 columnNames.add(ChainsawConstants.THROWABLE_COL_NAME);
47 columnNames.add(ChainsawConstants.CLASS_COL_NAME);
48 columnNames.add(ChainsawConstants.METHOD_COL_NAME);
49 columnNames.add(ChainsawConstants.FILE_COL_NAME);
50 columnNames.add(ChainsawConstants.MILLIS_DELTA_COL_NAME_LOWERCASE.toUpperCase());
51 columnNames.add(ChainsawConstants.LINE_COL_NAME);
52
53
54 columnNames.add(ChainsawConstants.ID_COL_NAME);
55 }
56
57 public static final int INDEX_LOGGER_COL_NAME = 1;
58 public static final int INDEX_LOG4J_MARKER_COL_NAME = 2;
59 public static final int INDEX_TIMESTAMP_COL_NAME = 3;
60 public static final int INDEX_LEVEL_COL_NAME = 4;
61 public static final int INDEX_THREAD_COL_NAME = 5;
62 public static final int INDEX_MESSAGE_COL_NAME = 6;
63 public static final int INDEX_NDC_COL_NAME = 7;
64 public static final int INDEX_THROWABLE_COL_NAME = 8;
65 public static final int INDEX_CLASS_COL_NAME = 9;
66 public static final int INDEX_METHOD_COL_NAME = 10;
67 public static final int INDEX_FILE_COL_NAME = 11;
68 public static final int INDEX_LINE_COL_NAME = 12;
69 public static final int INDEX_MILLIS_DELTA_COL_NAME = 13;
70 public static final int INDEX_ID_COL_NAME = 14;
71
72 public static final Cursor CURSOR_FOCUS_ON;
73 static{
74 CURSOR_FOCUS_ON = Toolkit.getDefaultToolkit().createCustomCursor(new ImageIcon(ChainsawIcons.WINDOW_ICON).getImage(), new Point(3,3), "FocusOn");
75 }
76
77 private ChainsawColumns() {
78 }
79
80 public static List getColumnsNames() {
81 return columnNames;
82 }
83
84
85
86
87
88
89
90 public static String getColumnName(int columnIndex) {
91 return getColumnsNames().get(columnIndex - 1).toString();
92 }
93 }