001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.gui.widgets; 003 004import javax.swing.plaf.basic.BasicComboBoxEditor; 005 006/** 007 * A {@link javax.swing.ComboBoxEditor} that uses an {@link JosmTextField}. 008 * <p> 009 * This lets us stick a {@code JosmTextField} into a {@link javax.swing.JComboBox}. 010 * Used in {@link JosmComboBox}. 011 * 012 * @since 18221 013 */ 014public class JosmComboBoxEditor extends BasicComboBoxEditor { 015 016 @Override 017 protected JosmTextField createEditorComponent() { 018 return new JosmTextField(); 019 } 020 021 @Override 022 public JosmTextField getEditorComponent() { 023 // this cast holds unless somebody overrides createEditorComponent() 024 return (JosmTextField) editor; 025 } 026}