Class AbstractConfigurationBuilder<M>
- java.lang.Object
-
- net.officefloor.gef.configurer.internal.AbstractConfigurationBuilder<M>
-
- All Implemented Interfaces:
ConfigurationBuilder<M>
,InputBuilder<M>
,ItemBuilder<M>
- Direct Known Subclasses:
Configurer
public abstract class AbstractConfigurationBuilder<M> extends java.lang.Object implements ConfigurationBuilder<M>
AbstractConfigurationBuilder
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.officefloor.gef.configurer.ConfigurationBuilder
ConfigurationBuilder.Applier<M>, ConfigurationBuilder.MessageOnlyApplyException
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CSS_CLASS_NARROW
CSS class applied to theGridPane
in narrow view.static java.lang.String
CSS_CLASS_WIDE
CSS class applied toGridPane
in wide view.
-
Constructor Summary
Constructors Constructor Description AbstractConfigurationBuilder(EnvironmentBridge envBridge)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(java.lang.String label, ConfigurationBuilder.Applier<M> applier)
Configures aConfigurationBuilder.Applier
to apply the configured model.ChoiceBuilder<M>
choices(java.lang.String label)
Builds choices in configuration.ClassBuilder<M>
clazz(java.lang.String label)
Adds aClass
property to be configured.void
close(CloseListener closeListener)
Specifies theCloseListener
.void
error(ErrorListener errorListener)
Specifies theErrorListener
.FlagBuilder<M>
flag(java.lang.String label)
Adds flag property to be configured.ValueRendererFactory<M,? extends ValueInput>[]
getValueRendererFactories()
Obtain the list ofValueRendererFactory
instances.<I> ListBuilder<M,I>
list(java.lang.String label, java.lang.Class<I> itemType)
Configures creating a list of items.protected Configuration
loadConfiguration(M model, javafx.scene.layout.Pane configurationNode)
Loads the configuration to the parentPane
.MappingBuilder<M>
map(java.lang.String label, java.util.function.Function<M,javafx.collections.ObservableList<java.lang.String>> getSources, java.util.function.Function<M,javafx.collections.ObservableList<java.lang.String>> getTargets)
Configures a mapping of name to name.<I> MultipleBuilder<M,I>
multiple(java.lang.String label, java.lang.Class<I> itemType)
Configures multiple items.OptionalBuilder<M>
optional(java.util.function.Predicate<M> isShow)
Configures optional configuration.PropertiesBuilder<M>
properties(java.lang.String label)
ConfiguresPropertyList
.Configuration
recursiveLoadConfiguration(M model, javafx.scene.Node configurationNode, javafx.scene.layout.GridPane grid, Actioner actioner, javafx.beans.property.Property<java.lang.Boolean> dirtyProperty, javafx.beans.property.Property<java.lang.Boolean> validProperty, ErrorListener errorListener)
Loads the configuration to theGridPane
.ResourceBuilder<M>
resource(java.lang.String label)
Adds a resource property to be configured.<I> SelectBuilder<M,I>
select(java.lang.String label, java.util.function.Function<M,javafx.collections.ObservableList<I>> getItems)
Configures selecting from a list of items.TextBuilder<M>
text(java.lang.String label)
Adds text property to be configured.ConfigurationBuilder<M>
title(java.lang.String title)
Specifies the label for this configuration.void
validate(ValueValidator<M,M> validator)
Validates the model.
-
-
-
Field Detail
-
CSS_CLASS_WIDE
public static final java.lang.String CSS_CLASS_WIDE
CSS class applied toGridPane
in wide view.- See Also:
- Constant Field Values
-
CSS_CLASS_NARROW
public static final java.lang.String CSS_CLASS_NARROW
CSS class applied to theGridPane
in narrow view.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractConfigurationBuilder
public AbstractConfigurationBuilder(EnvironmentBridge envBridge)
Instantiate.- Parameters:
envBridge
-EnvironmentBridge
.
-
-
Method Detail
-
getValueRendererFactories
public ValueRendererFactory<M,? extends ValueInput>[] getValueRendererFactories()
Obtain the list ofValueRendererFactory
instances.- Returns:
ValueRendererFactory
instances.
-
loadConfiguration
protected Configuration loadConfiguration(M model, javafx.scene.layout.Pane configurationNode)
Loads the configuration to the parentPane
.- Parameters:
model
- Model.configurationNode
- ConfigurationPane
.- Returns:
Configuration
.
-
recursiveLoadConfiguration
public Configuration recursiveLoadConfiguration(M model, javafx.scene.Node configurationNode, javafx.scene.layout.GridPane grid, Actioner actioner, javafx.beans.property.Property<java.lang.Boolean> dirtyProperty, javafx.beans.property.Property<java.lang.Boolean> validProperty, ErrorListener errorListener)
Loads the configuration to theGridPane
.- Parameters:
model
- Model.configurationNode
- ConfigurationNode
.grid
-GridPane
.actioner
-Actioner
.dirtyProperty
- DirtyProperty
.validProperty
- ValidProperty
.errorListener
-ErrorListener
.- Returns:
Configuration
.
-
title
public ConfigurationBuilder<M> title(java.lang.String title)
Description copied from interface:ConfigurationBuilder
Specifies the label for this configuration.- Specified by:
title
in interfaceConfigurationBuilder<M>
- Parameters:
title
- Title for this configuration.- Returns:
this
.
-
text
public TextBuilder<M> text(java.lang.String label)
Description copied from interface:ItemBuilder
Adds text property to be configured.- Specified by:
text
in interfaceItemBuilder<M>
- Parameters:
label
- Label.- Returns:
TextBuilder
.
-
flag
public FlagBuilder<M> flag(java.lang.String label)
Description copied from interface:ItemBuilder
Adds flag property to be configured.- Specified by:
flag
in interfaceItemBuilder<M>
- Parameters:
label
- Label.- Returns:
FlagBuilder
.
-
choices
public ChoiceBuilder<M> choices(java.lang.String label)
Description copied from interface:InputBuilder
Builds choices in configuration.- Specified by:
choices
in interfaceInputBuilder<M>
- Parameters:
label
- Label for the choices.- Returns:
ChoiceBuilder
.
-
list
public <I> ListBuilder<M,I> list(java.lang.String label, java.lang.Class<I> itemType)
Description copied from interface:InputBuilder
Configures creating a list of items.- Specified by:
list
in interfaceInputBuilder<M>
- Type Parameters:
I
- Item type.- Parameters:
label
- Label for the items.itemType
- Item type.- Returns:
ListBuilder
.
-
select
public <I> SelectBuilder<M,I> select(java.lang.String label, java.util.function.Function<M,javafx.collections.ObservableList<I>> getItems)
Description copied from interface:InputBuilder
Configures selecting from a list of items.- Specified by:
select
in interfaceInputBuilder<M>
- Type Parameters:
I
- Item type.- Parameters:
label
- Label for the selection.getItems
- Function to extract the items.- Returns:
SelectBuilder
.
-
optional
public OptionalBuilder<M> optional(java.util.function.Predicate<M> isShow)
Description copied from interface:InputBuilder
Configures optional configuration.- Specified by:
optional
in interfaceInputBuilder<M>
- Parameters:
isShow
-Predicate
on whether to show the optional configuration.- Returns:
OptionalBuilder
.
-
multiple
public <I> MultipleBuilder<M,I> multiple(java.lang.String label, java.lang.Class<I> itemType)
Description copied from interface:InputBuilder
Configures multiple items.- Specified by:
multiple
in interfaceInputBuilder<M>
- Type Parameters:
I
- Item type.- Parameters:
label
- Label for the items.itemType
- Item type.- Returns:
MultipleBuilder
.
-
properties
public PropertiesBuilder<M> properties(java.lang.String label)
Description copied from interface:InputBuilder
ConfiguresPropertyList
.- Specified by:
properties
in interfaceInputBuilder<M>
- Parameters:
label
- Label for theProperties
.- Returns:
PropertiesBuilder
.
-
map
public MappingBuilder<M> map(java.lang.String label, java.util.function.Function<M,javafx.collections.ObservableList<java.lang.String>> getSources, java.util.function.Function<M,javafx.collections.ObservableList<java.lang.String>> getTargets)
Description copied from interface:InputBuilder
Configures a mapping of name to name.- Specified by:
map
in interfaceInputBuilder<M>
- Parameters:
label
- Label for the mapping.getSources
-Function
to extract the sources.getTargets
-Function
to extract the targets.- Returns:
MappingBuilder
.
-
clazz
public ClassBuilder<M> clazz(java.lang.String label)
Description copied from interface:InputBuilder
Adds aClass
property to be configured.- Specified by:
clazz
in interfaceInputBuilder<M>
- Parameters:
label
- Label.- Returns:
ClassBuilder
.
-
resource
public ResourceBuilder<M> resource(java.lang.String label)
Description copied from interface:InputBuilder
Adds a resource property to be configured.- Specified by:
resource
in interfaceInputBuilder<M>
- Parameters:
label
- Label.- Returns:
ResourceBuilder
.
-
validate
public void validate(ValueValidator<M,M> validator)
Description copied from interface:ConfigurationBuilder
Validates the model.- Specified by:
validate
in interfaceConfigurationBuilder<M>
- Parameters:
validator
-ValueValidator
.
-
error
public void error(ErrorListener errorListener)
Description copied from interface:ConfigurationBuilder
Specifies theErrorListener
.- Specified by:
error
in interfaceConfigurationBuilder<M>
- Parameters:
errorListener
-ErrorListener
.
-
apply
public void apply(java.lang.String label, ConfigurationBuilder.Applier<M> applier)
Description copied from interface:ConfigurationBuilder
Configures aConfigurationBuilder.Applier
to apply the configured model.- Specified by:
apply
in interfaceConfigurationBuilder<M>
- Parameters:
label
- Label for the applyingActioner
.applier
-ConfigurationBuilder.Applier
to apply the configured model.
-
close
public void close(CloseListener closeListener)
Description copied from interface:ConfigurationBuilder
Specifies theCloseListener
.- Specified by:
close
in interfaceConfigurationBuilder<M>
- Parameters:
closeListener
-CloseListener
.
-
-