KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > xam > ui > category > CategoryPane


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-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.xam.ui.category;
21
22 import java.awt.Component JavaDoc;
23 import java.beans.PropertyChangeListener JavaDoc;
24 import javax.swing.JToolBar JavaDoc;
25 import org.openide.util.Lookup;
26
27 /**
28  * A CategoryPane manages a set of Category instances, displaying one
29  * category at any given time, and providing a means of selecting the
30  * category to be shown.
31  *
32  * @author Nathan Fiedler
33  */

34 public interface CategoryPane {
35     /** Property name for the selected Category. */
36     public static final String JavaDoc PROP_CATEGORY = "category";
37
38     /**
39      * Adds the Category to this pane. All of the available categories
40      * must be added before the populateToolbar() method is invoked.
41      *
42      * @param category Category to be added.
43      */

44     void addCategory(Category category);
45
46     /**
47      * Add a PropertyChangeListener to the listener list.
48      *
49      * @param listener property change listener to add.
50      */

51     void addPropertyChangeListener(PropertyChangeListener JavaDoc listener);
52
53     /**
54      * Add a PropertyChangeListener for a specific property.
55      *
56      * @param name name of property to listen to.
57      * @param listener property change listener to add.
58      */

59     void addPropertyChangeListener(String JavaDoc name, PropertyChangeListener JavaDoc listener);
60     
61     /**
62      * Returns the currently selected Category.
63      *
64      * @return currently seleced Category, or null if none.
65      */

66     Category getCategory();
67
68     /**
69      * Returns the user interface component for this category pane.
70      *
71      * @return the user interface component.
72      */

73     Component JavaDoc getComponent();
74
75     /**
76      * Returns the search component for this category pane. This component
77      * should be made visible when the Find action is invoked, by calling
78      * <code>setVisible(true)</code>.
79      *
80      * @return search component.
81      */

82     SearchComponent getSearchComponent();
83
84     /**
85      * Add components to the given toolbar to permit selecting the current
86      * category. Note that all categories should have already been added
87      * to this pane via the add(Category) method.
88      *
89      * @param toolbar toolbar component to be populated.
90      */

91     void populateToolbar(JToolBar JavaDoc toolbar);
92
93     /**
94      * Remove a PropertyChangeListener from the listener list.
95      *
96      * @param listener property change listener to remove.
97      */

98     void removePropertyChangeListener(PropertyChangeListener JavaDoc listener);
99
100     /**
101      * Remove a PropertyChangeListener for a specific property.
102      *
103      * @param name name of property to listen to.
104      * @param listener property change listener to remove.
105      */

106     void removePropertyChangeListener(String JavaDoc name, PropertyChangeListener JavaDoc listener);
107
108     /**
109      * Change the selected Category to the one given. Notifies property change
110      * listeners of the change in selection (property name "category").
111      *
112      * @param category Category to be selected (may not be null).
113      */

114     void setCategory(Category category);
115 }
116
Popular Tags