Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## echopointng
Class ComboBox

    java.lang.Object
      nextapp.echo2.app.Component
          echopointng.ComponentEx
              echopointng.AbleComponent
                  echopointng.PopUp
                      echopointng.DropDown
                          echopointng.ComboBox

All Implemented Interfaces:
  AccessKeyable, Attributeable, Borderable, Delegateable, Expandable, Heightable, Insetable, MouseCursorable, Sizeable, ToolTipable, Widthable, java.io.Serializable, RenderIdSupport

    public class ComboBox

extends DropDown

The `ComboBox` component is a TextField that acts like a SelectField as well. It will present a list of choices to the user (like a SelectField) that can be auto-matched as the user types in key strokes.

The `ComboBox` has a drop down button that when pressed will toggle the display of a list of choices, which the user can then select from.

The `ComboBox` can be set to remember which values have been entered and add them to its internal ListModel. This can happen if the ListModel is an instanceof DefaultListModel and hence has an add() method. This behaviour is off by default, but can be switched on via the setAutoRecall() method.

See Also:
  Serialized Form

Field Summary
`static Style` | `DEFAULT_TEXT_FIELD_STYLE` The default appearance of the TextField component within the ComboBox Borderless so that the text field appears part of the larger control
`static java.lang.String` | `PROPERTY_ACTION_ON_SELECTION`
`static java.lang.String` | `PROPERTY_AUTO_RECALL`
`static java.lang.String` | `PROPERTY_AUTO_RECALL_LIMIT`
`static java.lang.String` | `PROPERTY_CASE_SENSITIVE`
`static java.lang.String` | `PROPERTY_LIST_ROWCOUNT`
`static java.lang.String` | `PROPERTY_TEXT_MATCHING`
`static java.lang.String` | `PROPERTY_TEXTFIELD_DOCUMENT`
`static java.lang.String` | `PROPERTY_TEXTFIELD_EDITABLE`

Fields inherited from class echopointng.DropDown
`DEFAULT_ALIGNMENT, DEFAULT_STYLE`

Fields inherited from class echopointng.PopUp
`DEFAULT_TOGGLE_ICON, DEFAULT_TOGGLE_PRESSED_ICON, DEFAULT_TOGGLE_ROLLOVER_ICON, PROPERTY_POPUP, PROPERTY_POPUP_ALIGNMENT, PROPERTY_POPUP_ALWAYS_ON_TOP, PROPERTY_POPUP_BACKGROUND, PROPERTY_POPUP_BORDER, PROPERTY_POPUP_INSETS, PROPERTY_POPUP_LEFT_OFFSET, PROPERTY_POPUP_NEXT_TO_TOGGLE, PROPERTY_POPUP_ON_ROLLOVER, PROPERTY_POPUP_OUTSETS, PROPERTY_POPUP_TOP_OFFSET, PROPERTY_ROLLOVER_BACKGROUND, PROPERTY_ROLLOVER_BORDER, PROPERTY_ROLLOVER_ENABLED, PROPERTY_TARGET, PROPERTY_TARGET_BACKGROUND, PROPERTY_TARGET_BORDER, PROPERTY_TARGET_INSETS, PROPERTY_TARGET_ROLLOVER_BACKGROUND, PROPERTY_TARGET_ROLLOVER_BORDER, PROPERTY_TOGGLE_BACKGROUND, PROPERTY_TOGGLE_BORDER, PROPERTY_TOGGLE_ICON, PROPERTY_TOGGLE_INSETS, PROPERTY_TOGGLE_PRESSED_BACKGROUND, PROPERTY_TOGGLE_PRESSED_BORDER, PROPERTY_TOGGLE_PRESSED_ENABLED, PROPERTY_TOGGLE_PRESSED_ICON, PROPERTY_TOGGLE_ROLLOVER_BACKGROUND, PROPERTY_TOGGLE_ROLLOVER_BORDER, PROPERTY_TOGGLE_ROLLOVER_ICON`

Fields inherited from class echopointng.ComponentEx
`PROPERTY_HIDDEN`

Fields inherited from class nextapp.echo2.app.Component
`CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY`

