KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > project > ProjectInformation


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.api.project;
21
22 import java.beans.PropertyChangeListener JavaDoc;
23 import javax.swing.Icon JavaDoc;
24 import org.netbeans.api.project.Project;
25
26 /**
27  * General information about a project.
28  * <strong>Use {@link ProjectUtils#getInformation} as a client.</strong>
29  * Use {@link Project#getLookup} as a provider.
30  * @author Jesse Glick
31  */

32 public interface ProjectInformation {
33
34     /** Property name fired when the code name changes. */
35     String JavaDoc PROP_NAME = "name"; // NOI18N
36

37     /** Property name fired when the display name changes. */
38     String JavaDoc PROP_DISPLAY_NAME = "displayName"; // NOI18N
39

40     /** Property name fired when the icon changes. */
41     String JavaDoc PROP_ICON = "icon"; // NOI18N
42

43     /**
44      * Get a programmatic code name suitable for use in build scripts or other
45      * references.
46      * <p>
47      * Project names should typically be distinctive enough to distinguish
48      * between different projects with some kind of relationships, <em>but</em>
49      * any usage of this name must take into account that they are not forced
50      * to be unique.
51      * <p>
52      * Should not contain odd characters; should be usable as a directory name
53      * on disk, as (part of) an Ant property name, etc.
54      * XXX precise format - at least conforms to XML NMTOKEN or ID
55      * @return a code name
56      * @see <a HREF="@org-netbeans-modules-project-ant@/org/netbeans/spi/project/support/ant/PropertyUtils.html#getUsablePropertyName(java.lang.String)"><code>PropertyUtils.getUsablePropertyName</code></a>
57      */

58     String JavaDoc getName();
59     
60     /**
61      * Get a human-readable display name for the project.
62      * May contain spaces, international characters, etc.
63      * XXX precise format - probably XML PCDATA
64      * @return a display name for the project
65      */

66     String JavaDoc getDisplayName();
67     
68     /**
69      * Gets icon for given project.
70      * Usually determined by the project type.
71      * @return icon of the project.
72      */

73     Icon JavaDoc getIcon();
74     
75     /**
76      * Get the associated project.
77      * @return the project for which information is being provided
78      */

79     Project getProject();
80     
81     /**
82      * Add a listener to property changes.
83      * Only {@link #PROP_NAME}, {@link #PROP_DISPLAY_NAME}, and {@link #PROP_ICON} may be fired.
84      * Since the event source is the info object, you may use {@link #getProject}.
85      * @param listener a listener to add
86      */

87     void addPropertyChangeListener(PropertyChangeListener JavaDoc listener);
88     
89     /**
90      * Remove a listener to property changes.
91      * @param listener a listener to remove
92      */

93     void removePropertyChangeListener(PropertyChangeListener JavaDoc listener);
94     
95 }
96
Popular Tags