Class ColumnDataComboBox

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox<uk.ac.starlink.table.ColumnData>
uk.ac.starlink.topcat.ColumnDataComboBox
All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener

public class ColumnDataComboBox extends JComboBox<uk.ac.starlink.table.ColumnData>
JComboBox suitable for use with a ColumnComboBoxModel. It installs (and deinstalls as appropriate) ComboBoxEditors which allow for textual expressions to be interpreted as JEL expressions based on the TopcatModel on which this model is based. This facility is only available/useful in the case that the combo box is editable; so the returned combo box is editable. Currently no default renderer is required or installed.
Since:
7 Apr 2020
Author:
Mark Taylor
See Also:
  • Constructor Details

    • ColumnDataComboBox

      public ColumnDataComboBox()
      Constructs a domain-less selector.
    • ColumnDataComboBox

      public ColumnDataComboBox(uk.ac.starlink.table.Domain<?> domain)
      Constructs a selector with a given target value domain.
      Parameters:
      domain - required value domain
  • Method Details

    • getDomainMapperSelector

      public DomainMapperComboBox getDomainMapperSelector()
      Returns a component that should be presented to the user for selecting domain mapper alongside the input value selector. This method returns non-null only if there is a material choice to be made; if there's only one option, null is returned.
      Returns:
      domain mapper selector component, or null
    • setModel

      public void setModel(ComboBoxModel<uk.ac.starlink.table.ColumnData> model)
      Overrides:
      setModel in class JComboBox<uk.ac.starlink.table.ColumnData>
    • getDomainMapper

      public uk.ac.starlink.table.DomainMapper getDomainMapper()
      Returns the currently selected DomainMapper. This may have been actively selected by the user, or may be the only option. If no guess can be made about what mapper to use, including if no domain has been specified, the return value may be null.
      Returns:
      selected domain mapper
    • addActionListener

      public void addActionListener(ActionListener listener)
      Overrides:
      addActionListener in class JComboBox<uk.ac.starlink.table.ColumnData>
    • removeActionListener

      public void removeActionListener(ActionListener listener)
      Overrides:
      removeActionListener in class JComboBox<uk.ac.starlink.table.ColumnData>