Class FWAbstractFormComponentFiller
java.lang.Object
net.simplace.pipe.filler.FWAbstractFormComponentFiller
- Direct Known Subclasses:
FWASCIIFormComponentFiller, FWClasspathFormComponentFiller, FWDatabaseFormComponentFiller, FWFilebasedFormComponentFiller, FWMapFormComponentFiller, FWSimCacheListFormComponentFiller, FWSimOutputFormComponentFiller, FWSimVariablesFormComponentFiller
Base class of form component fillers, which read data from different sources (e.g. ASCII files, a database or
the parameters) and provide dynamic content for form components: options, charts, objects or field lists.
Fillers are instantiated by class name;
initialize(Object, Map, FWObservable, String, Element) has to be
called afterwards.- Author:
- Andreas Enders
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected net.simplace.core.FWObservableparameters of the functionality, used as fallbackparameters configuring the filler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.jfree.chart.JFreeChartgenerateChart(String aKey, ChartStyle aChartStyle) protected abstract List<org.jdom2.Element> generateFieldList(String aKey) protected abstract Vector<FWFormOption> generateFormOptions(String aKey) protected abstract ObjectgenerateObject(String aKey) org.jfree.chart.JFreeChartgetChart(String aKey, ChartStyle aChartStyle) protected org.jdom2.Elementprotected ObjectList<org.jdom2.Element> getFieldList(String aKey) getFormOptions(String aKey) Returns the value generated bygenerateObject(String), converted to the requested type: from a result set the first column is read (unlessjava.sql.ResultSetis requested), strings are converted tojava.lang.Integerorjava.lang.Double, other values tojava.lang.Stringif requested.protected ObjectgetParameter(String aKey) protected StringgetStringInParameter(String aKey) protected StringgetStringParameter(String aKey) protected StringgetTitle()protected booleanprotected BooleanhasParameter(String aKey) voidinitialize(Object aContent, Map<String, Object> aParameterMap, net.simplace.core.FWObservable aObservable, String aSystemID, org.jdom2.Element aConfiguration) Initialises the filler; has to be called after instantiation by class name.protected StringreplaceParamTokens(String aKey, String aDefault) Replaces parameter tokens from the filler parameters.protected voidsetContent(Object aContent) void
-
Field Details
-
iParameterMap
-
iObervable
protected net.simplace.core.FWObservable iObervableparameters of the functionality, used as fallback
-
-
Constructor Details
-
FWAbstractFormComponentFiller
public FWAbstractFormComponentFiller()
-
-
Method Details
-
initialize
public void initialize(Object aContent, Map<String, Object> aParameterMap, net.simplace.core.FWObservable aObservable, String aSystemID, org.jdom2.Element aConfiguration) Initialises the filler; has to be called after instantiation by class name.- Parameters:
aContent- content the filler works on (e.g. a file name or an SQL statement)aParameterMap- parameters configuring the filleraObservable- parameters of the functionality, used as fallbackaSystemID- id of the system the form belongs toaConfiguration- optional configuration element, ornull
-
generateFormOptions
- Parameters:
aKey- key (id) of the form component- Returns:
- the options for a choice component, or
nullif not supported
-
generateChart
- Parameters:
aKey- key (id) of the form componentaChartStyle- style of the chart- Returns:
- the chart, or
nullif not supported
-
generateObject
-
generateFieldList
-
getContent
- Returns:
- the content
-
hasParameter
-
getStringParameter
-
getStringInParameter
-
getParameter
-
replaceParamTokens
-
setContent
- Parameters:
aContent- the content the filler works on
-
getFormOptions
- Parameters:
aKey- key (id) of the form component- Returns:
- the options for a choice component (see
generateFormOptions(String))
-
getFieldList
- Parameters:
aKey- key (id) of the form component- Returns:
- form field elements (see
generateFieldList(String))
-
getChart
- Parameters:
aKey- key (id) of the form componentaChartStyle- style of the chart- Returns:
- the chart (see
generateChart(String, ChartStyle))
-
getObject
Returns the value generated bygenerateObject(String), converted to the requested type: from a result set the first column is read (unlessjava.sql.ResultSetis requested), strings are converted tojava.lang.Integerorjava.lang.Double, other values tojava.lang.Stringif requested.- Parameters:
aKey- key (id) of the form componentaClassname- fully qualified name of the requested type, ornullfor no conversion- Returns:
- the (converted) value, or
null
-
getSystemID
- Returns:
- id of the system the form belongs to
-
getConfiguration
protected org.jdom2.Element getConfiguration()- Returns:
- the configuration element, or
null
-
hasConfiguration
protected boolean hasConfiguration()- Returns:
trueif a configuration element is set
-
getTitle
- Returns:
- the title, e.g. of a generated chart
-
setTitle
- Parameters:
aTitle- the title, e.g. of a generated chart
-