01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.admin;
05:
06: import java.net.URL;
07:
08: import javax.swing.Icon;
09: import javax.swing.ImageIcon;
10:
11: public class LogHelper extends BaseHelper {
12: private static LogHelper m_helper = new LogHelper();
13: private Icon m_alertIcon;
14: private Icon m_warningIcon;
15: private Icon m_errorIcon;
16: private Icon m_infoIcon;
17: private Icon m_blankIcon;
18:
19: public static LogHelper getHelper() {
20: return m_helper;
21: }
22:
23: public Icon getAlertIcon() {
24: if (m_alertIcon == null) {
25: URL url = getClass().getResource(
26: ICONS_PATH + "alert12x12.gif");
27:
28: if (url != null) {
29: m_alertIcon = new ImageIcon(url);
30: }
31: }
32:
33: return m_alertIcon;
34: }
35:
36: public Icon getWarningIcon() {
37: if (m_warningIcon == null) {
38: URL url = getClass().getResource(
39: ICONS_PATH + "warning12x12.gif");
40:
41: if (url != null) {
42: m_warningIcon = new ImageIcon(url);
43: }
44: }
45:
46: return m_warningIcon;
47: }
48:
49: public Icon getErrorIcon() {
50: if (m_errorIcon == null) {
51: URL url = getClass().getResource(
52: ICONS_PATH + "error12x12.gif");
53:
54: if (url != null) {
55: m_errorIcon = new ImageIcon(url);
56: }
57: }
58:
59: return m_errorIcon;
60: }
61:
62: public Icon getInfoIcon() {
63: if (m_infoIcon == null) {
64: URL url = getClass().getResource(
65: ICONS_PATH + "info12x12.gif");
66:
67: if (url != null) {
68: m_infoIcon = new ImageIcon(url);
69: }
70: }
71:
72: return m_infoIcon;
73: }
74:
75: public Icon getBlankIcon() {
76: if (m_blankIcon == null) {
77: URL url = getClass().getResource(
78: ICONS_PATH + "blank12x12.gif");
79:
80: if (url != null) {
81: m_blankIcon = new ImageIcon(url);
82: }
83: }
84:
85: return m_blankIcon;
86: }
87: }
|