KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > freeform > WebProjectNature


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.web.freeform;
21 import java.util.ArrayList JavaDoc;
22 import java.util.Arrays JavaDoc;
23 import java.util.Collections JavaDoc;
24 import java.util.List JavaDoc;
25 import java.util.Set JavaDoc;
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 /**
38  * @author David Konecny
39  */

40 public class WebProjectNature implements ProjectNature {
41
42     public static final String JavaDoc NS_WEB = "http://www.netbeans.org/ns/freeform-project-web/1"; // NOI18N
43
private static final String JavaDoc SCHEMA = "nbres:/org/netbeans/modules/web/freeform/resources/freeform-project-web.xsd"; // NOI18N
44

45   
46     public WebProjectNature() {}
47     
48     public List JavaDoc getExtraTargets(Project project, AntProjectHelper projectHelper, PropertyEvaluator projectEvaluator, AuxiliaryConfiguration aux) {
49         ArrayList JavaDoc l = new ArrayList JavaDoc();
50         if (!LookupProviderImpl.isMyProject(aux)) {
51             return l;
52         }
53         l.add(getExtraTarget());
54         return l;
55     }
56     
57     public Set JavaDoc/*<String>*/ getSchemas() {
58         return Collections.singleton(SCHEMA);
59     }
60
61     public Set JavaDoc/*<String>*/ getSourceFolderViewStyles() {
62         return Collections.EMPTY_SET;
63     }
64     
65     public Node createSourceFolderView(Project project, FileObject folder, String JavaDoc includes, String JavaDoc excludes, String JavaDoc style, String JavaDoc name, String JavaDoc displayName) throws IllegalArgumentException JavaDoc {
66         throw new IllegalArgumentException JavaDoc();
67     }
68
69     public Node findSourceFolderViewPath(Project project, Node root, Object JavaDoc target) {
70         return null;
71     }
72
73  
74     
75     public static TargetDescriptor getExtraTarget() {
76         return new TargetDescriptor(WebProjectConstants.COMMAND_REDEPLOY, Arrays.asList(new String JavaDoc[]{"deploy", ".*deploy.*"}), // NOI18N
77
NbBundle.getMessage(WebProjectNature.class, "LBL_TargetMappingPanel_Deploy"), // NOI18N
78
NbBundle.getMessage(WebProjectNature.class, "ACSD_TargetMappingPanel_Deploy")); // NOI18N
79
}
80     
81  
82 }
83
Popular Tags