Fields inherited from interface echopointng.able.Expandable
`EXPANDED_CHANGED_PROPERTY, PROPERTY_EXPANSION_GROUP, PROPERTY_EXPANSION_MODEL`

Fields inherited from interface echopointng.able.AccessKeyable
`PROPERTY_ACCESS_KEY`

Fields inherited from interface echopointng.able.Borderable
`PROPERTY_BORDER`

Fields inherited from interface echopointng.able.MouseCursorable
`CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, PROPERTY_MOUSE_CURSOR, PROPERTY_MOUSE_CURSOR_URI`

Fields inherited from interface echopointng.able.Insetable
`DEFAULT_INSETS, DEFAULT_OUTSETS, PROPERTY_INSETS, PROPERTY_OUTSETS`

Fields inherited from interface echopointng.able.Widthable
`PROPERTY_WIDTH`

Fields inherited from interface echopointng.able.Heightable
`PROPERTY_HEIGHT`

Fields inherited from interface echopointng.able.ToolTipable
`PROPERTY_TOOL_TIP_TEXT`

Constructor Summary
`ComboBox()` Creates a `ComboBox`
`ComboBox(int columns)` Creates a `ComboBox` that is columns wide.
`ComboBox(java.lang.Object[] list)` Creates a `ComboBox` with `list` as the initial list contents.
`ComboBox(java.lang.String text)` Creates a `ComboBox` with `text` as the initial value.
`ComboBox(java.lang.String text, int columns, java.lang.Object[] list)` Creates a `ComboBox` with `text` as the initial value and that is `columns` wide and `list` as the initial list contents.
`ComboBox(java.lang.String text, java.lang.Object[] list)` Creates a `ComboBox` with `text` as the initial value and `list` as the initial list contents.

Method Summary
`void` | `addActionListener(ActionListener l)` Adds an `ActionListener` to the ComboBox component.
`int` | `getAutoRecallLimit()` Returns the auto recall limit
`ListCellRenderer` | `getListCellRenderer()` Returns the renderer for items.
`ListModel` | `getListModel()` Returns the list model for items.
`int` | `getListRowCount()` Returns the number of visible rows in the drop-down list
`java.lang.String` | `getText()`
`TextField` | `getTextField()` Returns the text field component of the combobox
`boolean` | `hasActionListeners()` Determines the any `ActionListener`s are registered.
`boolean` | `isActionOnSelection()` Indicates whether a server action is done when the list selection changes.
`boolean` | `isAutoRecall()` Returns true if auto recall is in effect
`boolean` | `isCaseSensitive()` Indicates whether text matching is case sensitive.
`boolean` | `isTextMatchingPerformed()` Returns true if text matching is performed
`void` | `removeActionListener(ActionListener l)` Removes an `ActionListener` from the `TextField`.
`void` | `setActionOnSelection(boolean newValue)` Controls whether a server action is done when the list selection changes.
`void` | `setAutoRecall(boolean newValue)` Controls whether auto recall is in effect.
`void` | `setAutoRecallLimit(int newValue)` Sets how many entries will be automatically recalled.
`void` | `setCaseSensitive(boolean newValue)` Controls whether text matching is case sensitive.
`void` | `setListCellRenderer(ListCellRenderer newValue)` Sets the renderer for items.
`void` | `setListModel(ListModel newValue)` Sets the list model.
`void` | `setListRowCount(int newValue)` Sets the visible row count for the drop-down list.
`void` | `setText(java.lang.String newValue)`
`void` | `setTextField(TextField newValue)` Assigns a new text field to the combo box
`void` | `setTextMatchingPerformed(boolean newValue)` Controls whether text matching is performed as the user types in the text field.
`void` | `validate()` A life-cycle method invoked before the component is rendered to ensure it is in a valid state.

