KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > Choice


1 /*
2  * @(#)Choice.java 1.89 04/05/18
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package java.awt;
8
9 import java.util.*;
10 import java.awt.peer.ChoicePeer;
11 import java.awt.event.*;
12 import java.util.EventListener JavaDoc;
13 import java.io.ObjectOutputStream JavaDoc;
14 import java.io.ObjectInputStream JavaDoc;
15 import java.io.IOException JavaDoc;
16
17 import javax.accessibility.*;
18
19 /**
20  * The <code>Choice</code> class presents a pop-up menu of choices.
21  * The current choice is displayed as the title of the menu.
22  * <p>
23  * The following code example produces a pop-up menu:
24  * <p>
25  * <hr><blockquote><pre>
26  * Choice ColorChooser = new Choice();
27  * ColorChooser.add("Green");
28  * ColorChooser.add("Red");
29  * ColorChooser.add("Blue");
30  * </pre></blockquote><hr>
31  * <p>
32  * After this choice menu has been added to a panel,
33  * it appears as follows in its normal state:
34  * <p>
35  * <img SRC="doc-files/Choice-1.gif" alt="The following text describes the graphic"
36  * ALIGN=center HSPACE=10 VSPACE=7>
37  * <p>
38  * In the picture, <code>"Green"</code> is the current choice.
39  * Pushing the mouse button down on the object causes a menu to
40  * appear with the current choice highlighted.
41  * <p>
42  * Some native platforms do not support arbitrary resizing of
43  * <code>Choice</code> components and the behavior of
44  * <code>setSize()/getSize()</code> is bound by
45  * such limitations.
46  * Native GUI <code>Choice</code> components' size are often bound by such
47  * attributes as font size and length of items contained within
48  * the <code>Choice</code>.
49  * <p>
50  * @version 1.89 05/18/04
51  * @author Sami Shaio
52  * @author Arthur van Hoff
53  * @since JDK1.0
54  */

