001/* ---------------------------------------------------------------------------- 002 The Kiwi Toolkit - A Java Class Library 003 Copyright (C) 1998-2004 Mark A. Lindner 004 005 This library is free software; you can redistribute it and/or 006 modify it under the terms of the GNU General Public License as 007 published by the Free Software Foundation; either version 2 of the 008 License, or (at your option) any later version. 009 010 This library is distributed in the hope that it will be useful, 011 but WITHOUT ANY WARRANTY; without even the implied warranty of 012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 General Public License for more details. 014 015 You should have received a copy of the GNU General Public License 016 along with this library; if not, write to the Free Software 017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 018 02111-1307, USA. 019 020 The author may be contacted at: mark_a_lindner@yahoo.com 021 ---------------------------------------------------------------------------- 022 $Log: ListDataSource.java,v $ 023 Revision 1.2 2004/05/31 07:30:26 markl 024 Final cleanup and bugfixes of kiwi.ui.model. 025 026 Revision 1.1 2004/05/13 21:40:21 markl 027 new classes 028 029 ---------------------------------------------------------------------------- 030*/ 031 032package kiwi.ui.model; 033 034import javax.swing.Icon; 035 036/** An interface that defines a data source for <code>KListModel</code>s. 037 * 038 * @author Mark Lindner 039 * @since Kiwi 2.0 040 */ 041 042public interface ListDataSource extends ModelProperties 043 { 044 /** Get all of the items from the data source. 045 * 046 * @return An array of objects. 047 */ 048 049 public Object[] getItems(); 050 051 /** Get the value of an arbitrary property for a given item. 052 * 053 * @param item The item. 054 * @param property The name of the property. 055 * 056 * @return The value of the specified property, or <code>null</code> if 057 * there is no value for this property. 058 */ 059 060 public Object getValueForProperty(Object item, String property); 061 062 /** Get the icon for an item. 063 * 064 * @param item The item. 065 * @return An icon for the item. 066 */ 067 068 public String getLabel(Object item); 069 070 /** Get the icon for an item. 071 * 072 * @param item The item. 073 * @return An icon for the item. 074 */ 075 076 public Icon getIcon(Object item); 077 078 } 079 080/* end of source file */