1 26 package org.objectweb.util.explorer.property.lib; 27 28 import java.util.HashMap ; 29 import java.util.Map ; 30 31 import org.objectweb.util.explorer.api.IconProvider; 32 import org.objectweb.util.explorer.core.common.api.Description; 33 import org.objectweb.util.explorer.core.icon.api.IconCodeDescription; 34 import org.objectweb.util.explorer.core.icon.api.IconDescription; 35 36 44 public class IconProperty 45 extends AbstractProperty 46 { 47 48 54 55 protected Map properties_ = null; 56 57 63 66 public IconProperty(){ 67 properties_ = new HashMap (); 68 } 69 70 76 82 85 public void feed(String propertyType, Object key, Description value) { 86 IconDescription iconDesc = (IconDescription)value; 87 if(iconDesc!=null && !iconDesc.isEmpty()){ 88 if(iconDesc instanceof IconCodeDescription){ 89 IconCodeDescription iconCodeDesc = (IconCodeDescription)iconDesc; 90 if(getCodeProvider().getCode(iconCodeDesc.getCode()).isInstanceOf(IconProvider.class)){ 91 properties_.put(key,value); 92 } else { 93 getTrace().warn(iconCodeDesc.getCode() + " is not assignable from IconProvider!"); 94 } 95 } else { 96 properties_.put(key,value); 97 } 98 } 99 } 100 101 107 110 public Description getPropertyDescription(String propertyType, Object key) { 111 return (Description)properties_.get(key); 112 } 113 114 } 115 116 117 | Popular Tags |