PageRenderTime 47ms CodeModel.GetById 44ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/bundles/plugins-trunk/CommonControls/common/gui/itemfinder/ItemFinder.java

#
Java | 65 lines | 10 code | 6 blank | 49 comment | 0 complexity | 19ee416fc0231609e2fd7e93d5f2bb03 MD5 | raw file
 1/*
 2 * ItemFinder.java
 3 * :tabSize=8:indentSize=8:noTabs=false:
 4 * :folding=explicit:collapseFolds=1:
 5 *
 6 * Copyright (C) 2011 Matthieu Casanova
 7 *
 8 * This program is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 */
22package common.gui.itemfinder;
23
24import javax.swing.*;
25
26/**
27 * @author Matthieu Casanova
28 */
29public interface ItemFinder<E>
30{
31	/**
32	 * Returns the label for that ItemFinder.
33	 * If it is null, there is no label.
34	 * Otherwise the label will be displayed on top of the textfield,
35	 * if the panel is in an ItemFinderWindow, and on the left otherwise.
36	 * @return the label or null
37	 */
38	String getLabel();
39
40	/**
41	 * The list model that is used by the ItemFinderWindow
42	 * @return a listmodel
43	 */
44	ListModel getModel();
45
46	/**
47	 * Returns a ListCellRenderer that will render the celles of the dropdown list.
48	 * If null, the default one is used
49	 * @return the ListCellRenderer
50	 */
51	ListCellRenderer getListCellRenderer();
52
53	/**
54	 * Some chars were typed, update the list
55	 * @param s the searched string
56	 */
57	void updateList(String s);
58
59	/**
60	 * A selection has been made.
61	 * Do an action
62	 * @param item the selected item
63	 */
64	void selectionMade(E item);
65}