1 19 20 package org.netbeans.modules.websvc.core.jaxws; 21 22 import java.util.ArrayList ; 23 import java.util.List ; 24 import org.netbeans.api.java.project.JavaProjectConstants; 25 import org.netbeans.api.project.Project; 26 import org.netbeans.api.project.SourceGroup; 27 import org.netbeans.api.project.Sources; 28 import org.netbeans.modules.websvc.core.jaxws.nodes.JaxWsRootNode; 29 import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel; 30 import org.netbeans.modules.websvc.jaxws.spi.JAXWSViewImpl; 31 import org.openide.filesystems.FileObject; 32 import org.openide.nodes.Node; 33 34 38 public class ProjectJAXWSView implements JAXWSViewImpl { 39 40 41 public ProjectJAXWSView() { 42 } 43 44 public Node createJAXWSView(Project project) { 45 if (project != null) { 46 JaxWsModel model = (JaxWsModel) project.getLookup().lookup(JaxWsModel.class); 47 48 if (model != null) { 49 Sources sources = (Sources)project.getLookup().lookup(Sources.class); 50 if (sources!=null) { 51 SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); 52 if (groups!=null) { 53 List <FileObject> roots = new ArrayList <FileObject>(); 54 for (SourceGroup group: groups) { 55 roots.add(group.getRootFolder()); 56 } 57 FileObject[] srcRoots = new FileObject[roots.size()]; 58 roots.toArray(srcRoots); 59 return new JaxWsRootNode(project, model,srcRoots); 60 } 61 } 62 } 63 } 64 return null; 65 } 66 67 } 68 | Popular Tags |