2 Copyright (C) 2002 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)
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
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
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. */
42 import java
.awt
.event
.*;
46 import javax
.accessibility
.*;
47 import javax
.swing
.event
.*;
48 import javax
.swing
.plaf
.*;
52 * @author Andrew Selkirk
55 public class JComboBox
extends JComponent
56 implements ItemSelectable
, ListDataListener
, ActionListener
, Accessible
58 private static final long serialVersionUID
= 5654585963292734470L;
61 //-------------------------------------------------------------
62 // Classes ----------------------------------------------------
63 //-------------------------------------------------------------
68 protected class AccessibleJComboBox
extends AccessibleJComponent
69 implements AccessibleAction
, AccessibleSelection
{
71 //-------------------------------------------------------------
72 // Variables --------------------------------------------------
73 //-------------------------------------------------------------
76 //-------------------------------------------------------------
77 // Initialization ---------------------------------------------
78 //-------------------------------------------------------------
81 * Constructor AccessibleJComboBox
82 * @param component TODO
84 protected AccessibleJComboBox(JComboBox component
) {
87 } // AccessibleJComboBox()
90 //-------------------------------------------------------------
91 // Methods ----------------------------------------------------
92 //-------------------------------------------------------------
95 * getAccessibleChildrenCount
98 public int getAccessibleChildrenCount() {
100 } // getAccessibleChildrenCount()
105 * @returns Accessible
107 public Accessible
getAccessibleChild(int value0
) {
109 } // getAccessibleChild()
112 * getAccessibleSelection
113 * @returns AccessibleSelection
115 public AccessibleSelection
getAccessibleSelection() {
117 } // getAccessibleSelection()
120 * getAccessibleSelection
122 * @returns Accessible
124 public Accessible
getAccessibleSelection(int value0
) {
126 } // getAccessibleSelection()
129 * isAccessibleChildSelected
133 public boolean isAccessibleChildSelected(int value0
) {
134 return false; // TODO
135 } // isAccessibleChildSelected()
139 * @returns AccessibleRole
141 public AccessibleRole
getAccessibleRole() {
142 return AccessibleRole
.COMBO_BOX
;
143 } // getAccessibleRole()
146 * getAccessibleAction
147 * @returns AccessibleAction
149 public AccessibleAction
getAccessibleAction() {
151 } // getAccessibleAction()
154 * getAccessibleActionDescription
158 public String
getAccessibleActionDescription(int value0
) {
160 } // getAccessibleActionDescription()
163 * getAccessibleActionCount
166 public int getAccessibleActionCount() {
168 } // getAccessibleActionCount()
175 public boolean doAccessibleAction(int value0
) {
176 return false; // TODO
177 } // doAccessibleAction()
180 * getAccessibleSelectionCount
183 public int getAccessibleSelectionCount() {
185 } // getAccessibleSelectionCount()
188 * addAccessibleSelection
191 public void addAccessibleSelection(int value0
) {
193 } // addAccessibleSelection()
196 * removeAccessibleSelection
199 public void removeAccessibleSelection(int value0
) {
201 } // removeAccessibleSelection()
204 * clearAccessibleSelection
206 public void clearAccessibleSelection() {
208 } // clearAccessibleSelection()
211 * selectAllAccessibleSelection
213 public void selectAllAccessibleSelection() {
215 } // selectAllAccessibleSelection()
218 } // AccessibleJComboBox
221 * KeySelectionManager
223 public static interface KeySelectionManager
{
225 //-------------------------------------------------------------
226 // Methods ----------------------------------------------------
227 //-------------------------------------------------------------
235 int selectionForKey(char value0
, ComboBoxModel value1
);
238 } // KeySelectionManager
241 //-------------------------------------------------------------
242 // Variables --------------------------------------------------
243 //-------------------------------------------------------------
248 private static final String uiClassID
= "ComboBoxUI";
253 protected ComboBoxModel dataModel
;
258 protected ListCellRenderer renderer
;
263 protected ComboBoxEditor editor
;
268 protected int maximumRowCount
;
273 protected boolean isEditable
;
276 * selectedItemReminder
278 protected Object selectedItemReminder
;
281 * keySelectionManager
283 protected JComboBox
.KeySelectionManager keySelectionManager
;
288 protected String actionCommand
;
291 * lightWeightPopupEnabled
293 protected boolean lightWeightPopupEnabled
;
296 //-------------------------------------------------------------
297 // Initialization ---------------------------------------------
298 //-------------------------------------------------------------
301 * Constructor JComboBox
304 public JComboBox(ComboBoxModel value0
) {
309 * Constructor JComboBox
312 public JComboBox(Object
[] value0
) {
317 * Constructor JComboBox
320 public JComboBox(Vector value0
) {
325 * Constructor JComboBox
332 //-------------------------------------------------------------
333 // Methods ----------------------------------------------------
334 //-------------------------------------------------------------
339 * @exception IOException TODO
341 private void writeObject(ObjectOutputStream stream
) throws IOException
{
349 public boolean isEditable() {
350 return false; // TODO
354 * installAncestorListener
356 protected void installAncestorListener() {
358 } // installAncestorListener()
364 public void setUI(ComboBoxUI ui
) {
371 public void updateUI() {
372 setUI((ComboBoxUI
) UIManager
.get(this));
380 public String
getUIClassID() {
386 * @returns ComboBoxUI
388 public ComboBoxUI
getUI() {
389 return (ComboBoxUI
) ui
;
396 public void setModel(ComboBoxModel value0
) {
402 * @returns ComboBoxModel
404 public ComboBoxModel
getModel() {
409 * setLightWeightPopupEnabled
412 public void setLightWeightPopupEnabled(boolean value0
) {
414 } // setLightWeightPopupEnabled()
417 * isLightWeightPopupEnabled
420 public boolean isLightWeightPopupEnabled() {
421 return false; // TODO
422 } // isLightWeightPopupEnabled()
428 public void setEditable(boolean value0
) {
436 public void setMaximumRowCount(int value0
) {
438 } // setMaximumRowCount()
444 public int getMaximumRowCount() {
446 } // getMaximumRowCount()
452 public void setRenderer(ListCellRenderer value0
) {
458 * @returns ListCellRenderer
460 public ListCellRenderer
getRenderer() {
468 public void setEditor(ComboBoxEditor value0
) {
474 * @returns ComboBoxEditor
476 public ComboBoxEditor
getEditor() {
484 public void setSelectedItem(Object value0
) {
486 } // setSelectedItem()
492 public Object
getSelectedItem() {
494 } // getSelectedItem()
500 public void setSelectedIndex(int value0
) {
502 } // setSelectedIndex()
508 public int getSelectedIndex() {
510 } // getSelectedIndex()
516 public void addItem(Object value0
) {
525 public void insertItemAt(Object value0
, int value1
) {
533 public void removeItem(Object value0
) {
541 public void removeItemAt(int value0
) {
548 public void removeAllItems() {
550 } // removeAllItems()
555 public void showPopup() {
562 public void hidePopup() {
570 public void setPopupVisible(boolean value0
) {
572 } // setPopupVisible()
578 public boolean isPopupVisible() {
579 return false; // TODO
580 } // isPopupVisible()
586 public void addItemListener(ItemListener value0
) {
588 } // addItemListener()
594 public void removeItemListener(ItemListener value0
) {
596 } // removeItemListener()
602 public void addActionListener(ActionListener value0
) {
604 } // addActionListener()
607 * removeActionListener
610 public void removeActionListener(ActionListener value0
) {
612 } // removeActionListener()
618 public void setActionCommand(String value0
) {
620 } // setActionCommand()
626 public String
getActionCommand() {
628 } // getActionCommand()
634 public void setAction(Action value0
) {
644 private boolean isListener(Class value0
, ActionListener value1
) {
645 return false; // TODO
652 public Action
getAction() {
657 * configurePropertiesFromAction
660 protected void configurePropertiesFromAction(Action value0
) {
662 } // configurePropertiesFromAction()
665 * createActionPropertyChangeListener
667 * @returns PropertyChangeListener
669 protected PropertyChangeListener
createActionPropertyChangeListener(Action value0
) {
671 } // createActionPropertyChangeListener()
674 * fireItemStateChanged
677 protected void fireItemStateChanged(ItemEvent value0
) {
679 } // fireItemStateChanged()
684 protected void fireActionEvent() {
686 } // fireActionEvent()
689 * selectedItemChanged
691 protected void selectedItemChanged() {
693 } // selectedItemChanged()
699 public Object
[] getSelectedObjects() {
701 } // getSelectedObjects()
707 public void actionPerformed(ActionEvent value0
) {
709 } // actionPerformed()
715 public void contentsChanged(ListDataEvent value0
) {
717 } // contentsChanged()
724 public boolean selectWithKeyChar(char value0
) {
725 return false; // TODO
726 } // selectWithKeyChar()
732 public void intervalAdded(ListDataEvent value0
) {
740 public void intervalRemoved(ListDataEvent value0
) {
742 } // intervalRemoved()
748 public void setEnabled(boolean value0
) {
757 public void configureEditor(ComboBoxEditor value0
, Object value1
) {
759 } // configureEditor()
765 public void processKeyEvent(KeyEvent value0
) {
767 } // processKeyEvent()
774 public boolean isFocusTraversable() {
775 return false; // TODO
776 } // isFocusTraversable()
779 * setKeySelectionManager
782 public void setKeySelectionManager(KeySelectionManager value0
) {
784 } // setKeySelectionManager()
787 * getKeySelectionManager
788 * @returns JComboBox.KeySelectionManager
790 public JComboBox
.KeySelectionManager
getKeySelectionManager() {
792 } // getKeySelectionManager()
798 public int getItemCount() {
807 public Object
getItemAt(int value0
) {
812 * createDefaultKeySelectionManager
813 * @returns KeySelectionManager
815 protected KeySelectionManager
createDefaultKeySelectionManager() {
817 } // createDefaultKeySelectionManager()
823 protected String
paramString() {
828 * getAccessibleContext
829 * @returns AccessibleContext
831 public AccessibleContext
getAccessibleContext() {
832 if (accessibleContext
== null) {
833 accessibleContext
= new AccessibleJComboBox(this);
835 return accessibleContext
;
836 } // getAccessibleContext()