1 19 20 package org.netbeans.modules.websvc.design.view.widget; 21 22 import java.net.MalformedURLException ; 23 import java.net.URL ; 24 import org.netbeans.api.visual.widget.LayerWidget; 25 import org.netbeans.api.visual.widget.Scene; 26 import org.netbeans.modules.websvc.api.jaxws.project.config.Service; 27 import org.netbeans.modules.websvc.api.jaxws.wsdlmodel.*; 28 29 33 public class OperationsWidget extends LayerWidget { 34 35 private transient WsdlService wsdlService; 36 41 public OperationsWidget(Scene scene, Service service) { 42 super(scene); 43 initialize(service); 44 createContent(); 45 } 46 47 51 private void initialize(Service service) { 52 try { 53 String wsdlUrlStr = service.getWsdlUrl(); 54 if(wsdlUrlStr==null) return; 55 URL wsdlUrl = new URL (wsdlUrlStr); 56 if(wsdlUrl==null) return; 57 WsdlModeler modeler = WsdlModelerFactory.getDefault().getWsdlModeler(wsdlUrl); 58 if(modeler==null) return; 59 WsdlModel model = modeler.getAndWaitForWsdlModel(); 60 if(model==null) return; 61 wsdlService = model.getServiceByName(service.getServiceName()); 62 } catch(MalformedURLException e) { 63 } 64 } 65 66 private void createContent() { 67 if (wsdlService==null) return; 68 for(WsdlPort port:wsdlService.getPorts()) { 69 for(WsdlOperation operation:port.getOperations()) { 70 addChild(new OperationContentWidget(getScene(),operation)); 71 } 72 } 73 } 74 } 75 | Popular Tags |