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