1 19 20 package org.netbeans.modules.xml.xam.ui.customizer; 21 22 import java.util.Map ; 23 import org.netbeans.modules.xml.xam.Component; 24 import org.netbeans.modules.xml.xam.Model; 25 import org.openide.explorer.ExplorerManager; 26 import org.openide.nodes.Node; 27 28 34 public abstract class AbstractReferenceCustomizer<T extends Component> 35 extends AbstractComponentCustomizer<T> { 36 37 private static final long serialVersionUID = 1L; 38 39 protected ExplorerManager explorerManager; 40 41 46 public AbstractReferenceCustomizer(T component) { 47 super(component); 48 } 49 50 56 public abstract ExternalReferenceDataNode createExternalReferenceNode( 57 Node original); 58 59 62 protected abstract Node createRootNode(); 63 64 70 protected abstract String getTargetNamespace(Model model); 71 72 77 public Model getComponentModel() { 78 return getModelComponent().getModel(); 79 } 80 81 87 public String getTargetNamespace() { 88 return getTargetNamespace(getModelComponent().getModel()); 89 } 90 91 97 protected abstract Map <String , String > getPrefixes(Model model); 98 99 104 protected abstract ExternalReferenceDecorator getNodeDecorator(); 105 106 111 protected abstract void initializeUI(); 112 113 121 public abstract boolean mustNamespaceDiffer(); 122 123 public void reset() { 124 initializeUI(); 125 Node root = createRootNode(); 128 explorerManager.setRootContext(root); 129 setSaveEnabled(false); 130 setResetEnabled(false); 131 showMessage(null); 132 } 133 134 139 protected abstract void showMessage(String msg); 140 } 141 | Popular Tags |