55 public class Choice extends Component JavaDoc implements ItemSelectable JavaDoc, Accessible {
56     /**
57      * The items for the <code>Choice</code>.
58      * This can be a <code>null</code> value.
59      * @serial
60      * @see #add(String)
61      * @see #addItem(String)
62      * @see #getItem(int)
63      * @see #getItemCount()
64      * @see #insert(String, int)
65      * @see #remove(String)
66      */

67     Vector pItems;
68
69     /**
70      * The index of the current choice for this <code>Choice</code>
71      * or -1 if nothing is selected.
72      * @serial
73      * @see #getSelectedItem()
74      * @see #select(int)
75      */

76     int selectedIndex = -1;
77
78     transient ItemListener itemListener;
79
80     private static final String JavaDoc base = "choice";
81     private static int nameCounter = 0;
82
83     /*
84      * JDK 1.1 serialVersionUID
85      */

86      private static final long serialVersionUID = -4075310674757313071L;
87
88     /**
89      * Creates a new choice menu. The menu initially has no items in it.
90      * <p>
91      * By default, the first item added to the choice menu becomes the
92      * selected item, until a different selection is made by the user
93      * by calling one of the <code>select</code> methods.
94      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
95      * returns true
96      * @see java.awt.GraphicsEnvironment#isHeadless
97      * @see #select(int)
98      * @see #select(java.lang.String)
99      */

100     public Choice() throws HeadlessException JavaDoc {
101         GraphicsEnvironment.checkHeadless();
102     pItems = new Vector();
103     }
104
105     /**
106      * Constructs a name for this component. Called by
107      * <code>getName</code> when the name is <code>null</code>.
108      */

109     String JavaDoc constructComponentName() {
110         synchronized (getClass()) {
111         return base + nameCounter++;
112     }
113     }
114
115     /**
116      * Creates the <code>Choice</code>'s peer. This peer allows us
117      * to change the look
118      * of the <code>Choice</code> without changing its functionality.
119      * @see java.awt.Toolkit#createChoice(java.awt.Choice)
120      * @see java.awt.Component#getToolkit()
121      */

122     public void addNotify() {
123         synchronized (getTreeLock()) {
124         if (peer == null)
125             peer = getToolkit().createChoice(this);
126         super.addNotify();
127     }
128     }
129
130     /**
131      * Returns the number of items in this <code>Choice</code> menu.
132      * @return the number of items in this <code>Choice</code> menu
133      * @see #getItem
134      * @since JDK1.1
135      */

136     public int getItemCount() {
137     return countItems();
138     }
139
140     /**
141      * @deprecated As of JDK version 1.1,
142      * replaced by <code>getItemCount()</code>.
143      */

144     @Deprecated JavaDoc
145     public int countItems() {
146     return pItems.size();
147     }
148
149     /**
150      * Gets the string at the specified index in this
151      * <code>Choice</code> menu.
152      * @param index the index at which to begin
153      * @see #getItemCount
154      */

155     public String JavaDoc getItem(int index) {
156     return getItemImpl(index);
157     }
158
159     /*
160      * This is called by the native code, so client code can't
161      * be called on the toolkit thread.
162      */

163     final String JavaDoc getItemImpl(int index) {
164     return (String JavaDoc)pItems.elementAt(index);
165     }
166
167     /**
168      * Adds an item to this <code>Choice</code> menu.
169      * @param item the item to be added
170      * @exception NullPointerException if the item's value is
171      * <code>null</code>
172      * @since JDK1.1
173      */

174     public void add(String JavaDoc item) {
175     addItem(item);
176     }
177
178     /**
179      * Obsolete as of Java 2 platform v1.1. Please use the
180      * <code>add</code> method instead.
181      * <p>
182      * Adds an item to this <code>Choice</code> menu.
183      * @param item the item to be added
184      * @exception NullPointerException if the item's value is equal to
185      * <code>null</code>
186      */

187     public void addItem(String JavaDoc item) {
188         synchronized (this) {
189         insertNoInvalidate(item, pItems.size());
190     }
191
192     // This could change the preferred size of the Component.
193
if (valid) {
194         invalidate();
195     }
196     }
197
198     /**
199      * Inserts an item to this <code>Choice</code>,
200      * but does not invalidate the <code>Choice</code>.
201      * Client methods must provide their own synchronization before
202      * invoking this method.
203      * @param item the item to be added
204      * @param index the new item position
205      * @exception NullPointerException if the item's value is equal to
206      * <code>null</code>
207      */

208     private void insertNoInvalidate(String JavaDoc item, int index) {
209         if (item == null) {
210         throw new
211             NullPointerException JavaDoc("cannot add null item to Choice");
212     }
213     pItems.insertElementAt(item, index);
214     ChoicePeer peer = (ChoicePeer)this.peer;
215     if (peer != null) {
216         peer.addItem(item, index);
217     }
218     // no selection or selection shifted up
219
if (selectedIndex < 0 || selectedIndex >= index) {
220         select(0);
221     }
222     }
223
224
225     /**
226      * Inserts the item into this choice at the specified position.
227      * Existing items at an index greater than or equal to
228      * <code>index</code> are shifted up by one to accommodate
229      * the new item. If <code>index</code> is greater than or
230      * equal to the number of items in this choice,
231      * <code>item</code> is added to the end of this choice.
232      * <p>
233      * If the item is the first one being added to the choice,
234      * then the item becomes selected. Otherwise, if the
235      * selected item was one of the items shifted, the first
236      * item in the choice becomes the selected item. If the
237      * selected item was no among those shifted, it remains
238      * the selected item.
239      * @param item the non-<code>null</code> item to be inserted
240      * @param index the position at which the item should be inserted
241      * @exception IllegalArgumentException if index is less than 0
242      */

243     public void insert(String JavaDoc item, int index) {
244         synchronized (this) {
245         if (index < 0) {
246             throw new IllegalArgumentException JavaDoc("index less than zero.");
247         }
248             /* if the index greater than item count, add item to the end */
249             index = Math.min(index, pItems.size());
250
251             insertNoInvalidate(item, index);
252     }
253
254     // This could change the preferred size of the Component.
255
if (valid) {
256         invalidate();
257     }
258     }
259
260     /**
261      * Removes the first occurrence of <code>item</code>
262      * from the <code>Choice</code> menu. If the item
263      * being removed is the currently selected item,
264      * then the first item in the choice becomes the
265      * selected item. Otherwise, the currently selected
266      * item remains selected (and the selected index is
267      * updated accordingly).
268      * @param item the item to remove from this <code>Choice</code> menu
269      * @exception IllegalArgumentException if the item doesn't
270      * exist in the choice menu
271      * @since JDK1.1
272      */

273     public void remove(String JavaDoc item) {
274         synchronized (this) {
275         int index = pItems.indexOf(item);
276         if (index < 0) {
277             throw new IllegalArgumentException JavaDoc("item " + item +
278                            " not found in choice");
279         } else {
280             removeNoInvalidate(index);
281         }
282     }
283
284     // This could change the preferred size of the Component.
285
if (valid) {
286         invalidate();
287     }
288     }
289
290     /**
291      * Removes an item from the choice menu
292      * at the specified position. If the item
293      * being removed is the currently selected item,
294      * then the first item in the choice becomes the
295      * selected item. Otherwise, the currently selected
296      * item remains selected (and the selected index is
297      * @param position the position of the item
298      * @throws IndexOutOfBoundsException if the specified
299      * position is out of bounds
300      * @since JDK1.1
301      */

302     public void remove(int position) {
303         synchronized (this) {
304         removeNoInvalidate(position);
305     }
306
307     // This could change the preferred size of the Component.
308
if (valid) {
309         invalidate();
310     }
311     }
312
313     /**
314      * Removes an item from the <code>Choice</code> at the
315      * specified position, but does not invalidate the <code>Choice</code>.
316      * Client methods must provide their
317      * own synchronization before invoking this method.
318      * @param position the position of the item
319      */

320     private void removeNoInvalidate(int position) {
321         pItems.removeElementAt(position);
322     ChoicePeer peer = (ChoicePeer)this.peer;
323     if (peer != null) {
324         peer.remove(position);
325     }
326     /* Adjust selectedIndex if selected item was removed. */
327     if (pItems.size() == 0) {
328         selectedIndex = -1;
329     } else if (selectedIndex == position) {
330         select(0);
331     } else if (selectedIndex > position) {
332         select(selectedIndex-1);
333     }
334     }
335
336
337     /**
338      * Removes all items from the choice menu.
339      * @see #remove
340      * @since JDK1.1
341      */

342     public void removeAll() {
343         synchronized (this) {
344             if (peer != null) {
345                 ((ChoicePeer)peer).removeAll();
346             }
347             pItems.removeAllElements();
348             selectedIndex = -1;
349     }
350
351     // This could change the preferred size of the Component.
352
if (valid) {
353         invalidate();
354     }
355     }
356
357     /**
358      * Gets a representation of the current choice as a string.
359      * @return a string representation of the currently
360      * selected item in this choice menu
361      * @see #getSelectedIndex
362      */

363     public synchronized String JavaDoc getSelectedItem() {
364     return (selectedIndex >= 0) ? getItem(selectedIndex) : null;
365     }
366
367     /**
368      * Returns an array (length 1) containing the currently selected
369      * item. If this choice has no items, returns <code>null</code>.
370      * @see ItemSelectable
371      */

372     public synchronized Object JavaDoc[] getSelectedObjects() {
373     if (selectedIndex >= 0) {
374             Object JavaDoc[] items = new Object JavaDoc[1];
375             items[0] = getItem(selectedIndex);
376             return items;
377         }
378         return null;
379     }
380
381     /**
382      * Returns the index of the currently selected item.
383      * If nothing is selected, returns -1.
384      *
385      * @return the index of the currently selected item, or -1 if nothing
386      * is currently selected
387      * @see #getSelectedItem
388      */

389     public int getSelectedIndex() {
390     return selectedIndex;
391     }
392
393     /**
394      * Sets the selected item in this <code>Choice</code> menu to be the
395      * item at the specified position.
396      *
397      * <p>Note that this method should be primarily used to
398      * initially select an item in this component.
399      * Programmatically calling this method will <i>not</i> trigger
400      * an <code>ItemEvent</code>. The only way to trigger an
401      * <code>ItemEvent</code> is by user interaction.
402      *
403      * @param pos the positon of the selected item
404      * @exception IllegalArgumentException if the specified
405      * position is greater than the
406      * number of items or less than zero
407      * @see #getSelectedItem
408      * @see #getSelectedIndex
409      */

410     public synchronized void select(int pos) {
411     if ((pos >= pItems.size()) || (pos < 0)) {
412         throw new IllegalArgumentException JavaDoc("illegal Choice item position: " + pos);
413     }
414     if (pItems.size() > 0) {
415         selectedIndex = pos;
416         ChoicePeer peer = (ChoicePeer)this.peer;
417         if (peer != null) {
418         peer.select(pos);
419         }
420     }
421     }
422
423     /**
424      * Sets the selected item in this <code>Choice</code> menu
425      * to be the item whose name is equal to the specified string.
426      * If more than one item matches (is equal to) the specified string,
427      * the one with the smallest index is selected.
428      *
429      * <p>Note that this method should be primarily used to
430      * initially select an item in this component.
431      * Programmatically calling this method will <i>not</i> trigger
432      * an <code>ItemEvent</code>. The only way to trigger an
433      * <code>ItemEvent</code> is by user interaction.
434      *
435      * @param str the specified string
436      * @see #getSelectedItem
437      * @see #getSelectedIndex
438      */

439     public synchronized void select(String JavaDoc str) {
440     int index = pItems.indexOf(str);
441     if (index >= 0) {
442         select(index);
443     }
444     }
445
446     /**
447      * Adds the specified item listener to receive item events from
448      * this <code>Choice</code> menu. Item events are sent in response
449      * to user input, but not in response to calls to <code>select</code>.
450      * If l is <code>null</code>, no exception is thrown and no action
451      * is performed.
452      * @param l the item listener
453      * @see #removeItemListener
454      * @see #getItemListeners
455      * @see #select
456      * @see java.awt.event.ItemEvent
457      * @see java.awt.event.ItemListener
458      * @since JDK1.1
459      */

460     public synchronized void addItemListener(ItemListener l) {
461     if (l == null) {
462        return;
463     }
464         itemListener = AWTEventMulticaster.add(itemListener, l);
465         newEventsOnly = true;
466     }
467
468     /**
469      * Removes the specified item listener so that it no longer receives
470      * item events from this <code>Choice</code> menu.
471      * If l is <code>null</code>, no exception is thrown and no
472      * action is performed.
473      * @param l the item listener
474      * @see #addItemListener
475      * @see #getItemListeners
476      * @see java.awt.event.ItemEvent
477      * @see java.awt.event.ItemListener
478      * @since JDK1.1
479      */

480     public synchronized void removeItemListener(ItemListener l) {
481     if (l == null) {
482         return;
483     }
484         itemListener = AWTEventMulticaster.remove(itemListener, l);
485     }
486
487     /**
488      * Returns an array of all the item listeners
489      * registered on this choice.
490      *
491      * @return all of this choice's <code>ItemListener</code>s
492      * or an empty array if no item
493      * listeners are currently registered
494      *
495      * @see #addItemListener
496      * @see #removeItemListener
497      * @see java.awt.event.ItemEvent
498      * @see java.awt.event.ItemListener
499      * @since 1.4
500      */

501     public synchronized ItemListener[] getItemListeners() {
502         return (ItemListener[])(getListeners(ItemListener.class));
503     }
504
505     /**
506      * Returns an array of all the objects currently registered
507      * as <code><em>Foo</em>Listener</code>s
508      * upon this <code>Choice</code>.
509      * <code><em>Foo</em>Listener</code>s are registered using the
510      * <code>add<em>Foo</em>Listener</code> method.
511      *
512      * <p>
513      * You can specify the <code>listenerType</code> argument
514      * with a class literal, such as
515      * <code><em>Foo</em>Listener.class</code>.
516      * For example, you can query a
517      * <code>Choice</code> <code>c</code>
518      * for its item listeners with the following code:
519      *
520      * <pre>ItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));</pre>
521      *
522      * If no such listeners exist, this method returns an empty array.
523      *
524      * @param listenerType the type of listeners requested; this parameter
525      * should specify an interface that descends from
526      * <code>java.util.EventListener</code>
527      * @return an array of all objects registered as
528      * <code><em>Foo</em>Listener</code>s on this choice,
529      * or an empty array if no such
530      * listeners have been added
531      * @exception ClassCastException if <code>listenerType</code>
532      * doesn't specify a class or interface that implements
533      * <code>java.util.EventListener</code>
534      *
535      * @see #getItemListeners
536      * @since 1.3
537      */

538     public <T extends EventListener JavaDoc> T[] getListeners(Class JavaDoc<T> listenerType) {
539     EventListener JavaDoc l = null;
540     if (listenerType == ItemListener.class) {
541         l = itemListener;
542     } else {
543         return super.getListeners(listenerType);
544     }
545     return AWTEventMulticaster.getListeners(l, listenerType);
546     }
547
548     // REMIND: remove when filtering is done at lower level
549
boolean eventEnabled(AWTEvent JavaDoc e) {
550         if (e.id == ItemEvent.ITEM_STATE_CHANGED) {
551             if ((eventMask & AWTEvent.ITEM_EVENT_MASK) != 0 ||
552                 itemListener != null) {
553                 return true;
554             }
555             return false;
556         }
557         return super.eventEnabled(e);
558     }
559
560     /**
561      * Processes events on this choice. If the event is an
562      * instance of <code>ItemEvent</code>, it invokes the
563      * <code>processItemEvent</code> method. Otherwise, it calls its
564      * superclass's <code>processEvent</code> method.
565      * <p>Note that if the event parameter is <code>null</code>
566      * the behavior is unspecified and may result in an
567      * exception.
568      *
569      * @param e the event
570      * @see java.awt.event.ItemEvent
571      * @see #processItemEvent
572      * @since JDK1.1
573      */

574     protected void processEvent(AWTEvent JavaDoc e) {
575         if (e instanceof ItemEvent) {
576             processItemEvent((ItemEvent)e);
577             return;
578         }
579     super.processEvent(e);
580     }
581
582     /**
583      * Processes item events occurring on this <code>Choice</code>
584      * menu by dispatching them to any registered
585      * <code>ItemListener</code> objects.
586      * <p>
587      * This method is not called unless item events are
588      * enabled for this component. Item events are enabled
589      * when one of the following occurs:
590      * <p><ul>
591      * <li>An <code>ItemListener</code> object is registered
592      * via <code>addItemListener</code>.
593      * <li>Item events are enabled via <code>enableEvents</code>.
594      * </ul>
595      * <p>Note that if the event parameter is <code>null</code>
596      * the behavior is unspecified and may result in an
597      * exception.
598      *
599      * @param e the item event
600      * @see java.awt.event.ItemEvent
601      * @see java.awt.event.ItemListener
602      * @see #addItemListener(ItemListener)
603      * @see java.awt.Component#enableEvents
604      * @since JDK1.1
605      */

606     protected void processItemEvent(ItemEvent e) {
607         ItemListener listener = itemListener;
608         if (listener != null) {
609             listener.itemStateChanged(e);
610         }
611     }
612
613     /**
614      * Returns a string representing the state of this <code>Choice</code>
615      * menu. This method is intended to be used only for debugging purposes,
616      * and the content and format of the returned string may vary between
617      * implementations. The returned string may be empty but may not be
618      * <code>null</code>.
619      *
620      * @return the parameter string of this <code>Choice</code> menu
621      */

622     protected String JavaDoc paramString() {
623     return super.paramString() + ",current=" + getSelectedItem();
624     }
625
626
627     /* Serialization support.
628      */

629
630     /*
631      * Choice Serial Data Version.
632      * @serial
633      */

634     private int choiceSerializedDataVersion = 1;
635
636     /**
637      * Writes default serializable fields to stream. Writes
638      * a list of serializable <code>ItemListeners</code>
639      * as optional data. The non-serializable
640      * <code>ItemListeners</code> are detected and
641      * no attempt is made to serialize them.
642      *
643      * @param s the <code>ObjectOutputStream</code> to write
644      * @serialData <code>null</code> terminated sequence of 0
645      * or more pairs; the pair consists of a <code>String</code>
646      * and an <code>Object</code>; the <code>String</code> indicates
647      * the type of object and is one of the following:
648      * <code>itemListenerK</code> indicating an
649      * <code>ItemListener</code> object
650      *
651      * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
652      * @see java.awt.Component#itemListenerK
653      * @see #readObject(ObjectInputStream)
654      */

655     private void writeObject(ObjectOutputStream JavaDoc s)
656       throws java.io.IOException JavaDoc
657     {
658       s.defaultWriteObject();
659
660       AWTEventMulticaster.save(s, itemListenerK, itemListener);
661       s.writeObject(null);
662     }
663
664     /**
665      * Reads the <code>ObjectInputStream</code> and if it
666      * isn't <code>null</code> adds a listener to receive
667      * item events fired by the <code>Choice</code> item.
668      * Unrecognized keys or values will be ignored.
669      *
670      * @param s the <code>ObjectInputStream</code> to read
671      * @exception HeadlessException if
672      * <code>GraphicsEnvironment.isHeadless</code> returns
673      * <code>true</code>
674      * @serial
675      * @see #removeItemListener(ItemListener)
676      * @see #addItemListener(ItemListener)
677      * @see java.awt.GraphicsEnvironment#isHeadless
678      * @see #writeObject(ObjectOutputStream)
679      */

680     private void readObject(ObjectInputStream JavaDoc s)
681       throws ClassNotFoundException JavaDoc, IOException JavaDoc, HeadlessException JavaDoc
682     {
683       GraphicsEnvironment.checkHeadless();
684       s.defaultReadObject();
685
686       Object JavaDoc keyOrNull;
687       while(null != (keyOrNull = s.readObject())) {
688     String JavaDoc key = ((String JavaDoc)keyOrNull).intern();
689
690     if (itemListenerK == key)
691       addItemListener((ItemListener)(s.readObject()));
692
693     else // skip value for unrecognized key
694
s.readObject();
695       }
696     }
697
698
699 /////////////////
700
// Accessibility support
701
////////////////
702

703
704     /**
705      * Gets the <code>AccessibleContext</code> associated with this
706      * <code>Choice</code>. For <code>Choice</code> components,
707      * the <code>AccessibleContext</code> takes the form of an
708      * <code>AccessibleAWTChoice</code>. A new <code>AccessibleAWTChoice</code>
709      * instance is created if necessary.
710      *
711      * @return an <code>AccessibleAWTChoice</code> that serves as the
712      * <code>AccessibleContext</code> of this <code>Choice</code>
713      */

714     public AccessibleContext getAccessibleContext() {
715         if (accessibleContext == null) {
716             accessibleContext = new AccessibleAWTChoice();
717         }
718         return accessibleContext;
719     }
720
721     /**
722      * This class implements accessibility support for the
723      * <code>Choice</code> class. It provides an implementation of the
724      * Java Accessibility API appropriate to choice user-interface elements.
725      */

726     protected class AccessibleAWTChoice extends AccessibleAWTComponent
727         implements AccessibleAction
728     {
729         /*
730          * JDK 1.3 serialVersionUID
731          */

732         private static final long serialVersionUID = 7175603582428509322L;
733
734     public AccessibleAWTChoice() {
735         super();
736     }
737
738     /**
739          * Get the AccessibleAction associated with this object. In the
740          * implementation of the Java Accessibility API for this class,
741      * return this object, which is responsible for implementing the
742          * AccessibleAction interface on behalf of itself.
743      *
744      * @return this object
745      * @see AccessibleAction
746      */

747     public AccessibleAction getAccessibleAction() {
748         return this;
749     }
750
751         /**
752          * Get the role of this object.
753          *
754          * @return an instance of AccessibleRole describing the role of the
755      * object
756          * @see AccessibleRole
757          */

758         public AccessibleRole getAccessibleRole() {
759             return AccessibleRole.COMBO_BOX;
760         }
761
762     /**
763      * Returns the number of accessible actions available in this object
764      * If there are more than one, the first one is considered the "default"
765      * action of the object.
766      *
767      * @return the zero-based number of Actions in this object
768      */

769     public int getAccessibleActionCount() {
770         return 0; // To be fully implemented in a future release
771
}
772
773     /**
774      * Returns a description of the specified action of the object.
775      *
776      * @param i zero-based index of the actions
777      * @return a String description of the action
778      * @see #getAccessibleActionCount
779      */

780     public String JavaDoc getAccessibleActionDescription(int i) {
781         return null; // To be fully implemented in a future release
782
}
783
784     /**
785      * Perform the specified Action on the object
786      *
787      * @param i zero-based index of actions
788      * @return true if the action was performed; otherwise false.
789      * @see #getAccessibleActionCount
790      */

791     public boolean doAccessibleAction(int i) {
792         return false; // To be fully implemented in a future release
793
}
794
795     } // inner class AccessibleAWTChoice
796

797 }
798
Popular Tags