1 4 package com.tc.admin; 5 6 import java.net.URL ; 7 8 import javax.swing.Icon ; 9 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(ICONS_PATH+"alert12x12.gif"); 26 27 if(url != null) { 28 m_alertIcon = new ImageIcon (url); 29 } 30 } 31 32 return m_alertIcon; 33 } 34 35 public Icon getWarningIcon() { 36 if(m_warningIcon == null) { 37 URL url = getClass().getResource(ICONS_PATH+"warning12x12.gif"); 38 39 if(url != null) { 40 m_warningIcon = new ImageIcon (url); 41 } 42 } 43 44 return m_warningIcon; 45 } 46 47 public Icon getErrorIcon() { 48 if(m_errorIcon == null) { 49 URL url = getClass().getResource(ICONS_PATH+"error12x12.gif"); 50 51 if(url != null) { 52 m_errorIcon = new ImageIcon (url); 53 } 54 } 55 56 return m_errorIcon; 57 } 58 59 public Icon getInfoIcon() { 60 if(m_infoIcon == null) { 61 URL url = getClass().getResource(ICONS_PATH+"info12x12.gif"); 62 63 if(url != null) { 64 m_infoIcon = new ImageIcon (url); 65 } 66 } 67 68 return m_infoIcon; 69 } 70 71 public Icon getBlankIcon() { 72 if(m_blankIcon == null) { 73 URL url = getClass().getResource(ICONS_PATH+"blank12x12.gif"); 74 75 if(url != null) { 76 m_blankIcon = new ImageIcon (url); 77 } 78 } 79 80 return m_blankIcon; 81 } 82 } 83 | Popular Tags |