Class Group

java.lang.Object
com.dlsc.formsfx.model.structure.Group
Direct Known Subclasses:
Section

public class Group
extends Object
A group is the intermediate unit in a form. It is used to group form elements to a larger unit. It also acts as a proxy to some properties of the contained data, such as validity or changes.
Author:
Sacha Schmid, Rinesch Murugathas
  • Property Summary

    Properties 
    Type Property Description
    javafx.beans.property.BooleanProperty changed  
    javafx.beans.property.BooleanProperty valid
    The group acts as a proxy for its contained elements' changed and valid properties.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected javafx.beans.property.BooleanProperty changed  
    protected List<Element> elements  
    protected TranslationService translationService
    The translation service is passed down from the containing form.
    protected javafx.beans.property.BooleanProperty valid
    The group acts as a proxy for its contained elements' changed and valid properties.
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected Group​(Element... elements)
    Internal constructor for the Group class.
  • Method Summary

    Modifier and Type Method Description
    Group addEventHandler​(javafx.event.EventType<GroupEvent> eventType, javafx.event.EventHandler<? super GroupEvent> eventHandler)
    Registers an event handler to this group.
    javafx.beans.property.BooleanProperty changedProperty()  
    protected void fireEvent​(GroupEvent event)  
    List<Element> getElements()  
    boolean hasChanged()  
    boolean isI18N()  
    boolean isValid()
    Gets the value of the property valid.
    static Group of​(Element... elements)
    Creates a new group containing the given elements.
    void persist()
    Persists the values for all contained elements.
    Group removeEventHandler​(javafx.event.EventType<GroupEvent> eventType, javafx.event.EventHandler<? super GroupEvent> eventHandler)
    Unregisters a previously registered event handler from this group.
    void reset()
    Resets the values for all contained elements.
    protected void translate​(TranslationService newValue)
    This internal method is called by the containing form when a new translation has been added to the form.
    javafx.beans.property.BooleanProperty validProperty()
    The group acts as a proxy for its contained elements' changed and valid properties.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Property Details

    • changed

      public javafx.beans.property.BooleanProperty changedProperty
    • valid

      public javafx.beans.property.BooleanProperty validProperty
      The group acts as a proxy for its contained elements' changed and valid properties.
      See Also:
      isValid()
  • Field Details

    • elements

      protected final List<Element> elements
    • valid

      protected final javafx.beans.property.BooleanProperty valid
      The group acts as a proxy for its contained elements' changed and valid properties.
    • changed

      protected final javafx.beans.property.BooleanProperty changed
    • translationService

      protected TranslationService translationService
      The translation service is passed down from the containing form. It is used to translate all translatable values of the field.
  • Constructor Details

    • Group

      protected Group​(Element... elements)
      Internal constructor for the Group class. To create new groups, see the static factory method in this class.
      Parameters:
      elements - A varargs list of elements that are contained in this group.
  • Method Details

    • of

      public static Group of​(Element... elements)
      Creates a new group containing the given elements.
      Parameters:
      elements - The elements to be included in the group.
      Returns:
      Returns a new Group.
    • translate

      protected void translate​(TranslationService newValue)
      This internal method is called by the containing form when a new translation has been added to the form. Also applies the translation to all contained elements.
      Parameters:
      newValue - The new service to use for translating translatable values.
    • persist

      public void persist()
      Persists the values for all contained elements.
    • reset

      public void reset()
      Resets the values for all contained elements.
    • getElements

      public List<Element> getElements()
    • hasChanged

      public boolean hasChanged()
    • changedProperty

      public javafx.beans.property.BooleanProperty changedProperty()
    • isValid

      public boolean isValid()
      Gets the value of the property valid.
      Property description:
      The group acts as a proxy for its contained elements' changed and valid properties.
    • validProperty

      public javafx.beans.property.BooleanProperty validProperty()
      The group acts as a proxy for its contained elements' changed and valid properties.
      See Also:
      isValid()
    • isI18N

      public boolean isI18N()
    • addEventHandler

      public Group addEventHandler​(javafx.event.EventType<GroupEvent> eventType, javafx.event.EventHandler<? super GroupEvent> eventHandler)
      Registers an event handler to this group. The handler is called when the group receives an Event of the specified type during the bubbling phase of event delivery.
      Parameters:
      eventType - the type of the events to receive by the handler
      eventHandler - the handler to register
      Throws:
      NullPointerException - if either event type or handler are null.
    • removeEventHandler

      public Group removeEventHandler​(javafx.event.EventType<GroupEvent> eventType, javafx.event.EventHandler<? super GroupEvent> eventHandler)
      Unregisters a previously registered event handler from this group. One handler might have been registered for different event types, so the caller needs to specify the particular event type from which to unregister the handler.
      Parameters:
      eventType - the event type from which to unregister
      eventHandler - the handler to unregister
      Throws:
      NullPointerException - if either event type or handler are null.
    • fireEvent

      protected void fireEvent​(GroupEvent event)