Class TablesListComboBox

All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener

public class TablesListComboBox extends JComboBox<TopcatModel>
ComboBox which tracks the current contents of the ControlWindow's list of tables.
Since:
31 Aug 2010
Author:
Mark Taylor
See Also:
  • Constructor Details

    • TablesListComboBox

      public TablesListComboBox(int maxWidth)
      Constructs a combo box with a maximum width, based on the ControlWindow's list of tables.

      There is layout magic here. The maximum width may be specified to limit the preferredSize of this component, which can be useful to stop it forcing parent components very wide in the presence of tables with long names. The maximumSize is set to the old preferredSize, so if there is space in the component anyway it will be used to render long names without truncation. To make this work out properly, this component should be laid out by some LayoutManager that respects maximumSize; note that includes BoxLayout, but not GridBagLayout.

      Parameters:
      maxWidth - absolute maximum of component size in pixels; if non-positive, there is no maximum
    • TablesListComboBox

      public TablesListComboBox(ListModel<TopcatModel> tablesList, int maxWidth)
      Constructs a combo box based on a given ListModel containing tables.
      Parameters:
      tablesList - list of TopcatModels
      maxWidth - absolute maximum of component size in pixels; if non-positive, there is no maximum
  • Method Details