KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > palette > Model


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
21 package org.netbeans.modules.palette;
22
23 import javax.swing.Action JavaDoc;
24 import org.netbeans.spi.palette.PaletteController;
25 import org.netbeans.spi.palette.PaletteFilter;
26 import org.openide.util.*;
27
28 /**
29  * An interface for palette contents.
30  *
31  * @author S. Aubrecht
32  */

33 public interface Model {
34
35     /**
36      * Interested parties should listent to changes of this property to be
37      * notified when the selected item has changed.
38      */

39     public static final String JavaDoc PROP_SELECTED_ITEM = "selectedItem";
40
41     String JavaDoc getName();
42
43     /**
44      * @return Palette categories.
45      */

46     Category[] getCategories();
47             
48     /**
49      * @return Actions for palette's popup menu.
50      */

51     Action JavaDoc[] getActions();
52     
53     void addModelListener( ModelListener listener );
54     
55     void removeModelListener( ModelListener listener );
56     
57     /**
58      * @return The item currently selected in the palette or null if no item is selected.
59      */

60     Item getSelectedItem();
61     
62     /**
63      * @return The category that owns the currently selected item.
64      */

65     Category getSelectedCategory();
66     
67     /**
68      * Select new item and category.
69      *
70      * @param category New category to be selected or null.
71      * @param item New item to be selected or null.
72      */

73     void setSelectedItem( Lookup category, Lookup item );
74     
75     /**
76      * Ensure no item is selected.
77      */

78     void clearSelection();
79     
80     void refresh();
81     
82     void showCustomizer( PaletteController controller, Settings settings );
83     
84     Lookup getRoot();
85     
86     boolean moveCategory( Category source, Category target, boolean moveBefore );
87     
88     boolean canReorderCategories();
89 }
90
Popular Tags