1 19 20 package org.netbeans.modules.websvc.api; 21 22 import java.util.HashMap ; 23 import java.util.Map ; 24 import org.netbeans.modules.websvc.api.webservices.WebServicesView; 25 import org.netbeans.modules.websvc.spi.webservices.WebServicesViewFactory; 26 import org.netbeans.modules.websvc.spi.webservices.WebServicesViewImpl; 27 import org.netbeans.modules.websvc.spi.webservices.WebServicesViewProvider; 28 import org.openide.filesystems.FileObject; 29 import org.openide.nodes.Node; 30 31 35 public class CustomWebServicesViewProvider implements WebServicesViewProvider { 36 37 private Map <FileObject, WebServicesView> cache = new HashMap <FileObject, WebServicesView>(); 38 39 40 public CustomWebServicesViewProvider() { 41 } 42 43 public WebServicesView findWebServicesView(FileObject file) { 44 if (file.getExt().equals("ws")) { 45 WebServicesView em = cache.get(file.getParent()); 46 if (em == null) { 47 em = WebServicesViewFactory.createWebServicesView(new CustomWebServicesViewImpl(file)); 48 cache.put(file.getParent(), em); 49 } 50 return em; 51 } 52 return null; 53 } 54 55 private static final class CustomWebServicesViewImpl implements WebServicesViewImpl { 56 57 private FileObject fo; 58 59 CustomWebServicesViewImpl(FileObject fo) { 60 this.fo = fo; 61 } 62 63 public Node createWebServicesView(FileObject srcRoot) { 64 throw new UnsupportedOperationException ("Not supported yet."); 65 } 66 } 67 } 68 | Popular Tags |