1 19 20 package org.netbeans.modules.j2ee.ejbjarproject.ui.customizer; 21 22 import java.util.Collections ; 23 import java.util.List ; 24 25 import java.beans.PropertyChangeEvent ; 26 import java.beans.PropertyChangeListener ; 27 28 import javax.swing.JPanel ; 29 import javax.swing.JLabel ; 30 31 import org.w3c.dom.Document ; 32 import org.w3c.dom.Element ; 33 import org.w3c.dom.NodeList ; 34 35 import org.openide.WizardValidationException; 36 import org.openide.util.HelpCtx; 37 import org.openide.util.Lookup; 38 import org.openide.filesystems.FileObject; 39 40 import org.netbeans.spi.project.support.ant.AntProjectHelper; 41 import org.netbeans.modules.j2ee.ejbjarproject.EjbJarProvider; 42 import org.netbeans.modules.j2ee.ejbjarproject.EjbJarProjectType; 43 44 import org.netbeans.modules.websvc.spi.webservices.WebServicesConstants; 45 import org.netbeans.modules.websvc.api.webservices.WsCompileEditorSupport; 46 47 48 55 public class CustomizerWSServiceHost extends javax.swing.JPanel implements PropertyChangeListener , HelpCtx.Provider { 56 57 private EjbJarProjectProperties ejbJarProperties; 58 private WsCompileEditorSupport.Panel wsCompileEditor; 59 60 private List serviceSettings; 61 62 public CustomizerWSServiceHost(EjbJarProjectProperties ejbJarProperties, List serviceSettings) { 63 assert serviceSettings != null && serviceSettings.size() > 0; 64 initComponents(); 65 66 this.ejbJarProperties = ejbJarProperties; 67 this.wsCompileEditor = null; 68 this.serviceSettings = serviceSettings; 69 70 initValues(); 71 } 72 73 78 private void initComponents() { 80 setLayout(new java.awt.BorderLayout ()); 81 82 } 84 85 88 public void addNotify() { 89 super.addNotify(); 90 91 JPanel component = wsCompileEditor.getComponent(); 92 93 removeAll(); add(component); 95 96 component.addPropertyChangeListener(WsCompileEditorSupport.PROP_FEATURES_CHANGED, this); 97 } 98 99 public void removeNotify() { 100 super.removeNotify(); 101 102 JPanel component = wsCompileEditor.getComponent(); 103 component.removePropertyChangeListener(WsCompileEditorSupport.PROP_FEATURES_CHANGED, this); 104 } 105 106 public void initValues() { 107 if(wsCompileEditor == null) { 108 WsCompileEditorSupport editorSupport = (WsCompileEditorSupport) Lookup.getDefault().lookup(WsCompileEditorSupport.class); 109 wsCompileEditor = editorSupport.getWsCompileSupport(); 110 } 111 112 wsCompileEditor.initValues(serviceSettings); 113 } 114 115 120 121 public void propertyChange(PropertyChangeEvent evt) { 122 WsCompileEditorSupport.FeatureDescriptor newFeatureDesc = (WsCompileEditorSupport.FeatureDescriptor) evt.getNewValue(); 123 String propertyName = "wscompile.service." + newFeatureDesc.getServiceName() + ".features"; 124 ejbJarProperties.putAdditionalProperty(propertyName, newFeatureDesc.getFeatures()); 125 } 126 127 public HelpCtx getHelpCtx() { 128 return new HelpCtx(CustomizerWSServiceHost.class); 129 } 130 } 131 | Popular Tags |