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
-
Field Summary
Fields Modifier and Type Field Description protected javafx.beans.property.BooleanPropertychangedprotected List<Element>elementsprotected TranslationServicetranslationServiceThe translation service is passed down from the containing form.protected javafx.beans.property.BooleanPropertyvalidThe group acts as a proxy for its contained elements'changedandvalidproperties. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description GroupaddEventHandler(javafx.event.EventType<GroupEvent> eventType, javafx.event.EventHandler<? super GroupEvent> eventHandler)Registers an event handler to this group.javafx.beans.property.BooleanPropertychangedProperty()protected voidfireEvent(GroupEvent event)List<Element>getElements()booleanhasChanged()booleanisI18N()booleanisValid()Gets the value of the property valid.static Groupof(Element... elements)Creates a new group containing the given elements.voidpersist()Persists the values for all contained elements.GroupremoveEventHandler(javafx.event.EventType<GroupEvent> eventType, javafx.event.EventHandler<? super GroupEvent> eventHandler)Unregisters a previously registered event handler from this group.voidreset()Resets the values for all contained elements.protected voidtranslate(TranslationService newValue)This internal method is called by the containing form when a new translation has been added to the form.javafx.beans.property.BooleanPropertyvalidProperty()The group acts as a proxy for its contained elements'changedandvalidproperties.
-
Property Details
-
Field Details
-
elements
-
valid
protected final javafx.beans.property.BooleanProperty validThe group acts as a proxy for its contained elements'changedandvalidproperties. -
changed
protected final javafx.beans.property.BooleanProperty changed -
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
Internal constructor for theGroupclass. 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
Creates a new group containing the given elements.- Parameters:
elements- The elements to be included in the group.- Returns:
- Returns a new
Group.
-
translate
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
-
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'
changedandvalidproperties.
-
validProperty
public javafx.beans.property.BooleanProperty validProperty()The group acts as a proxy for its contained elements'changedandvalidproperties.- 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 anEventof the specified type during the bubbling phase of event delivery.- Parameters:
eventType- the type of the events to receive by the handlereventHandler- the handler to register- Throws:
NullPointerException- if either event type or handler arenull.
-
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 unregistereventHandler- the handler to unregister- Throws:
NullPointerException- if either event type or handler arenull.
-
fireEvent
-