2
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
6
* The contents of this file are subject to the terms of either the GNU
7
* General Public License Version 2 only ("GPL") or the Common
8
* Development and Distribution License("CDDL") (collectively, the
9
* "License"). You may not use this file except in compliance with the
10
* License. You can obtain a copy of the License at
11
* http://www.netbeans.org/cddl-gplv2.html
12
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
* specific language governing permissions and limitations under the
14
* License. When distributing the software, include this License Header
15
* Notice in each file and include the License file at
16
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17
* particular file as subject to the "Classpath" exception as provided
18
* by Sun in the GPL Version 2 section of the License file that
19
* accompanied this code. If applicable, add the following below the
20
* License Header, with the fields enclosed by brackets [] replaced by
21
* your own identifying information:
22
* "Portions Copyrighted [year] [name of copyright owner]"
26
* The Original Software is NetBeans. The Initial Developer of the Original
27
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
28
* Microsystems, Inc. All Rights Reserved.
30
* If you wish your version of this file to be governed by only the CDDL
31
* or only the GPL Version 2, indicate your decision by adding
32
* "[Contributor] elects to include this software in this distribution
33
* under the [CDDL or GPL Version 2] license." If you do not indicate a
34
* single choice of license, a recipient has the option to distribute
35
* your version of this file under either the CDDL, the GPL Version 2 or
36
* to extend the choice of license to its licensees as provided above.
37
* However, if you add GPL Version 2 code and therefore, elected the GPL
38
* Version 2 license, then the option applies only if the new code is
39
* made subject to such option by the copyright holder.
42
package org.netbeans.modules.xml.xam.ui.category;
44
import java.awt.Component;
45
import java.beans.PropertyChangeListener;
46
import javax.swing.JToolBar;
47
import org.openide.util.Lookup;
50
* A CategoryPane manages a set of Category instances, displaying one
51
* category at any given time, and providing a means of selecting the
52
* category to be shown.
54
* @author Nathan Fiedler
56
public interface CategoryPane {
57
/** Property name for the selected Category. */
58
public static final String PROP_CATEGORY = "category";
61
* Adds the Category to this pane. All of the available categories
62
* must be added before the populateToolbar() method is invoked.
64
* @param category Category to be added.
66
void addCategory(Category category);
69
* Add a PropertyChangeListener to the listener list.
71
* @param listener property change listener to add.
73
void addPropertyChangeListener(PropertyChangeListener listener);
76
* Add a PropertyChangeListener for a specific property.
78
* @param name name of property to listen to.
79
* @param listener property change listener to add.
81
void addPropertyChangeListener(String name, PropertyChangeListener listener);
84
* Returns the currently selected Category.
86
* @return currently seleced Category, or null if none.
88
Category getCategory();
91
* Returns the user interface component for this category pane.
93
* @return the user interface component.
95
Component getComponent();
98
* Returns the search component for this category pane. This component
99
* should be made visible when the Find action is invoked, by calling
100
* <code>setVisible(true)</code>.
102
* @return search component.
104
SearchComponent getSearchComponent();
107
* Add components to the given toolbar to permit selecting the current
108
* category. Note that all categories should have already been added
109
* to this pane via the add(Category) method.
111
* @param toolbar toolbar component to be populated.
113
void populateToolbar(JToolBar toolbar);
116
* Remove a PropertyChangeListener from the listener list.
118
* @param listener property change listener to remove.
120
void removePropertyChangeListener(PropertyChangeListener listener);
123
* Remove a PropertyChangeListener for a specific property.
125
* @param name name of property to listen to.
126
* @param listener property change listener to remove.
128
void removePropertyChangeListener(String name, PropertyChangeListener listener);
131
* Change the selected Category to the one given. Notifies property change
132
* listeners of the change in selection (property name "category").
134
* @param category Category to be selected (may not be null).
136
void setCategory(Category category);