KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > form > project > ClassSource


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.form.project;
21
22 /**
23  * Describes a source (i.e. classpath) of a component class to be used in form
24  * editor.
25  *
26  * @author Tomas Pavek
27  */

28
29 public class ClassSource {
30
31     // classpath source types
32
public static final String JavaDoc JAR_SOURCE = "jar"; // NOI18N
33
public static final String JavaDoc LIBRARY_SOURCE = "library"; // NOI18N
34
public static final String JavaDoc PROJECT_SOURCE = "project"; // NOI18N
35

36     private String JavaDoc className;
37     private String JavaDoc[] cpTypes;
38     private String JavaDoc[] cpRoots;
39
40     /**
41      * @param className name of the class, can be null
42      * @param cpTypes types of classpath entries in cpRoots (see constants above)
43      * @param cpRoots names of classpath roots
44      */

45     public ClassSource(String JavaDoc className, String JavaDoc[] cpTypes, String JavaDoc[] cpRoots) {
46         this.className = className;
47         this.cpTypes = cpTypes;
48         this.cpRoots = cpRoots;
49     }
50
51     public String JavaDoc getClassName() {
52         return className;
53     }
54
55     public int getCPRootCount() {
56         return cpTypes != null ? cpTypes.length : 0;
57     }
58
59     public String JavaDoc getCPRootType(int index) {
60         return cpTypes[index];
61     }
62
63     public String JavaDoc getCPRootName(int index) {
64         return cpRoots[index];
65     }
66
67 }
68
Popular Tags