Class FWFormComponentTemplates

java.lang.Object
net.simplace.sim.util.FWFormComponentTemplates

public final class FWFormComponentTemplates extends Object
Factory methods creating JDOM elements of form components (form XML) for generated forms. Attributes given as null are omitted.
Author:
aenders
  • Constructor Details

    • FWFormComponentTemplates

      public FWFormComponentTemplates()
  • Method Details

    • createLabelElement

      public static final org.jdom2.Element createLabelElement(String tID, String tText)
      Parameters:
      tID - id of the label
      tText - default text, or null
      Returns:
      label Element
    • 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 component
      aDescription - description (attribute title)
      aMaxlength - maximum length of the text
      aRegexp - regular expression for the input
      aDefault - default value
      aEnabled - enabled rule
      aRequired - required rule
      aVisible - 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 component
      aDescription - description (attribute title)
      aDefault - default file
      aEnabled - enabled rule
      aRequired - required rule
      aVisible - 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 one option per map entry.
      Parameters:
      aID - id of the component
      aDescription - description (attribute title)
      aMultiselect - whether several options can be selected
      aOptionsMap - options: key is id and value, value is the label
      aDefault - default option
      aEnabled - enabled rule
      aRequired - required rule
      aVisible - 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 component
      aDescription - description (attribute title)
      aMin - minimum value, or null
      aMax - maximum value, or null
      aDefault - default value
      aEnabled - enabled rule
      aRequired - required rule
      aVisible - 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 component
      aDescription - description (attribute title)
      aMin - minimum value, or null
      aMax - maximum value, or null
      aPrecision - number of decimal places, or null
      aDefault - default value
      aEnabled - enabled rule
      aRequired - required rule
      aVisible - 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 options true and false.
      Parameters:
      aID - id of the component
      aDescription - description (attribute title)
      aDefault - default value (true/false)
      aEnabled - enabled rule
      aRequired - required rule
      aVisible - 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 component
      aDescription - description (attribute title)
      aDefault - default date
      aEnabled - enabled rule
      aRequired - required rule
      aPrecision - precision of the date (e.g. year, month, day)
      aMinValue - earliest date, or null
      aMaxValue - latest date, or null
      aVisible - 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 group
      aDescription - description (attribute title)
      aEnabled - enabled rule
      aVisible - visible rule
      aDetachable - detachability of the group, or null
      Returns:
      group Element
    • createTableElement

      public static final org.jdom2.Element createTableElement(String tID)
      Parameters:
      tID - id of the table
      Returns:
      table Element (id only)
    • createFormElement

      public static org.jdom2.Element createFormElement(String aName)
      Parameters:
      aName - id of the form
      Returns:
      the form Element