01: /*
02: *
03: *
04: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package javax.microedition.lcdui;
28:
29: /**
30: * This interface is used by applications which need to receive
31: * events that indicate changes in the internal
32: * state of the interactive items within a {@link Form Form}
33: * screen.
34: *
35: * @see Form#setItemStateListener(ItemStateListener)
36: * @since MIDP 1.0
37: */
38: public interface ItemStateListener {
39:
40: /**
41: * Called when internal state of an <code>Item</code> has been
42: * changed by the user.
43: * This happens when the user:
44: * <UL>
45: * <LI>changes the set of selected values in a
46: * <code>ChoiceGroup</code>;</LI>
47: * <LI>adjusts the value of an interactive <code>Gauge</code>;</LI>
48: * <LI>enters or modifies the value in a <code>TextField</code>;</LI>
49: * <LI>enters a new date or time in a <code>DateField</code>; and</LI>
50: * <LI>{@link Item#notifyStateChanged} was called on an
51: * <code>Item</code>.</LI>
52: * </UL>
53: *
54: * <p> It is up to the device to decide when it considers a
55: * new value to have been entered into an <code>Item</code>. For example,
56: * implementations of text editing within a <code>TextField</code>
57: * vary greatly
58: * from device to device. </P>
59: *
60: * <p>In general, it is not expected that the listener will be called
61: * after every change is made. However, if an item's value
62: * has been changed, the listener
63: * will be called to notify the application of the change
64: * before it is called for a change on another item, and before a
65: * command is delivered to the <code>Form's</code>
66: * <code>CommandListener</code>. For implementations that have the
67: * concept of an input
68: * focus, the listener should be called no later than when the focus moves
69: * away from an item whose state has been changed. The listener
70: * should be called only if the item's value has actually been
71: * changed.</P>
72: *
73: * <p> The listener is not called if the application changes
74: * the value of an interactive item. </p>
75: *
76: * @param item the item that was changed
77: */
78: public void itemStateChanged(Item item);
79: }
|