Class DFFieldPickListCapability

  • All Implemented Interfaces:
    DFCapability

    public final class DFFieldPickListCapability
    extends java.lang.Object
    implements DFCapability
    This capability allows to specify a pick list values (dictionary) for the specific field. It is an extension of DFField. This list can be used during editing values, inserting new rows and querying the database. Pick list capability is expected to be used with Integer and Text fields. It doesn't have much meaning for field types like binary, etc.. There are several ways how pick list values can be provided. The chosen way is determined by setting the DFFieldPickListCapability.PickListType. The DFFieldPickListCapability.PickListType.NOT_USED type means that the field supports a pick list, but the feature is currently switched off. For detailed description of other available types please see DFFieldPickListCapability.PickListType documentation.
    This class also provides the list of values loading ability. To load all values of the selected type use getAll(). There are also a few related utility methods - for example for filtering values (filterActiveOrObsoleted(com.google.common.collect.ImmutableList, boolean) or filter(com.google.common.collect.ImmutableList, java.lang.String)), loading existing the field values, parsing from text.
    For the client code which doesn't need to configure this DFFieldPickListCapability settings, but only want to use it, it's necessary to call something like:
     DFField field = ...
     DFFieldPickListCapability picklist = DFFieldPickListCapability.getPickListIfUsed(field);
     ImmutableList<Item> values = picklist.getAll().get();
     
    Of course this example is loading the values synchronously, which means it can be blocked for some time (if the values are loaded from web service or database for example). Use Future capabilities to prevent blocking call.
    See also a utility method for obtaining DFFieldPickListCapability from DFField: getPickListIfUsed(com.im.df.api.ddl.DFField)
    Since:
    6.3
    Author:
    Petr Hamernik