Class FWGroupFormComponent

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, net.simplace.core.FWBusyIndicator, net.simplace.core.FWObserver

public class FWGroupFormComponent extends FWAbstractFormComponent
Form component grouping other form components, vertically or horizontally (attribute align="horizontal"), with a titled border. With the attribute dynamic="true" the contained fields are created from the field list of the form filler. A group can also check an expression (attributes expression, regexp - a leading ! negates it - and message); the border is then green or red and the group is required.
Author:
Andreas Enders
See Also:
  • Constructor Details

    • FWGroupFormComponent

      public FWGroupFormComponent(String aFormID, String aFieldID, boolean aShowLabel, int aDetachable, org.jdom2.Element aParameters, net.simplace.core.FWObservable aObservable)
      Parameters:
      aFormID - id of the form the component is placed in
      aFieldID - id of the group
      aShowLabel - true to show the title in the border (the caption label is never shown)
      aDetachable - detachability, one of the DETACH_* constants
      aParameters - the form element of the group
      aObservable - parameters of the functionality
  • Method Details

    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class FWAbstractFormComponent
    • getMaximumSize

      public Dimension getMaximumSize()
      Overrides:
      getMaximumSize in class FWAbstractFormComponent
    • getValue

      public String getValue()
      Specified by:
      getValue in class FWAbstractFormComponent
      Returns:
      for checking groups "true" if the check succeeds, otherwise null
    • setValue

      public void setValue(Object aValue)
      Does nothing; a group has no value of its own.
      Specified by:
      setValue in class FWAbstractFormComponent
      Parameters:
      aValue - not used
    • add

      public Component add(Component aComp)
      Adds a component to the group's content panel.
      Overrides:
      add in class Container
      Parameters:
      aComp - the component
      Returns:
      the component
    • removeAll

      public void removeAll()
      Removes all components from the group's content panel.
      Overrides:
      removeAll in class Container
    • getGroupComponentCount

      public int getGroupComponentCount()
      Returns:
      number of components in the group
    • getComponents

      public Component[] getComponents()
      Overrides:
      getComponents in class Container
      Returns:
      the components in the group
    • update

      public void update(net.simplace.core.FWObservable aObservable, Object aKeyOfParameterChanged)
      In addition to the base behaviour, repeats the check of a checking group when a parameter used in expression or regexp changes.
      Specified by:
      update in interface net.simplace.core.FWObserver
      Overrides:
      update in class FWAbstractFormComponent
      Parameters:
      aObservable - the parameters
      aKeyOfParameterChanged - key of the changed parameter
    • processFormFiller

      public void processFormFiller()
      For dynamic groups, (re)creates the contained fields from the filler's field list via the enclosing FWFormPanel; otherwise takes the check expression from the filler.
      Specified by:
      processFormFiller in class FWAbstractFormComponent
    • getDynamicFieldList

      public List<org.jdom2.Element> getDynamicFieldList()
      Returns:
      the field elements of a dynamic group, or null
    • isCheckingGroup

      public boolean isCheckingGroup()
      Returns:
      true if the group has a check expression
    • getValueCell

      protected com.lowagie.text.Rectangle getValueCell(int aType)
      Description copied from class: FWAbstractFormComponent
      Returns the value cell used for generating the RTF, PDF or HTML version of the form.
      Specified by:
      getValueCell in class FWAbstractFormComponent
      Parameters:
      aType - output type, e.g. PrintHelper.TYPE_PDF
      Returns:
      an iText cell (PdfPCell for PDF, Cell otherwise)