java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox
org.gvsig.app.project.documents.layout.fframes.gui.numberFormat.CharComboBox
All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener

public class CharComboBox extends JComboBox
This is is a customized JComboBox used to select a single character. It has the following properties:
  • it is editable
  • only allows a single char (if more chars are introduced, the string is trimmed to the first character
  • optionally, it can show a special item (NoneItem) that represents that no character wants to be selected.
Author:
Cesar Martinez Izquierdo
See Also:
  • Constructor Details

    • CharComboBox

      public CharComboBox(String[] items, boolean showNoneItem)
    • CharComboBox

      public CharComboBox()
  • Method Details

    • getSelectedItem

      public String getSelectedItem()
      Returns the selected char or the NoneItem string.
      Overrides:
      getSelectedItem in class JComboBox
      See Also:
    • addItem

      public void addItem(Object obj)
      Overrides:
      addItem in class JComboBox
    • setNoneItem

      public void setNoneItem(String text)
      Sets the text to show as the NoneItem. The text has to be provided in its localized form (if translations are in use).
      Parameters:
      text - The localized text to show as the NoneItem
    • getNoneItem

      public String getNoneItem()
      This item represents that no item is selected