Methods inherited from class echopointng.PopUp
`getExpansionGroup, getExpansionModel, getPopUp, getPopUpAlignment, getPopUpAlwaysOnTop, getPopUpBackground, getPopUpBorder, getPopUpInsets, getPopUpLeftOffset, getPopUpOutsets, getPopUpTopOffset, getRolloverBackground, getRolloverBorder, getTarget, getTargetBackground, getTargetBorder, getTargetInsets, getTargetRolloverBackground, getTargetRolloverBorder, getToggleBackground, getToggleBorder, getToggleIcon, getToggleInsets, getTogglePressedBackground, getTogglePressedBorder, getTogglePressedIcon, getToggleRolloverBackground, getToggleRolloverBorder, getToggleRolloverIcon, isExpanded, isPopUpNextToToggle, isPopUpOnRollover, isRolloverEnabled, isTogglePressedEnabled, processInput, setExpanded, setExpansionGroup, setExpansionModel, setPopUp, setPopUpAlignment, setPopUpAlwaysOnTop, setPopUpBackground, setPopUpBorder, setPopUpInsets, setPopUpLeftOffset, setPopUpNextToToggle, setPopUpOnRollover, setPopUpOutsets, setPopUpTopOffset, setRolloverBackground, setRolloverBorder, setRolloverEnabled, setTarget, setTargetBackground, setTargetBorder, setTargetInsets, setTargetRolloverBackground, setTargetRolloverBorder, setToggleBackground, setToggleBorder, setToggleIcon, setToggleInsets, setTogglePressedBackground, setTogglePressedBorder, setTogglePressedEnabled, setTogglePressedIcon, setToggleRolloverBackground, setToggleRolloverBorder, setToggleRolloverIcon`

Methods inherited from class echopointng.AbleComponent
`getAccessKey, getBorder, getHeight, getInsets, getMouseCursor, getMouseCursorURI, getOutsets, getToolTipText, getWidth, setAccessKey, setBorder, setHeight, setInsets, setMouseCursor, setMouseCursorURI, setOutsets, setToolTipText, setWidth`

Methods inherited from class echopointng.ComponentEx
`getAttribute, getAttributeNames, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, isHidden, setAttribute, setHidden, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty`

Methods inherited from class nextapp.echo2.app.Component
`add, add, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setStyle, setStyleName, setVisible, verifyInput, visibleIndexOf`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Field Detail

### PROPERTY_ACTION_ON_SELECTION

    public static final java.lang.String PROPERTY_ACTION_ON_SELECTION

See Also:
  Constant Field Values

### PROPERTY_AUTO_RECALL

    public static final java.lang.String PROPERTY_AUTO_RECALL

See Also:
  Constant Field Values

### PROPERTY_AUTO_RECALL_LIMIT

    public static final java.lang.String PROPERTY_AUTO_RECALL_LIMIT

See Also:
  Constant Field Values

### PROPERTY_CASE_SENSITIVE

    public static final java.lang.String PROPERTY_CASE_SENSITIVE

See Also:
  Constant Field Values

### PROPERTY_LIST_ROWCOUNT

    public static final java.lang.String PROPERTY_LIST_ROWCOUNT

See Also:
  Constant Field Values

### PROPERTY_TEXT_MATCHING

    public static final java.lang.String PROPERTY_TEXT_MATCHING

See Also:
  Constant Field Values

### PROPERTY_TEXTFIELD_DOCUMENT

    public static final java.lang.String PROPERTY_TEXTFIELD_DOCUMENT

See Also:
  Constant Field Values

### PROPERTY_TEXTFIELD_EDITABLE

    public static final java.lang.String PROPERTY_TEXTFIELD_EDITABLE

See Also:
  Constant Field Values

### DEFAULT_TEXT_FIELD_STYLE

    public static final Style DEFAULT_TEXT_FIELD_STYLE

  The default appearance of the TextField component within the ComboBox Borderless so that the text field appears part of the larger control

Constructor Detail

### ComboBox

    public ComboBox()

  Creates a `ComboBox`

### ComboBox

    public ComboBox(int columns)

  Creates a `ComboBox` that is columns wide.

### ComboBox

    public ComboBox(java.lang.String text)

  Creates a `ComboBox` with `text` as the initial value.

### ComboBox

    public ComboBox(java.lang.Object[] list)

  Creates a `ComboBox` with `list` as the initial list contents.

### ComboBox

    public ComboBox(java.lang.String text,
                    java.lang.Object[] list)

  Creates a `ComboBox` with `text` as the initial value and `list` as the initial list contents.

