src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java

Print this page




  37 import sun.awt.AppContext;
  38 import sun.swing.DefaultLookup;
  39 import sun.swing.UIAction;
  40 
  41 /**
  42  * Basic UI implementation for JComboBox.
  43  * <p>
  44  * The combo box is a compound component which means that it is an agregate of
  45  * many simpler components. This class creates and manages the listeners
  46  * on the combo box and the combo box model. These listeners update the user
  47  * interface in response to changes in the properties and state of the combo box.
  48  * <p>
  49  * All event handling is handled by listener classes created with the
  50  * <code>createxxxListener()</code> methods and internal classes.
  51  * You can change the behavior of this class by overriding the
  52  * <code>createxxxListener()</code> methods and supplying your own
  53  * event listeners or subclassing from the ones supplied in this class.
  54  * <p>
  55  * For adding specific actions,
  56  * overide <code>installKeyboardActions</code> to add actions in response to
  57  * KeyStroke bindings. See the article <a href="http://java.sun.com/products/jfc/tsc/special_report/kestrel/keybindings.html">Keyboard Bindings in Swing</a>
  58  * at <a href="http://java.sun.com/products/jfc/tsc"><em>The Swing Connection</em></a>.
  59  *
  60  * @author Arnaud Weber
  61  * @author Tom Santos
  62  * @author Mark Davidson
  63  */
  64 public class BasicComboBoxUI extends ComboBoxUI {
  65     protected JComboBox comboBox;
  66     /**
  67      * This protected field is implementation specific. Do not access directly
  68      * or override.
  69      */
  70     protected boolean   hasFocus = false;
  71 
  72     // Control the selection behavior of the JComboBox when it is used
  73     // in the JTable DefaultCellEditor.
  74     private boolean isTableCellEditor = false;
  75     private static final String IS_TABLE_CELL_EDITOR = "JComboBox.isTableCellEditor";
  76 
  77     // This list is for drawing the current item in the combo box.
  78     protected JList   listBox;




  37 import sun.awt.AppContext;
  38 import sun.swing.DefaultLookup;
  39 import sun.swing.UIAction;
  40 
  41 /**
  42  * Basic UI implementation for JComboBox.
  43  * <p>
  44  * The combo box is a compound component which means that it is an agregate of
  45  * many simpler components. This class creates and manages the listeners
  46  * on the combo box and the combo box model. These listeners update the user
  47  * interface in response to changes in the properties and state of the combo box.
  48  * <p>
  49  * All event handling is handled by listener classes created with the
  50  * <code>createxxxListener()</code> methods and internal classes.
  51  * You can change the behavior of this class by overriding the
  52  * <code>createxxxListener()</code> methods and supplying your own
  53  * event listeners or subclassing from the ones supplied in this class.
  54  * <p>
  55  * For adding specific actions,
  56  * overide <code>installKeyboardActions</code> to add actions in response to
  57  * KeyStroke bindings. See the article <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html">How to Use Key Bindings</a>

  58  *
  59  * @author Arnaud Weber
  60  * @author Tom Santos
  61  * @author Mark Davidson
  62  */
  63 public class BasicComboBoxUI extends ComboBoxUI {
  64     protected JComboBox comboBox;
  65     /**
  66      * This protected field is implementation specific. Do not access directly
  67      * or override.
  68      */
  69     protected boolean   hasFocus = false;
  70 
  71     // Control the selection behavior of the JComboBox when it is used
  72     // in the JTable DefaultCellEditor.
  73     private boolean isTableCellEditor = false;
  74     private static final String IS_TABLE_CELL_EDITOR = "JComboBox.isTableCellEditor";
  75 
  76     // This list is for drawing the current item in the combo box.
  77     protected JList   listBox;