Top Description Fields Constructors Methods
com.dlsc.formsfx.model.structure

public Class Group

extends Object
Class Inheritance
Known Direct Subclasses
com.dlsc.formsfx.model.structure.Section
Imports
com.dlsc.formsfx.model.event.GroupEvent, com.dlsc.formsfx.model.util.TranslationService, javafx.beans.property.BooleanProperty, .SimpleBooleanProperty, javafx.event.EventHandler, .EventType, java.util.ArrayList, .Collections, .List, .Map, java.util.concurrent.ConcurrentHashMap, .CopyOnWriteArrayList

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.
Authors
Sacha Schmid, Rinesch Murugathas

Field Summary

Modifier and TypeField and Description
protected final BooleanProperty
protected final List<Element<E extends Element<E>>>
private final Map<EventType<GroupEvent>, List<EventHandler<? super GroupEvent>>>
protected TranslationService
translationService

The translation service is passed down from the containing form.

protected final BooleanProperty
valid

The group acts as a proxy for its contained elements' changed and valid properties.

Constructor Summary

AccessConstructor and Description
protected
Group(Element<E extends Element<E>>...
A varargs list of elements that are contained in this group.
elements
)

Internal constructor for the Group class.

Method Summary

Modifier and TypeMethod and Description
public Group
addEventHandler(EventType<GroupEvent>
the type of the events to receive by the handler
eventType
,
EventHandler<? super GroupEvent>
the handler to register
eventHandler
)

Registers an event handler to this group.

public BooleanProperty
protected void
public List<Element<E extends Element<E>>>
public boolean
public boolean
public boolean
public static Group

Returns:

Returns a new Group.
of
(Element<E extends Element<E>>...
The elements to be included in the group.
elements
)

Creates a new group containing the given elements.

public void
persist()

Persists the values for all contained elements.

public Group
removeEventHandler(EventType<GroupEvent>
the event type from which to unregister
eventType
,
EventHandler<? super GroupEvent>
the handler to unregister
eventHandler
)

Unregisters a previously registered event handler from this group.

public void
reset()

Resets the values for all contained elements.

private void
setChangedProperty()

Sets this group's changed property based on its contained elements' changed properties.

private void
setValidProperty()

Sets this group's valid property based on its contained elements' changed properties.

protected void
translate(TranslationService
The new service to use for translating translatable values.
newValue
)

This internal method is called by the containing form when a new translation has been added to the form.

public BooleanProperty
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

changedback to summary
protected final BooleanProperty changed
elementsback to summary
protected final List<Element<E extends Element<E>>> elements
eventHandlersback to summary
private final Map<EventType<GroupEvent>, List<EventHandler<? super GroupEvent>>> eventHandlers
translationServiceback to summary
protected TranslationService translationService

The translation service is passed down from the containing form. It is used to translate all translatable values of the field.

validback to summary
protected final BooleanProperty valid

The group acts as a proxy for its contained elements' changed and valid properties.

Constructor Detail

Groupback to summary
protected Group(Element<E extends Element<E>>... elements)

Internal constructor for the Group class. To create new groups, see the static factory method in this class.

Parameters
elements:Element<E extends Element<E>>[]

A varargs list of elements that are contained in this group.

See Also
Group::of

Method Detail

addEventHandlerback to summary
public Group addEventHandler(EventType<GroupEvent> eventType, 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:EventType<GroupEvent>

the type of the events to receive by the handler

eventHandler:EventHandler<? super GroupEvent>

the handler to register

Exceptions
NullPointerException:
if either event type or handler are null.
changedPropertyback to summary
public BooleanProperty changedProperty()
fireEventback to summary
protected void fireEvent(GroupEvent event)
getElementsback to summary
public List<Element<E extends Element<E>>> getElements()
hasChangedback to summary
public boolean hasChanged()
isI18Nback to summary
public boolean isI18N()
isValidback to summary
public boolean isValid()
ofback to summary
public static Group of(Element<E extends Element<E>>... elements)

Creates a new group containing the given elements.

Parameters
elements:Element<E extends Element<E>>[]

The elements to be included in the group.

Returns:Group

Returns a new Group.

persistback to summary
public void persist()

Persists the values for all contained elements.

See Also
Field::persist
removeEventHandlerback to summary
public Group removeEventHandler(EventType<GroupEvent> eventType, 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:EventType<GroupEvent>

the event type from which to unregister

eventHandler:EventHandler<? super GroupEvent>

the handler to unregister

Exceptions
NullPointerException:
if either event type or handler are null.
resetback to summary
public void reset()

Resets the values for all contained elements.

See Also
Field::reset
setChangedPropertyback to summary
private void setChangedProperty()

Sets this group's changed property based on its contained elements' changed properties.

setValidPropertyback to summary
private void setValidProperty()

Sets this group's valid property based on its contained elements' changed properties.

translateback to summary
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:TranslationService

The new service to use for translating translatable values.

See Also
Field::translate
validPropertyback to summary
public BooleanProperty validProperty()