Package de.xima.fc.form.common.models
Interface IXDataSourceOptions
-
- All Known Implementing Classes:
XSelect
public interface IXDataSourceOptions
Interface that may be implemented by anXItem
, usually by custom widgets that extendXSelect
. By default, the user can choose one of the available data sources for a select item in the Designer, but only when the data source has not got any parameters. By implementing this interface, the user may select data sources with a certain amount of parameters.- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,List<org.apache.commons.lang3.Range<Integer>>>
getAllowedDataSourceParameterCount()
Use this method to indicate how many parameters each data source type must have in order to be selectable.
-
-
-
Method Detail
-
getAllowedDataSourceParameterCount
Map<String,List<org.apache.commons.lang3.Range<Integer>>> getAllowedDataSourceParameterCount()
Use this method to indicate how many parameters each data source type must have in order to be selectable. For example, the default XSelect form element lets the user select CSV, DB and PLUGIN data sources with no parameters:@Override public Map<String, List<Range<Integer>>> getAllowedDataSourceParameterCount() { final Map<String, List<Range<Integer>>> ranges = new HashMap<>(); ranges.put(EDatasource.CSV.name(), Arrays.asList(Range.is(0))); ranges.put(EDatasource.DB.name(), Arrays.asList(Range.is(0))); ranges.put(EDatasource.PLUGIN.name(), Arrays.asList(Range.is(0))); return ranges; }
- Returns:
- A map between each data source type as the key and a list of allowed parameter counts (inclusive range)
as the value. When
null
is returned, the defaults (which may change) are used. When a key for a data source type is missing or is mapped tonull
, no data sources of that type are selectable.
-
-