2004-08-12 Janis Johnson <janis187@us.ibm.com>
[official-gcc.git] / libjava / javax / swing / JComboBox.java
blobb66dcb3a9a8b9a91e5c5f089c0dad77e20d80e6f
1 /* JComboBox.java --
2 Copyright (C) 2002, 2004 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath 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 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package javax.swing;
41 import java.awt.ItemSelectable;
42 import java.awt.event.ActionEvent;
43 import java.awt.event.ActionListener;
44 import java.awt.event.ItemEvent;
45 import java.awt.event.ItemListener;
46 import java.awt.event.KeyEvent;
47 import java.beans.PropertyChangeListener;
48 import java.io.IOException;
49 import java.io.ObjectOutputStream;
50 import java.util.Vector;
52 import javax.accessibility.Accessible;
53 import javax.accessibility.AccessibleAction;
54 import javax.accessibility.AccessibleContext;
55 import javax.accessibility.AccessibleRole;
56 import javax.accessibility.AccessibleSelection;
57 import javax.swing.event.ListDataEvent;
58 import javax.swing.event.ListDataListener;
59 import javax.swing.event.PopupMenuListener;
60 import javax.swing.plaf.ComboBoxUI;
62 /**
63 * JComboBox
64 * @author Andrew Selkirk
65 * @version 1.0
67 public class JComboBox extends JComponent
68 implements ItemSelectable, ListDataListener, ActionListener, Accessible
70 private static final long serialVersionUID = 5654585963292734470L;
72 /**
73 * AccessibleJComboBox
75 protected class AccessibleJComboBox extends AccessibleJComponent
76 implements AccessibleAction, AccessibleSelection
78 private static final long serialVersionUID = 8217828307256675666L;
80 /**
81 * Constructor AccessibleJComboBox
82 * @param component TODO
84 protected AccessibleJComboBox()
88 /**
89 * getAccessibleChildrenCount
90 * @returns int
92 public int getAccessibleChildrenCount() {
93 return 0; // TODO
94 } // getAccessibleChildrenCount()
96 /**
97 * getAccessibleChild
98 * @param value0 TODO
99 * @returns Accessible
101 public Accessible getAccessibleChild(int value0) {
102 return null; // TODO
103 } // getAccessibleChild()
106 * getAccessibleSelection
107 * @returns AccessibleSelection
109 public AccessibleSelection getAccessibleSelection() {
110 return null; // TODO
111 } // getAccessibleSelection()
114 * getAccessibleSelection
115 * @param value0 TODO
116 * @returns Accessible
118 public Accessible getAccessibleSelection(int value0) {
119 return null; // TODO
120 } // getAccessibleSelection()
123 * isAccessibleChildSelected
124 * @param value0 TODO
125 * @returns boolean
127 public boolean isAccessibleChildSelected(int value0) {
128 return false; // TODO
129 } // isAccessibleChildSelected()
132 * getAccessibleRole
133 * @returns AccessibleRole
135 public AccessibleRole getAccessibleRole() {
136 return AccessibleRole.COMBO_BOX;
137 } // getAccessibleRole()
140 * getAccessibleAction
141 * @returns AccessibleAction
143 public AccessibleAction getAccessibleAction() {
144 return null; // TODO
145 } // getAccessibleAction()
148 * getAccessibleActionDescription
149 * @param value0 TODO
150 * @returns String
152 public String getAccessibleActionDescription(int value0) {
153 return null; // TODO
154 } // getAccessibleActionDescription()
157 * getAccessibleActionCount
158 * @returns int
160 public int getAccessibleActionCount() {
161 return 0; // TODO
162 } // getAccessibleActionCount()
165 * doAccessibleAction
166 * @param value0 TODO
167 * @returns boolean
169 public boolean doAccessibleAction(int value0) {
170 return false; // TODO
171 } // doAccessibleAction()
174 * getAccessibleSelectionCount
175 * @returns int
177 public int getAccessibleSelectionCount() {
178 return 0; // TODO
179 } // getAccessibleSelectionCount()
182 * addAccessibleSelection
183 * @param value0 TODO
185 public void addAccessibleSelection(int value0) {
186 // TODO
187 } // addAccessibleSelection()
190 * removeAccessibleSelection
191 * @param value0 TODO
193 public void removeAccessibleSelection(int value0) {
194 // TODO
195 } // removeAccessibleSelection()
198 * clearAccessibleSelection
200 public void clearAccessibleSelection() {
201 // TODO
202 } // clearAccessibleSelection()
205 * selectAllAccessibleSelection
207 public void selectAllAccessibleSelection() {
208 // TODO
209 } // selectAllAccessibleSelection()
212 } // AccessibleJComboBox
215 * KeySelectionManager
217 public static interface KeySelectionManager {
219 //-------------------------------------------------------------
220 // Methods ----------------------------------------------------
221 //-------------------------------------------------------------
224 * selectionForKey
225 * @param value0 TODO
226 * @param value1 TODO
227 * @returns int
229 int selectionForKey(char value0, ComboBoxModel value1);
232 } // KeySelectionManager
235 //-------------------------------------------------------------
236 // Variables --------------------------------------------------
237 //-------------------------------------------------------------
240 * uiClassID
242 private static final String uiClassID = "ComboBoxUI";
245 * dataModel
247 protected ComboBoxModel dataModel;
250 * renderer
252 protected ListCellRenderer renderer;
255 * editor
257 protected ComboBoxEditor editor;
260 * maximumRowCount
262 protected int maximumRowCount;
265 * isEditable
267 protected boolean isEditable;
270 * selectedItemReminder
272 protected Object selectedItemReminder;
275 * keySelectionManager
277 protected JComboBox.KeySelectionManager keySelectionManager;
280 * actionCommand
282 protected String actionCommand;
285 * lightWeightPopupEnabled
287 protected boolean lightWeightPopupEnabled;
290 //-------------------------------------------------------------
291 // Initialization ---------------------------------------------
292 //-------------------------------------------------------------
295 * Constructor JComboBox
296 * @param value0 TODO
298 public JComboBox(ComboBoxModel value0) {
299 // TODO
300 } // JComboBox()
303 * Constructor JComboBox
304 * @param value0 TODO
306 public JComboBox(Object[] value0) {
307 // TODO
308 } // JComboBox()
311 * Constructor JComboBox
312 * @param value0 TODO
314 public JComboBox(Vector value0) {
315 // TODO
316 } // JComboBox()
319 * Constructor JComboBox
321 public JComboBox() {
322 // TODO
323 } // JComboBox()
326 //-------------------------------------------------------------
327 // Methods ----------------------------------------------------
328 //-------------------------------------------------------------
331 * writeObject
332 * @param stream TODO
333 * @exception IOException TODO
335 private void writeObject(ObjectOutputStream stream) throws IOException {
336 // TODO
337 } // writeObject()
340 * isEditable
341 * @returns boolean
343 public boolean isEditable() {
344 return false; // TODO
345 } // isEditable()
348 * installAncestorListener
350 protected void installAncestorListener() {
351 // TODO
352 } // installAncestorListener()
355 * setUI
356 * @param ui TODO
358 public void setUI(ComboBoxUI ui) {
359 super.setUI(ui);
360 } // setUI()
363 * updateUI
365 public void updateUI() {
366 setUI((ComboBoxUI) UIManager.get(this));
367 invalidate();
368 } // updateUI()
371 * getUIClassID
372 * @returns String
374 public String getUIClassID() {
375 return uiClassID;
376 } // getUIClassID()
379 * getUI
380 * @returns ComboBoxUI
382 public ComboBoxUI getUI() {
383 return (ComboBoxUI) ui;
384 } // getUI()
387 * setModel
388 * @param value0 TODO
390 public void setModel(ComboBoxModel value0) {
391 // TODO
392 } // setModel()
395 * getModel
396 * @returns ComboBoxModel
398 public ComboBoxModel getModel() {
399 return null; // TODO
400 } // getModel()
403 * setLightWeightPopupEnabled
404 * @param value0 TODO
406 public void setLightWeightPopupEnabled(boolean value0) {
407 // TODO
408 } // setLightWeightPopupEnabled()
411 * isLightWeightPopupEnabled
412 * @returns boolean
414 public boolean isLightWeightPopupEnabled() {
415 return false; // TODO
416 } // isLightWeightPopupEnabled()
419 * setEditable
420 * @param value0 TODO
422 public void setEditable(boolean value0) {
423 // TODO
424 } // setEditable()
427 * setMaximumRowCount
428 * @param value0 TODO
430 public void setMaximumRowCount(int value0) {
431 // TODO
432 } // setMaximumRowCount()
435 * getMaximumRowCount
436 * @returns int
438 public int getMaximumRowCount() {
439 return 0; // TODO
440 } // getMaximumRowCount()
443 * setRenderer
444 * @param value0 TODO
446 public void setRenderer(ListCellRenderer value0) {
447 // TODO
448 } // setRenderer()
451 * getRenderer
452 * @returns ListCellRenderer
454 public ListCellRenderer getRenderer() {
455 return null; // TODO
456 } // getRenderer()
459 * setEditor
460 * @param value0 TODO
462 public void setEditor(ComboBoxEditor value0) {
463 // TODO
464 } // setEditor()
467 * getEditor
468 * @returns ComboBoxEditor
470 public ComboBoxEditor getEditor() {
471 return null; // TODO
472 } // getEditor()
475 * setSelectedItem
476 * @param value0 TODO
478 public void setSelectedItem(Object value0) {
479 // TODO
480 } // setSelectedItem()
483 * getSelectedItem
484 * @returns Object
486 public Object getSelectedItem() {
487 return null; // TODO
488 } // getSelectedItem()
491 * setSelectedIndex
492 * @param value0 TODO
494 public void setSelectedIndex(int value0) {
495 // TODO
496 } // setSelectedIndex()
499 * getSelectedIndex
500 * @returns int
502 public int getSelectedIndex() {
503 return 0; // TODO
504 } // getSelectedIndex()
507 * addItem
508 * @param value0 TODO
510 public void addItem(Object value0) {
511 // TODO
512 } // addItem()
515 * insertItemAt
516 * @param value0 TODO
517 * @param value1 TODO
519 public void insertItemAt(Object value0, int value1) {
520 // TODO
521 } // insertItemAt()
524 * removeItem
525 * @param value0 TODO
527 public void removeItem(Object value0) {
528 // TODO
529 } // removeItem()
532 * removeItemAt
533 * @param value0 TODO
535 public void removeItemAt(int value0) {
536 // TODO
537 } // removeItemAt()
540 * removeAllItems
542 public void removeAllItems() {
543 // TODO
544 } // removeAllItems()
547 * showPopup
549 public void showPopup() {
550 // TODO
551 } // showPopup()
554 * hidePopup
556 public void hidePopup() {
557 // TODO
558 } // hidePopup()
561 * setPopupVisible
562 * @param value0 TODO
564 public void setPopupVisible(boolean value0) {
565 // TODO
566 } // setPopupVisible()
569 * isPopupVisible
570 * @returns boolean
572 public boolean isPopupVisible() {
573 return false; // TODO
574 } // isPopupVisible()
577 * setActionCommand
578 * @param value0 TODO
580 public void setActionCommand(String value0) {
581 // TODO
582 } // setActionCommand()
585 * getActionCommand
586 * @returns String
588 public String getActionCommand() {
589 return null; // TODO
590 } // getActionCommand()
593 * setAction
594 * @param value0 TODO
596 public void setAction(Action value0) {
597 // TODO
598 } // setAction()
601 * isListener
602 * @param value0 TODO
603 * @param value1 TODO
604 * @returns boolean
606 private boolean isListener(Class value0, ActionListener value1) {
607 return false; // TODO
608 } // isListener()
611 * getAction
612 * @returns Action
614 public Action getAction() {
615 return null; // TODO
616 } // getAction()
619 * configurePropertiesFromAction
620 * @param value0 TODO
622 protected void configurePropertiesFromAction(Action value0) {
623 // TODO
624 } // configurePropertiesFromAction()
627 * createActionPropertyChangeListener
628 * @param value0 TODO
629 * @returns PropertyChangeListener
631 protected PropertyChangeListener createActionPropertyChangeListener(Action value0) {
632 return null; // TODO
633 } // createActionPropertyChangeListener()
636 * fireItemStateChanged
637 * @param value0 TODO
639 protected void fireItemStateChanged(ItemEvent value0) {
640 // TODO
641 } // fireItemStateChanged()
644 * fireActionEvent
646 protected void fireActionEvent() {
647 // TODO
648 } // fireActionEvent()
651 * selectedItemChanged
653 protected void selectedItemChanged() {
654 // TODO
655 } // selectedItemChanged()
658 * getSelectedObjects
659 * @returns Object[]
661 public Object[] getSelectedObjects() {
662 return null; // TODO
663 } // getSelectedObjects()
666 * actionPerformed
667 * @param value0 TODO
669 public void actionPerformed(ActionEvent value0) {
670 // TODO
671 } // actionPerformed()
674 * contentsChanged
675 * @param value0 TODO
677 public void contentsChanged(ListDataEvent value0) {
678 // TODO
679 } // contentsChanged()
682 * selectWithKeyChar
683 * @param value0 TODO
684 * @returns boolean
686 public boolean selectWithKeyChar(char value0) {
687 return false; // TODO
688 } // selectWithKeyChar()
691 * intervalAdded
692 * @param value0 TODO
694 public void intervalAdded(ListDataEvent value0) {
695 // TODO
696 } // intervalAdded()
699 * intervalRemoved
700 * @param value0 TODO
702 public void intervalRemoved(ListDataEvent value0) {
703 // TODO
704 } // intervalRemoved()
707 * setEnabled
708 * @param value0 TODO
710 public void setEnabled(boolean value0) {
711 // TODO
712 } // setEnabled()
715 * configureEditor
716 * @param value0 TODO
717 * @param value1 TODO
719 public void configureEditor(ComboBoxEditor value0, Object value1) {
720 // TODO
721 } // configureEditor()
724 * processKeyEvent
725 * @param value0 TODO
727 public void processKeyEvent(KeyEvent value0) {
728 // TODO
729 } // processKeyEvent()
732 * isFocusTraversable
733 * @returns boolean
734 * @deprecated
736 public boolean isFocusTraversable() {
737 return false; // TODO
738 } // isFocusTraversable()
741 * setKeySelectionManager
742 * @param value0 TODO
744 public void setKeySelectionManager(KeySelectionManager value0) {
745 // TODO
746 } // setKeySelectionManager()
749 * getKeySelectionManager
750 * @returns JComboBox.KeySelectionManager
752 public JComboBox.KeySelectionManager getKeySelectionManager() {
753 return null; // TODO
754 } // getKeySelectionManager()
757 * getItemCount
758 * @returns int
760 public int getItemCount() {
761 return 0; // TODO
762 } // getItemCount()
765 * getItemAt
766 * @param value0 TODO
767 * @returns Object
769 public Object getItemAt(int value0) {
770 return null; // TODO
771 } // getItemAt()
774 * createDefaultKeySelectionManager
775 * @returns KeySelectionManager
777 protected KeySelectionManager createDefaultKeySelectionManager() {
778 return null; // TODO
779 } // createDefaultKeySelectionManager()
782 * paramString
783 * @returns String
785 protected String paramString() {
786 return null; // TODO
787 } // paramString()
790 * getAccessibleContext
791 * @returns AccessibleContext
793 public AccessibleContext getAccessibleContext()
795 if (accessibleContext == null)
796 accessibleContext = new AccessibleJComboBox();
798 return accessibleContext;
802 * addActionListener
803 * @param listener TODO
805 public void addActionListener (ActionListener listener)
807 listenerList.add (ActionListener.class, listener);
811 * removeActionListener
812 * @param listener TODO
814 public void removeActionListener (ActionListener listener)
816 listenerList.remove (ActionListener.class, listener);
820 * @since 1.4
822 public ActionListener[] getActionListeners()
824 return (ActionListener[]) getListeners (ActionListener.class);
828 * addItemListener
829 * @param listener TODO
831 public void addItemListener(ItemListener listener)
833 listenerList.add (ItemListener.class, listener);
837 * removeItemListener
838 * @param listener TODO
840 public void removeItemListener(ItemListener listener)
842 listenerList.remove (ItemListener.class, listener);
846 * @since 1.4
848 public ItemListener[] getItemListeners()
850 return (ItemListener[]) getListeners (ItemListener.class);
853 public void addPopupMenuListener (PopupMenuListener listener)
855 listenerList.add (PopupMenuListener.class, listener);
858 public void removePopupMenuListener (PopupMenuListener listener)
860 listenerList.remove (PopupMenuListener.class, listener);
864 * @since 1.4
866 public PopupMenuListener[] getPopupMenuListeners()
868 return (PopupMenuListener[]) getListeners (PopupMenuListener.class);