1 19 package org.netbeans.modules.xml.text.completion; 20 21 import java.util.HashMap ; 22 23 import javax.swing.ImageIcon ; 24 25 29 final class IconStore extends Object { 30 31 public static final String EMPTY_TAG = "/org/netbeans/modules/xml/text/completion/resources/emptyTag"; 32 public static final String END_TAG = "/org/netbeans/modules/xml/text/completion/resources/endTag"; 33 public static final String CHILDREN = "/org/netbeans/modules/xml/text/completion/resources/typeChildren"; 34 public static final String MIXED = "/org/netbeans/modules/xml/text/completion/resources/typeMixed"; 35 public static final String PCDATA = "/org/netbeans/modules/xml/text/completion/resources/typePCDATA"; 36 37 public static final String TYPE_ENTITY = "/org/netbeans/modules/xml/text/completion/resources/attTypeENTITY"; 38 public static final String TYPE_ENTITIES = "/org/netbeans/modules/xml/text/completion/resources/attTypeENTITIES"; 39 public static final String TYPE_ENUMERATION = "/org/netbeans/modules/xml/text/completion/resources/attTypeEn"; 40 public static final String TYPE_ID = "/org/netbeans/modules/xml/text/completion/resources/attTypeID"; 41 public static final String TYPE_IDREF = "/org/netbeans/modules/xml/text/completion/resources/attTypeIDREF"; 42 public static final String TYPE_IDREFS = "/org/netbeans/modules/xml/text/completion/resources/attTypeIDREFS"; 43 public static final String TYPE_NMTOKEN = "/org/netbeans/modules/xml/text/completion/resources/attTypeNMTOKEN"; 44 public static final String TYPE_NMTOKENS = "/org/netbeans/modules/xml/text/completion/resources/attTypeNMTOKENS"; 45 public static final String TYPE_NOTATION = "/org/netbeans/modules/xml/text/completion/resources/attTypeNOTATION"; 46 public static final String TYPE_CDATA = "/org/netbeans/modules/xml/text/completion/resources/typeCDATA"; 47 48 public static final String SPACER_16 = "/org/netbeans/modules/xml/text/completion/resources/spacer_16"; 49 public static final String SPACER_8 = "/org/netbeans/modules/xml/text/completion/resources/spacer_8"; 50 public static final String ICON_SUFFIX = ".gif"; 51 52 54 private static HashMap iconsMap = new HashMap (); 55 56 61 62 public static ImageIcon getImageIcon(String name){ 63 if(name == null) 64 name = SPACER_16; 65 66 if(iconsMap.containsKey(name)) 67 return (ImageIcon )iconsMap.get(name); 68 else{ 69 iconsMap.put(name, new ImageIcon (IconStore.class.getResource(name + ICON_SUFFIX))); 70 return (ImageIcon )iconsMap.get(name); 71 } 72 } 73 } 74 | Popular Tags |