1 28 29 package org.objectweb.util.explorer.parser.lib; 30 31 import org.objectweb.fractal.api.NoSuchInterfaceException; 32 import org.objectweb.util.explorer.core.common.api.ExplorerConstants; 33 import org.objectweb.util.explorer.core.common.lib.BindingFeature; 34 import org.objectweb.util.explorer.explorerConfig.Icon; 35 import org.objectweb.util.explorer.explorerConfig.Node; 36 import org.objectweb.util.explorer.parser.api.NodeParser; 37 import org.objectweb.util.explorer.property.api.PropertyFeeder; 38 39 47 public class IconManager 48 extends BindingFeature 49 implements NodeParser 50 { 51 52 58 59 protected PropertyFeeder feeder_ = null; 60 61 67 73 protected PropertyFeeder getFeeder(){ 74 if(feeder_==null) { 75 try { 76 feeder_ = (PropertyFeeder)lookupFc(PropertyFeeder.PROPERTY_FEEDER); 77 } catch (NoSuchInterfaceException e) { 78 e.printStackTrace(); 79 } 80 } 81 return feeder_; 82 } 83 84 90 93 public String [] clientFc() { 94 return new String []{PropertyFeeder.PROPERTY_FEEDER}; 95 } 96 97 103 106 public void parseNode(Object key, Node node) { 107 Icon icon = node.getIcon(); 108 if(icon!=null){ 109 getFeeder().feed(ExplorerConstants.ICON_PROPERTY, key, ParserUtils.getIconDescription(icon)); 110 } 111 } 112 113 } 114 | Popular Tags |