public interface EditableComboBoxModel
Definition of a specialized ListModel
extension interface to be used
by editable combo boxes.
A ListModel
per default contains a mapping from display objects (to
be presented on the UI) to value objects (the application uses internally)
and vice versa. This is fine as long the user can only select an element from
a given set of available options.
For an editable combo box situation is different. Here the user can enter
arbitrary values, and therefore it is possible that there is no mapping from
the display object to a value object in the model. This extended interface
addresses this problem. It defines explicit methods for mapping from display
objects to value objects or vice versa. These methods are called if no match
in the current ListModel
is found. A concrete implementation can then
perform a transformation as it pleases.
Modifier and Type | Method and Description |
---|---|
Object |
toDisplay(Object value)
Transforms a value object to a display object.
|
Object |
toValue(Object displ)
Transforms a display object to a value object.
|
Object toDisplay(Object value)
value
- the value object to be transformedObject toValue(Object displ)
displ
- the display object to be transformedCopyright © 2016 The JGUIraffe Team. All rights reserved.