1 19 20 package org.netbeans.modules.web.freeform; 21 import java.util.ArrayList ; 22 import java.util.Arrays ; 23 import java.util.Collections ; 24 import java.util.List ; 25 import java.util.Set ; 26 import org.netbeans.api.project.Project; 27 import org.netbeans.modules.ant.freeform.spi.ProjectNature; 28 import org.netbeans.modules.ant.freeform.spi.TargetDescriptor; 29 import org.netbeans.modules.web.api.webmodule.WebProjectConstants; 30 import org.netbeans.spi.project.AuxiliaryConfiguration; 31 import org.netbeans.spi.project.support.ant.AntProjectHelper; 32 import org.netbeans.spi.project.support.ant.PropertyEvaluator; 33 import org.openide.filesystems.FileObject; 34 import org.openide.nodes.Node; 35 import org.openide.util.NbBundle; 36 37 40 public class WebProjectNature implements ProjectNature { 41 42 public static final String NS_WEB = "http://www.netbeans.org/ns/freeform-project-web/1"; private static final String SCHEMA = "nbres:/org/netbeans/modules/web/freeform/resources/freeform-project-web.xsd"; 45 46 public WebProjectNature() {} 47 48 public List getExtraTargets(Project project, AntProjectHelper projectHelper, PropertyEvaluator projectEvaluator, AuxiliaryConfiguration aux) { 49 ArrayList l = new ArrayList (); 50 if (!LookupProviderImpl.isMyProject(aux)) { 51 return l; 52 } 53 l.add(getExtraTarget()); 54 return l; 55 } 56 57 public Set getSchemas() { 58 return Collections.singleton(SCHEMA); 59 } 60 61 public Set getSourceFolderViewStyles() { 62 return Collections.EMPTY_SET; 63 } 64 65 public Node createSourceFolderView(Project project, FileObject folder, String includes, String excludes, String style, String name, String displayName) throws IllegalArgumentException { 66 throw new IllegalArgumentException (); 67 } 68 69 public Node findSourceFolderViewPath(Project project, Node root, Object target) { 70 return null; 71 } 72 73 74 75 public static TargetDescriptor getExtraTarget() { 76 return new TargetDescriptor(WebProjectConstants.COMMAND_REDEPLOY, Arrays.asList(new String []{"deploy", ".*deploy.*"}), NbBundle.getMessage(WebProjectNature.class, "LBL_TargetMappingPanel_Deploy"), NbBundle.getMessage(WebProjectNature.class, "ACSD_TargetMappingPanel_Deploy")); } 80 81 82 } 83 | Popular Tags |