Class BaseXCombo

All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener
Direct Known Subclasses:
GUIInput

public class BaseXCombo extends JComboBox<Object>
Project specific ComboBox implementation.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
See Also:
  • Constructor Details

    • BaseXCombo

      public BaseXCombo(BaseXWindow win, NumberOption option, Options options, String... values)
      Constructor.
      Parameters:
      win - parent window
      option - numeric value
      options - options
      values - combobox values
    • BaseXCombo

      public BaseXCombo(BaseXWindow win, BooleanOption option, Options options)
      Constructor.
      Parameters:
      win - parent window
      option - boolean value
      options - options
    • BaseXCombo

      public BaseXCombo(BaseXWindow win, EnumOption<?> option, Options options)
      Constructor.
      Parameters:
      win - parent window
      option - enum value
      options - options
    • BaseXCombo

      public BaseXCombo(BaseXWindow win, String... values)
      Constructor.
      Parameters:
      win - parent window
      values - combobox values
    • BaseXCombo

      public BaseXCombo(BaseXWindow win, boolean editable, String... values)
      Constructor.
      Parameters:
      win - parent window
      editable - editable flag
      values - combobox values
  • Method Details

    • history

      public final BaseXCombo history(StringsOption opt, Options opts)
      Attaches a history and enables a listener for cursor down/up keys.
      Parameters:
      opt - strings option
      opts - options
      Returns:
      self reference
    • hint

      public BaseXCombo hint(String label)
      Adds a hint to the text field.
      Parameters:
      label - text of the hint
      Returns:
      self reference
    • setFont

      public void setFont(Font font)
      Overrides:
      setFont in class JComponent
    • setItems

      public void setItems(String... items)
      Sets the specified items.
      Parameters:
      items - items
    • updateHistory

      public void updateHistory()
      Stores the current history and refreshes the selectable items.
    • getText

      public String getText()
      Returns the current text.
      Returns:
      text
    • setText

      public void setText(String text)
      Sets the current text.
      Parameters:
      text - text to be assigned
    • getSelectedItem

      public String getSelectedItem()
      Overrides:
      getSelectedItem in class JComboBox<Object>
    • textField

      public BaseXTextField textField()
      Returns the editor text field, or null if the combobox is not editable.
      Returns:
      text field
    • setSelectedItem

      public void setSelectedItem(Object object)
      Overrides:
      setSelectedItem in class JComboBox<Object>
    • highlight

      public void highlight(boolean hits)
      Highlights the text field.
      Parameters:
      hits - hits
    • getKeyListeners

      public KeyListener[] getKeyListeners()
      Overrides:
      getKeyListeners in class Component
    • addKeyListener

      public void addKeyListener(KeyListener l)
      Overrides:
      addKeyListener in class Component
    • removeKeyListener

      public void removeKeyListener(KeyListener l)
      Overrides:
      removeKeyListener in class Component
    • addFocusListener

      public void addFocusListener(FocusListener l)
      Overrides:
      addFocusListener in class Component
    • removeFocusListener

      public void removeFocusListener(FocusListener l)
      Overrides:
      removeFocusListener in class Component
    • assign

      public void assign()
      Assigns the current checkbox value to the option specified in the constructor.