/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import javax.accessibility.*;
/**
* Basic UI implementation for JComboBox.
* <p>
* The combo box is a compound component which means that it is an agregate of
* many simpler components. This class creates and manages the listeners
* on the combo box and the combo box model. These listeners update the user
* interface in response to changes in the properties and state of the combo box.
* <p>
* All event handling is handled by listener classes created with the
* <code>createxxxListener()</code> methods and internal classes.
* You can change the behavior of this class by overriding the
* <code>createxxxListener()</code> methods and supplying your own
* event listeners or subclassing from the ones supplied in this class.
* <p>
* For adding specific actions,
* overide <code>installKeyboardActions</code> to add actions in response to
* KeyStroke bindings. See the article <a href="http://java.sun.com/products/jfc/tsc/special_report/kestrel/keybindings.html">Keyboard Bindings in Swing</a>
* at <a href="http://java.sun.com/products/jfc/tsc"><em>The Swing Connection</em></a>.
*
* @author Arnaud Weber
* @author Tom Santos
* @author Mark Davidson
*/
/**
* This protected field is implementation specific. Do not access directly
* or override.
*/
protected boolean hasFocus = false;
// Control the selection behavior of the JComboBox when it is used
// in the JTable DefaultCellEditor.
private boolean isTableCellEditor = false;
// This list is for drawing the current item in the combo box.
// Used to render the currently selected item in the combo box.
// It doesn't have anything to do with the popup's rendering.
// The implementation of ComboPopup that is used to show the popup.
// The Component that the ComboBoxEditor uses for editing
// The arrow button that invokes the popup.
// Listeners that are attached to the JComboBox
/**
* This protected field is implementation specific. Do not access directly
* or override. Override the listener construction method instead.
*
* @see #createKeyListener
*/
/**
* This protected field is implementation specific. Do not access directly
* or override. Override the listener construction method instead.
*
* @see #createFocusListener
*/
/**
* This protected field is implementation specific. Do not access directly
* or override. Override the listener construction method instead.
*
* @see #createPropertyChangeListener
*/
/**
* This protected field is implementation specific. Do not access directly
* or override. Override the listener construction method instead.
*
* @see #createItemListener
*/
// Listeners that the ComboPopup produces.
// This is used for knowing when to cache the minimum preferred size.
// If the data in the list changes, the cached value get marked for recalc.
// Added to the current JComboBox model
/**
* This protected field is implementation specific. Do not access directly
* or override. Override the listener construction method instead.
*
* @see #createListDataListener
*/
/**
* Implements all the Listeners needed by this class, all existing
* listeners redirect to it.
*/
/**
* The time factor to treate the series of typed alphanumeric key
* as prefix for first letter navigation.
*/
/**
* This is tricky, this variables is needed for DefaultKeySelectionManager
* to take into account time factor.
*/
/**
* The default key selection manager
*/
// Flag for recalculating the minimum preferred size.
protected boolean isMinimumSizeDirty = true;
// Cached minimum preferred size.
// Flag for calculating the display size
private boolean isDisplaySizeDirty = true;
// Cached the size that the display needs to render the largest item
// Key used for lookup of the DefaultListCellRenderer in the AppContext.
new StringBuffer("DefaultListCellRendererKey");
= new StringBuffer("HidePopupKey");
/**
* Whether or not all cells have the same baseline.
*/
private boolean sameBaseline;
/**
* Indicates whether or not the combo box button should be square.
* If square, then the width and height are equal, and are both set to
* the height of the combo minus appropriate insets.
*
* @since 1.7
*/
protected boolean squareButton = true;
/**
* If specified, these insets act as padding around the cell renderer when
* laying out and painting the "selected" item in the combo box. These
* insets add to those specified by the cell renderer.
*
* @since 1.7
*/
// Used for calculating the default size.
renderer = new DefaultListCellRenderer();
new DefaultListCellRenderer());
}
return renderer;
}
/**
* Populates ComboBox's actions.
*/
}
//========================
// begin UI Initialization
//
return new BasicComboBoxUI();
}
isMinimumSizeDirty = true;
popup = createPopup();
// Is this combo box a cell editor?
}
}
}
comboBox.setRequestFocusEnabled( true );
}
}
setPopupVisible( comboBox, false);
}
if (comboBoxEditor instanceof UIResource ) {
// Leave focus in JComboBox.
}
}
if (keySelectionManager instanceof UIResource) {
}
keyListener = null;
}
/**
* Installs the default colors, default font, default renderer, and default
* editor into the JComboBox.
*/
protected void installDefaults() {
"ComboBox.background",
"ComboBox.foreground",
"ComboBox.font" );
//NOTE: this needs to default to true if not specified
squareButton = b == null ? true : b;
}
/**
* Creates and installs listeners for the combo box and its model.
* This method is called when the UI is installed.
*/
protected void installListeners() {
}
}
}
}
}
}
}
}
}
}
/**
* Uninstalls the default colors, default font, default renderer,
* and default editor from the combo box.
*/
protected void uninstallDefaults() {
"ComboBox.background",
"ComboBox.foreground",
"ComboBox.font" );
}
/**
* Removes the installed listeners from the combo box and its model.
* The number and types of listeners removed and in this method should be
* the same that was added in <code>installListeners</code>
*/
protected void uninstallListeners() {
if ( keyListener != null ) {
}
if ( itemListener != null) {
}
if ( propertyChangeListener != null ) {
}
if ( focusListener != null) {
}
if ( popupMouseListener != null) {
}
if ( popupMouseMotionListener != null) {
}
if (popupKeyListener != null) {
}
if ( listDataListener != null ) {
}
}
}
/**
* Creates the popup portion of the combo box.
*
* @return an instance of <code>ComboPopup</code>
* @see ComboPopup
*/
return new BasicComboPopup( comboBox );
}
/**
* Creates a <code>KeyListener</code> which will be added to the
* combo box. If this method returns null then it will not be added
* to the combo box.
*
* @return an instance <code>KeyListener</code> or null
*/
return getHandler();
}
/**
* Creates a <code>FocusListener</code> which will be added to the combo box.
* If this method returns null then it will not be added to the combo box.
*
* @return an instance of a <code>FocusListener</code> or null
*/
return getHandler();
}
/**
* Creates a list data listener which will be added to the
* <code>ComboBoxModel</code>. If this method returns null then
* it will not be added to the combo box model.
*
* @return an instance of a <code>ListDataListener</code> or null
*/
return getHandler();
}
/**
* Creates an <code>ItemListener</code> which will be added to the
* combo box. If this method returns null then it will not
* be added to the combo box.
* <p>
* Subclasses may override this method to return instances of their own
* ItemEvent handlers.
*
* @return an instance of an <code>ItemListener</code> or null
*/
return null;
}
/**
* Creates a <code>PropertyChangeListener</code> which will be added to
* the combo box. If this method returns null then it will not
* be added to the combo box.
*
* @return an instance of a <code>PropertyChangeListener</code> or null
*/
return getHandler();
}
/**
* Creates a layout manager for managing the components which make up the
* combo box.
*
* @return an instance of a layout manager
*/
return getHandler();
}
/**
* Creates the default renderer that will be used in a non-editiable combo
* box. A default renderer will used only if a renderer has not been
* explicitly set with <code>setRenderer</code>.
*
* @return a <code>ListCellRender</code> used for the combo box
* @see javax.swing.JComboBox#setRenderer
*/
return new BasicComboBoxRenderer.UIResource();
}
/**
* Creates the default editor that will be used in editable combo boxes.
* A default editor will be used only if an editor has not been
* explicitly set with <code>setEditor</code>.
*
* @return a <code>ComboBoxEditor</code> used for the combo box
* @see javax.swing.JComboBox#setEditor
*/
return new BasicComboBoxEditor.UIResource();
}
/**
* Returns the shared listener.
*/
}
return handler;
}
//
// end UI Initialization
//======================
//======================
// begin Inner classes
//
/**
* This listener checks to see if the key event isn't a navigation key. If
* it finds a key event that wasn't a navigation key it dispatches it to
* JComboBox.selectWithKeyChar() so that it can do type-ahead.
*
* This public inner class should be treated as protected.
* Instantiate it only within subclasses of
* <code>BasicComboBoxUI</code>.
*/
getHandler().keyPressed(e);
}
}
/**
* This listener hides the popup when the focus is lost. It also repaints
* when focus is gained or lost.
*
* This public inner class should be treated as protected.
* Instantiate it only within subclasses of
* <code>BasicComboBoxUI</code>.
*/
getHandler().focusGained(e);
}
getHandler().focusLost(e);
}
}
/**
* This listener watches for changes in the
* <code>ComboBoxModel</code>.
* <p>
* This public inner class should be treated as protected.
* Instantiate it only within subclasses of
* <code>BasicComboBoxUI</code>.
*
* @see #createListDataListener
*/
getHandler().contentsChanged(e);
}
getHandler().intervalAdded(e);
}
getHandler().intervalRemoved(e);
}
}
/**
* This listener watches for changes to the selection in the
* combo box.
* <p>
* This public inner class should be treated as protected.
* Instantiate it only within subclasses of
* <code>BasicComboBoxUI</code>.
*
* @see #createItemListener
*/
// This class used to implement behavior which is now redundant.
}
/**
* This listener watches for bound properties that have changed in the
* combo box.
* <p>
* Subclasses which wish to listen to combo box property changes should
* call the superclass methods to ensure that the combo box ui correctly
* handles property changes.
* <p>
* This public inner class should be treated as protected.
* Instantiate it only within subclasses of
* <code>BasicComboBoxUI</code>.
*
* @see #createPropertyChangeListener
*/
getHandler().propertyChange(e);
}
}
// Syncronizes the ToolTip text for the components within the combo box to be the
// same value as the combo box ToolTip text.
private void updateToolTipTextForChildren() {
if ( children[i] instanceof JComponent ) {
}
}
}
/**
* This layout manager handles the 'standard' layout of combo boxes. It puts
* the arrow button to the right and the editor to the left. If there is no
* editor it still keeps the arrow button to the right.
*
* This public inner class should be treated as protected.
* Instantiate it only within subclasses of
* <code>BasicComboBoxUI</code>.
*/
}
}
}
}
//
// end Inner classes
//====================
//===============================
// begin Sub-Component Management
//
/**
* Creates and initializes the components which make up the
* aggregate combo box. This method is called as part of the UI
* installation process.
*/
protected void installComponents() {
if (arrowButton != null) {
}
if ( comboBox.isEditable() ) {
addEditor();
}
}
/**
* The aggregate components which compise the combo box are
* unregistered and uninitialized. This method is called as part of the
* UI uninstallation process.
*/
protected void uninstallComponents() {
if ( arrowButton != null ) {
}
}
arrowButton = null;
}
/**
* This public method is implementation specific and should be private.
* do not call or override. To implement a specific editor create a
* custom <code>ComboBoxEditor</code>
*
* @see #createEditor
* @see javax.swing.JComboBox#setEditor
* @see javax.swing.ComboBoxEditor
*/
public void addEditor() {
removeEditor();
if(comboBox.isFocusOwner()) {
// Switch focus to the editor component
}
}
}
/**
* This public method is implementation specific and should be private.
* do not call or override.
*
* @see #addEditor
*/
public void removeEditor() {
}
}
/**
* This protected method is implementation specific and should be private.
* do not call or override.
*
* @see #addEditor
*/
protected void configureEditor() {
// Should be in the same state as the combobox
if (focusListener != null) {
}
if(editor instanceof JComponent) {
}
}
/**
* This protected method is implementation specific and should be private.
* Do not call or override.
*
* @see #addEditor
*/
protected void unconfigureEditor() {
if (focusListener != null) {
}
}
/**
* This public method is implementation specific and should be private. Do
* not call or override.
*
* @see #createArrowButton
*/
public void configureArrowButton() {
if ( arrowButton != null ) {
arrowButton.setRequestFocusEnabled(false);
arrowButton.setInheritsPopupMenu(true);
}
}
/**
* This public method is implementation specific and should be private. Do
* not call or override.
*
* @see #createArrowButton
*/
public void unconfigureArrowButton() {
if ( arrowButton != null ) {
}
}
/**
* Creates a button which will be used as the control to show or hide
* the popup portion of the combo box.
*
* @return a button which represents the popup control
*/
return button;
}
//
// end Sub-Component Management
//===============================
//================================
// begin ComboBoxUI Implementation
//
/**
* Tells if the popup is visible or not.
*/
}
/**
* Hides the popup.
*/
if ( v ) {
} else {
}
}
/**
* Determines if the JComboBox is focus traversable. If the JComboBox is editable
* this returns false, otherwise it returns true.
*/
return !comboBox.isEditable();
}
//
// end ComboBoxUI Implementation
//==============================
//=================================
// begin ComponentUI Implementation
if ( !comboBox.isEditable() ) {
paintCurrentValue(g,r,hasFocus);
}
}
return getMinimumSize(c);
}
/**
* The minumum size is the size of the display area plus insets plus the button.
*/
if ( !isMinimumSizeDirty ) {
return new Dimension(cachedMinimumSize);
}
//calculate the width and height of the button
//adjust the size based on the button width
isMinimumSizeDirty = false;
}
}
/**
* Returns the baseline.
*
* @throws NullPointerException {@inheritDoc}
* @throws IllegalArgumentException {@inheritDoc}
* @see javax.swing.JComponent#getBaseline(int, int)
* @since 1.6
*/
int baseline = -1;
// force sameBaseline to be updated.
if (sameBaseline) {
if (!comboBox.isEditable()) {
renderer = new DefaultListCellRenderer();
}
if (prototypeValue != null) {
}
// Note, we're assuming the baseline is the same for all
// cells, if not, this needs to loop through all.
}
value = " ";
value = " ";
}
false, false);
if (component instanceof JComponent) {
}
}
else {
}
if (baseline > 0) {
}
}
return baseline;
}
/**
* Returns an enum indicating how the baseline of the component
* changes as the size changes.
*
* @throws NullPointerException {@inheritDoc}
* @see javax.swing.JComponent#getBaseline(int, int)
* @since 1.6
*/
JComponent c) {
super.getBaselineResizeBehavior(c);
// Force sameBaseline to be updated.
if (comboBox.isEditable()) {
return editor.getBaselineResizeBehavior();
}
else if (sameBaseline) {
renderer = new DefaultListCellRenderer();
}
if (prototypeValue != null) {
}
// Note, we're assuming the baseline is the same for all
// cells, if not, this needs to loop through all.
}
false, false);
return component.getBaselineResizeBehavior();
}
}
}
// This is currently hacky...
if ( comboBox.isEditable() ) {
return 2;
}
else {
return 1;
}
}
// This is currently hacky...
// 0 = the popup
// 1 = the editor
switch ( i ) {
case 0:
if ( popup instanceof Accessible ) {
return(Accessible) popup;
}
break;
case 1:
if ( comboBox.isEditable()
&& (editor instanceof Accessible) ) {
return(Accessible) editor;
}
break;
}
return null;
}
//
// end ComponentUI Implementation
//===============================
//======================
// begin Utility Methods
//
/**
* Returns whether or not the supplied keyCode maps to a key that is used for
* navigation. This is used for optimizing key input by only passing non-
* navigation keys to the type-ahead mechanism. Subclasses should override this
* if they change the navigation keys.
*/
}
return true;
}
return false;
}
/**
* Selects the next item in the list. It won't change the selection if the
* currently selected item is already the last item.
*/
protected void selectNextPossibleValue() {
int si;
if ( comboBox.isPopupVisible() ) {
}
else {
}
if ( !isTableCellEditor ) {
}
}
}
}
/**
* Selects the previous item in the list. It won't change the selection if the
* currently selected item is already the first item.
*/
protected void selectPreviousPossibleValue() {
int si;
if ( comboBox.isPopupVisible() ) {
}
else {
}
if ( si > 0 ) {
if ( !isTableCellEditor ) {
}
}
}
}
/**
* Hides the popup if it is showing and shows the popup if it is hidden.
*/
protected void toggleOpenClose() {
}
/**
* Returns the area that is reserved for drawing the currently selected item.
*/
if ( arrowButton != null ) {
}
}
else {
}
}
/**
* Gets the insets from the JComboBox.
*/
}
//
// end Utility Methods
//====================
//===============================
// begin Painting Utility Methods
//
/**
* Paints the currently selected item.
*/
Component c;
-1,
true,
false );
}
else {
-1,
false,
false );
}
}
else {
}
else {
}
}
// Fix for 4238829: should lay out the JPanel.
boolean shouldValidate = false;
if (c instanceof JPanel) {
shouldValidate = true;
}
}
}
/**
* Paints the background of the currently selected item.
*/
"ComboBox.background", null));
else
"ComboBox.disabledBackground", null));
g.setColor(t);
}
/**
* Repaint the currently selected item.
*/
void repaintCurrentValue() {
}
//
// end Painting Utility Methods
//=============================
//===============================
// begin Size Utility Methods
//
/**
* Return the default size of an empty display area of the combo box using
* the current renderer and font.
*
* @return the size of an empty display area
* @see #getDisplaySize
*/
// Calculates the height and width using the default text renderer
Dimension d = getSizeForComponent(getDefaultListCellRenderer().getListCellRendererComponent(listBox, " ", -1, false, false));
}
/**
* Returns the calculated size of the display area. The display area is the
* portion of the combo box in which the selected item is displayed. This
* method will use the prototype display value if it has been set.
* <p>
* For combo boxes with a non trivial number of items, it is recommended to
* use a prototype display value to significantly speed up the display
* size calculation.
*
* @return the size of the display area calculated from the combo box items
* @see javax.swing.JComboBox#setPrototypeDisplayValue
*/
if (!isDisplaySizeDirty) {
return new Dimension(cachedDisplaySize);
}
renderer = new DefaultListCellRenderer();
}
sameBaseline = true;
if (prototypeValue != null) {
// Calculates the dimension based on the prototype value
-1, false, false));
} else {
// Calculate the dimension by iterating over all the elements in the combo
// box list.
int baseline = -1;
Dimension d;
if (modelSize > 0 ) {
for (int i = 0; i < modelSize ; i++ ) {
// Calculates the maximum height and width based on the largest
// element
d = getSizeForComponent(c);
if (newBaseline == -1) {
sameBaseline = false;
}
else if (baseline == -1) {
}
else if (baseline != newBaseline) {
sameBaseline = false;
}
}
}
} else {
result = getDefaultSize();
if (comboBox.isEditable()) {
}
}
}
if ( comboBox.isEditable() ) {
}
// calculate in the padding
}
// Set the cached value
isDisplaySizeDirty = false;
return result;
}
/**
* Returns the size a component would have if used as a cell renderer.
*
* @param comp a {@code Component} to check
* @return size of the component
* @since 1.7
*/
// This has been refactored out in hopes that it may be investigated and
// the component to the currentValuePane and changing the font may be
// redundant operations.
return d;
}
//
// end Size Utility Methods
//=============================
//=================================
// begin Keyboard Action Management
//
/**
* Adds keyboard actions to the JComboBox. Actions on enter and esc are already
* supplied. Add more actions as you need them.
*/
protected void installKeyboardActions() {
"ComboBox.actionMap");
}
"ComboBox.ancestorInputMap");
}
return null;
}
boolean isTableCellEditor() {
return isTableCellEditor;
}
/**
* Removes the focus InputMap and ActionMap.
*/
protected void uninstallKeyboardActions() {
}
//
// Actions
//
super(name);
}
comboBox.setPopupVisible(false);
}
} else {
}
}
}
if ( comboBox.isPopupVisible() ) {
}
} else {
comboBox.setPopupVisible(true);
}
}
}
// Special case in which pressing the arrow keys will not
// make the popup appear - except for editable combo boxes
// and combo boxes inside a table.
if ( (comboBox.isEditable() ||
&& !comboBox.isPopupVisible() ) {
comboBox.setPopupVisible(true);
} else {
}
}
}
}
if ( ui.isTableCellEditor() ) {
// Forces the selection of the list item if the
// combo box is in a JTable.
getSelectedIndex());
}
else {
}
}
}
}
"ComboBox.showPopupOnNavigation", false)) {
}
}
}
// Special case in which pressing the arrow keys will not
// make the popup appear - except for editable combo boxes.
comboBox.setPopupVisible(true);
} else {
}
}
}
if (comboBox.isPopupVisible()) {
// If ComboBox.noActionOnKeyNavigation is set,
// forse selection of list item
}
comboBox.setPopupVisible(false);
} else {
// Forces the selection of the list item
boolean isEnterSelectablePopup =
|| ui.isTableCellEditor) {
// Use the selected value from popup
// to set the selected item in combo box,
// but ensure before that JComboBox.actionPerformed()
// won't use editor's value to set the selected item
}
}
comboBox.setPopupVisible(false);
}
}
else {
// Hide combo box if it is a table cell editor
}
// Call the default button binding.
// This is a pretty messy way of passing an event through
// to the root pane.
e.getWhen(), e.getModifiers()));
}
}
}
}
}
}
}
}
}
}
return 0;
}
}
return comboBox.getSelectedIndex();
}
}
return true;
}
}
//
// end Keyboard Action Management
//===============================
//
// Shared Handler, implements all listeners
//
//
// PropertyChangeListener
//
// If the border of the editor changes then this can effect
// the size of the editor which can cause the combo's size to
// become invalid so we need to clear size caches
isMinimumSizeDirty = true;
isDisplaySizeDirty = true;
}
} else {
if ( propertyName == "model" ) {
}
}
}
isMinimumSizeDirty = true;
isDisplaySizeDirty = true;
}
addEditor();
}
else if ( propertyName == "editable" ) {
if ( comboBox.isEditable() ) {
comboBox.setRequestFocusEnabled( false );
addEditor();
} else {
comboBox.setRequestFocusEnabled( true );
removeEditor();
}
}
else if ( propertyName == "enabled" ) {
if ( arrowButton != null )
}
else if ( propertyName == "focusable" ) {
if ( arrowButton != null )
}
else if ( propertyName == "maximumRowCount" ) {
if ( isPopupVisible( comboBox ) ) {
setPopupVisible(comboBox, false);
setPopupVisible(comboBox, true);
}
}
else if ( propertyName == "font" ) {
}
isMinimumSizeDirty = true;
isDisplaySizeDirty = true;
}
}
}
else if (propertyName == "prototypeDisplayValue") {
isMinimumSizeDirty = true;
isDisplaySizeDirty = true;
}
else if (propertyName == "renderer") {
isMinimumSizeDirty = true;
isDisplaySizeDirty = true;
}
}
}
//
// KeyListener
//
// This listener checks to see if the key event isn't a navigation
// key. If it finds a key event that wasn't a navigation key it
// dispatches it to JComboBox.selectWithKeyChar() so that it can do
// type-ahead.
lastTime = 0L;
e.consume();
}
}
}
}
}
}
//
// FocusListener
//
// NOTE: The class is added to both the Editor and ComboBox.
// The combo box listener hides the popup when the focus is lost.
// It also repaints when focus is gained or lost.
if ( (comboBoxEditor != null) &&
return;
}
hasFocus = true;
}
}
}
}
hasFocus = false;
if (!e.isTemporary()) {
setPopupVisible(comboBox, false);
}
}
//
// ListDataListener
//
// This listener watches for changes in the ComboBoxModel
isMinimumSizeDirty = true;
}
// set the editor with the selected item since this
// is the event handler for a selected item change.
comboBox.getSelectedItem() );
}
isDisplaySizeDirty = true;
}
contentsChanged( e );
}
contentsChanged( e );
}
//
// LayoutManager
//
// This layout manager handles the 'standard' layout of combo boxes.
// It puts the arrow button to the right and the editor to the left.
// If there is no editor it still keeps the arrow button to the right.
return parent.getPreferredSize();
}
return parent.getMinimumSize();
}
int buttonWidth = buttonHeight;
if (arrowButton != null) {
}
if (arrowButton != null) {
} else {
}
}
}
}
//
// ActionListener
//
// Fix for 4515752: Forward the Enter pressed on the
// editable combo box to the default button
// Note: This could depend on event ordering. The first ActionEvent
// from the editor may be handled by the JComboBox in which case, the
// enterPressed action will always be invoked.
}
evt.getModifiers()));
}
}
}
}
}
if (lastTime == 0L) {
prefix = "";
typedString = "";
}
boolean startingFromSelection = true;
typedString += aKey;
// Subsequent same key presses move the keyboard focus to the next
// object that starts with the same letter.
startIndex++;
} else {
}
} else {
startIndex++;
}
startingFromSelection = false;
startIndex = 0;
}
}
return index;
}
}
}