Class DropDownSelectionTextField<T>

Type Parameters:
T - The type of object that this model manipulates
All Implemented Interfaces:
GComponent, ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants
Direct Known Subclasses:
DropDownMultiSelectionTextField

public class DropDownSelectionTextField<T> extends DropDownTextField<T>
A text field that handles comparing text typed by the user to the list of objects and then presenting potential matches in a drop down window. This class differs from its parent in that it allows the user to select items from the popup list.

Usage note: Typically this text field will not be used directly, but will instead be used indirectly by way of an editor. If this field is used directly, then the user should use DropDownTextField.setSelectedValue(Object) and DropDownTextField.getSelectedValue() to get and set data on this field, rather than calling DropDownTextField.setText(String) and JTextComponent.getText().

Usage notes:

  • Pressing ENTER with the drop-down list open will select and item and close the list
  • Pressing ENTER with the drop-down list not showing will trigger an editingStopped() event, signaling that the user has made a choice
  • Pressing ESCAPE with the drop-down list open will close the list
  • Pressing ESCAPE with the drop-down list not showing will trigger an editingCancelled() event, signaling that the user has cancelled editing
See Also:
  • Constructor Details

    • DropDownSelectionTextField

      public DropDownSelectionTextField(DropDownTextFieldDataModel<T> dataModel)
    • DropDownSelectionTextField

      public DropDownSelectionTextField(DropDownTextFieldDataModel<T> dataModel, int updateMinDelay)
      This constructor allows you to control the delay between keystrokes before the items in the view get updated. A reasonable delay allows users to type multiple characters before the UI updates. For large data, this prevents the UI from feeling sluggish, since the UI is does not have to process each keystroke. For small data, the UI can update in real time, which feels responsive. The tradeoff is between feeling the most responsive vs adding a small delay to prevent apparent freezing. The default value is #DEFAULT_MIN_UPDATE_DELAY.
      Parameters:
      dataModel - the data model
      updateMinDelay - the min update delay
  • Method Details