1 /* 2 * @(#)ItemSelectable.java 1.16 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package java.awt; 9 10 import java.awt.event.*; 11 12 /** 13 * The interface for objects which contain a set of items for 14 * which zero or more can be selected. 15 * 16 * @version 1.16 12/19/03 17 * @author Amy Fowler 18 */ 19 20 public interface ItemSelectable { 21 22 /** 23 * Returns the selected items or <code>null</code> if no 24 * items are selected. 25 */ 26 public Object[] getSelectedObjects(); 27 28 /** 29 * Adds a listener to receive item events when the state of an item is 30 * changed by the user. Item events are not sent when an item's 31 * state is set programmatically. If <code>l</code> is 32 * <code>null</code>, no exception is thrown and no action is performed. 33 * 34 * @param l the listener to receive events 35 * @see ItemEvent 36 */ 37 public void addItemListener(ItemListener l); 38 39 /** 40 * Removes an item listener. 41 * If <code>l</code> is <code>null</code>, 42 * no exception is thrown and no action is performed. 43 * 44 * @param l the listener being removed 45 * @see ItemEvent 46 */ 47 public void removeItemListener(ItemListener l); 48 } 49