### ComboBox

    public ComboBox(java.lang.String text,
                    int columns,
                    java.lang.Object[] list)

  Creates a `ComboBox` with `text` as the initial value and that is `columns` wide and `list` as the initial list contents.

Method Detail

### addActionListener

    public void addActionListener(ActionListener l)

  Adds an `ActionListener` to the ComboBox component. The `ActionListener` will be invoked when the user selects an item.

  Parameters:
    `l` - the `ActionListener` to add

### removeActionListener

    public void removeActionListener(ActionListener l)

  Removes an `ActionListener` from the `TextField`.

  Parameters:
    `l` - the `ActionListener` to remove

### validate

    public void validate()

  Description copied from class: `Component`
  A life-cycle method invoked before the component is rendered to ensure it is in a valid state. Default implementation is empty. Overriding implementations should ensure to invoke `super.validate()` out of convention.

  Overrides:
    `validate` in class `PopUp`
  See Also:
    `Component.validate()`

### getAutoRecallLimit

    public int getAutoRecallLimit()

  Returns the auto recall limit

  Returns:
    the auto recall limit

### getListCellRenderer

    public ListCellRenderer getListCellRenderer()

  Returns the renderer for items.

  Returns:
    The renderer for items.

### getListModel

    public ListModel getListModel()

  Returns the list model for items.

  Returns:
    The list model for items.

### getText

    public java.lang.String getText()

  See Also:
    `TextComponent.getText()`

### getListRowCount

    public int getListRowCount()

  Returns the number of visible rows in the drop-down list

  Returns:
    the number of rows

### getTextField

    public TextField getTextField()

  Returns the text field component of the combobox

  Returns:
    the textField.

### hasActionListeners

    public boolean hasActionListeners()

  Determines the any `ActionListener`s are registered.

  Returns:
    true if any action listeners are registered

### isActionOnSelection

    public boolean isActionOnSelection()

  Indicates whether a server action is done when the list selection changes.

  Returns:
    boolean

### isAutoRecall

    public boolean isAutoRecall()

  Returns true if auto recall is in effect

  Returns:
    boolean

### isCaseSensitive

    public boolean isCaseSensitive()

  Indicates whether text matching is case sensitive.

  Returns:
    boolean

### isTextMatchingPerformed

    public boolean isTextMatchingPerformed()

  Returns true if text matching is performed

  Returns:
    boolean

### setAutoRecallLimit

    public void setAutoRecallLimit(int newValue)

  Sets how many entries will be automatically recalled. If this value is < 0 then no entries will be remembered.

  Parameters:
    `newValue` - - the new limit

### setAutoRecall

    public void setAutoRecall(boolean newValue)

  Controls whether auto recall is in effect. If it is, new items typed into the text box will be added to the ListModel.

  Parameters:
    `newValue` - - True to turn on AutoRecall

### setActionOnSelection

    public void setActionOnSelection(boolean newValue)

  Controls whether a server action is done when the list selection changes. You still need to have an action listener attached, for this to occur.

  Parameters:
    `newValue` - - true or false

### setCaseSensitive

    public void setCaseSensitive(boolean newValue)

  Controls whether text matching is case sensitive.

  Parameters:
    `newValue` - - True if text matching should be case sensitive

### setListRowCount

    public void setListRowCount(int newValue)

  Sets the visible row count for the drop-down list.

  Parameters:
    `newValue` - - number of rows to show in the drop-down list

### setListCellRenderer

    public void setListCellRenderer(ListCellRenderer newValue)

  Sets the renderer for items.

  Parameters:
    `newValue` - The new renderer for items.

### setListModel

    public void setListModel(ListModel newValue)

  Sets the list model.

  Parameters:
    `newValue` - The new model.

### setText

    public void setText(java.lang.String newValue)

  See Also:
    `TextComponent.setText(java.lang.String)`

### setTextField

    public void setTextField(TextField newValue)

  Assigns a new text field to the combo box

  Parameters:
    `newValue` - - The textField to set.

### setTextMatchingPerformed

    public void setTextMatchingPerformed(boolean newValue)

  Controls whether text matching is performed as the user types in the text field. If true, then the options in the drop down list will be restricted to those the prefix match the current text field value.

  Parameters:
    `newValue` - - True if text matching is to be performed

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD