1 19 20 package org.netbeans.modules.xml.xam.ui.customizer; 21 22 import java.util.HashMap ; 23 import java.util.Map ; 24 import org.netbeans.modules.xml.xam.Model; 25 26 32 public abstract class AbstractReferenceDecorator implements 33 ExternalReferenceDecorator { 34 35 private Map <Model, String > prefixMap; 36 37 40 public AbstractReferenceDecorator() { 41 prefixMap = new HashMap <Model, String >(); 42 } 43 44 52 protected abstract String generatePrefix(Model model); 53 54 public String generatePrefix(ExternalReferenceNode node) { 55 if (node.hasModel()) { 58 Model model = node.getModel(); 61 String prefix = prefixMap.get(model); 62 if (prefix == null) { 63 prefix = generatePrefix(model); 64 prefixMap.put(model, prefix); 65 } 66 return prefix; 67 } 68 return ""; 69 } 70 } 71 | Popular Tags |