Class FWFormComponentTemplates
java.lang.Object
net.simplace.sim.util.FWFormComponentTemplates
Factory methods creating JDOM elements of form components (form XML) for generated forms.
Attributes given as
null are omitted.- Author:
- aenders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jdom2.ElementcreateBooleanElement(String aID, String aDescription, String aDefault, String aEnabled, String aRequired, String aVisible) Creates a choice with the optionstrueandfalse.static final org.jdom2.ElementcreateChoiceElement(String aID, String aDescription, boolean aMultiselect, LinkedHashMap<String, String> aOptionsMap, String aDefault, String aEnabled, String aRequired, String aVisible) Creates a non-localised choice with oneoptionper map entry.static org.jdom2.ElementcreateDateElement(String aID, String aDescription, String aDefault, String aEnabled, String aRequired, String aPrecision, String aMinValue, String aMaxValue, String aVisible) static final org.jdom2.ElementcreateDoubleElement(String aID, String aDescription, String aMin, String aMax, Integer aPrecision, String aDefault, String aEnabled, String aRequired, String aVisible) static final org.jdom2.ElementcreateFileElement(String aID, String aDescription, String aDefault, String aEnabled, String aRequired, String aVisible) static org.jdom2.ElementcreateFormElement(String aName) static final org.jdom2.ElementcreateGroupElement(String aID, String aDescription, String aEnabled, String aVisible, String aDetachable) static final org.jdom2.ElementcreateIntegerElement(String aID, String aDescription, Integer aMin, Integer aMax, String aDefault, String aEnabled, String aRequired, String aVisible) static final org.jdom2.ElementcreateLabelElement(String tID, String tText) static final org.jdom2.ElementcreateTableElement(String tID) static final org.jdom2.ElementcreateTextElement(String aID, String aDescription, int aMaxlength, String aRegexp, String aDefault, String aEnabled, String aRequired, String aVisible)
-
Constructor Details
-
FWFormComponentTemplates
public FWFormComponentTemplates()
-
-
Method Details
-
createLabelElement
-
createTextElement
public static final org.jdom2.Element createTextElement(String aID, String aDescription, int aMaxlength, String aRegexp, String aDefault, String aEnabled, String aRequired, String aVisible) - Parameters:
aID- id of the componentaDescription- description (attributetitle)aMaxlength- maximum length of the textaRegexp- regular expression for the inputaDefault- default valueaEnabled- enabled ruleaRequired- required ruleaVisible- visible rule- Returns:
- text Element
-
createFileElement
public static final org.jdom2.Element createFileElement(String aID, String aDescription, String aDefault, String aEnabled, String aRequired, String aVisible) - Parameters:
aID- id of the componentaDescription- description (attributetitle)aDefault- default fileaEnabled- enabled ruleaRequired- required ruleaVisible- visible rule- Returns:
- file Element
-
createChoiceElement
public static final org.jdom2.Element createChoiceElement(String aID, String aDescription, boolean aMultiselect, LinkedHashMap<String, String> aOptionsMap, String aDefault, String aEnabled, String aRequired, String aVisible) Creates a non-localised choice with oneoptionper map entry.- Parameters:
aID- id of the componentaDescription- description (attributetitle)aMultiselect- whether several options can be selectedaOptionsMap- options: key is id and value, value is the labelaDefault- default optionaEnabled- enabled ruleaRequired- required ruleaVisible- visible rule- Returns:
- choice Element
-
createIntegerElement
public static final org.jdom2.Element createIntegerElement(String aID, String aDescription, Integer aMin, Integer aMax, String aDefault, String aEnabled, String aRequired, String aVisible) - Parameters:
aID- id of the componentaDescription- description (attributetitle)aMin- minimum value, ornullaMax- maximum value, ornullaDefault- default valueaEnabled- enabled ruleaRequired- required ruleaVisible- visible rule- Returns:
- integer Element
-
createDoubleElement
public static final org.jdom2.Element createDoubleElement(String aID, String aDescription, String aMin, String aMax, Integer aPrecision, String aDefault, String aEnabled, String aRequired, String aVisible) - Parameters:
aID- id of the componentaDescription- description (attributetitle)aMin- minimum value, ornullaMax- maximum value, ornullaPrecision- number of decimal places, ornullaDefault- default valueaEnabled- enabled ruleaRequired- required ruleaVisible- visible rule- Returns:
- double Element
-
createBooleanElement
public static org.jdom2.Element createBooleanElement(String aID, String aDescription, String aDefault, String aEnabled, String aRequired, String aVisible) Creates a choice with the optionstrueandfalse.- Parameters:
aID- id of the componentaDescription- description (attributetitle)aDefault- default value (true/false)aEnabled- enabled ruleaRequired- required ruleaVisible- visible rule- Returns:
- boolean (choice) Element
-
createDateElement
public static org.jdom2.Element createDateElement(String aID, String aDescription, String aDefault, String aEnabled, String aRequired, String aPrecision, String aMinValue, String aMaxValue, String aVisible) - Parameters:
aID- id of the componentaDescription- description (attributetitle)aDefault- default dateaEnabled- enabled ruleaRequired- required ruleaPrecision- precision of the date (e.g. year, month, day)aMinValue- earliest date, ornullaMaxValue- latest date, ornullaVisible- visible rule- Returns:
- date Element
-
createGroupElement
public static final org.jdom2.Element createGroupElement(String aID, String aDescription, String aEnabled, String aVisible, String aDetachable) - Parameters:
aID- id of the groupaDescription- description (attributetitle)aEnabled- enabled ruleaVisible- visible ruleaDetachable- detachability of the group, ornull- Returns:
- group Element
-
createTableElement
- Parameters:
tID- id of the table- Returns:
- table Element (id only)
-
createFormElement
- Parameters:
aName- id of the form- Returns:
- the form Element
-