Class SectionDefinitionBuilder<R,T extends SectionDefinitionBuilder<R,T>>
- java.lang.Object
-
- com._1c.g5.aef2.standard.definitions.builders.AbstractBuilder<R,T>
-
- com._1c.g5.aef2.standard.definitions.builders.AbstractContainerDefinitionBuilder<SectionDefinition,T>
-
- com._1c.g5.aef2.standard.definitions.builders.SectionDefinitionBuilder<R,T>
-
- Type Parameters:
R
- the returning type atendSection()
.T
- the type of the builder.
- Direct Known Subclasses:
DtSectionDefinitionBuilder
public class SectionDefinitionBuilder<R,T extends SectionDefinitionBuilder<R,T>> extends AbstractContainerDefinitionBuilder<SectionDefinition,T>
Definition builder to build the section definition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SectionDefinitionBuilder.ComponentParameterizationInfo
Container class for constructing elements inelement(String, EStructuralFeature...)
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
SectionDefinitionBuilder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult)
Instantiates a new builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <R> SectionDefinitionBuilder<R,?>
builder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult)
Creates a new builder.T
component(Class<? extends IComponent> componentClass, IParameterization parameterization)
A convenience wrapper forSetupDefinitionBuilder.component(Class, IParameterization)
.T
componentFactory(IComponentFactory componentFactory)
A convenience wrapper forSetupDefinitionBuilder.componentFactory(IComponentFactory)
.T
element(String label, IDefinitionIdentifier definitionIdentifier)
Creates a newILabeledDefinition
and adds to the section.T
element(String label, String stringIdentifier)
Creates a newILabeledDefinition
and adds to the section.T
element(String label, org.eclipse.emf.ecore.EOperation operation)
Creates a newOperationFieldDefinition
and adds to the section.T
element(String label, org.eclipse.emf.ecore.EStructuralFeature... features)
Creates a newFieldDefinition
and adds it to the section.R
endSection()
Ends section and performs the action that is given while instantiating the builder.protected IDefinition
fieldDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, org.eclipse.emf.databinding.FeaturePath... featurePaths)
Cretets field definition for the provided parameters.protected SectionDefinitionBuilder.ComponentParameterizationInfo
getComponentParameterizationInfo(org.eclipse.emf.ecore.EOperation operation)
Returns theSectionDefinitionBuilder.ComponentParameterizationInfo
for the given operation.protected SectionDefinitionBuilder.ComponentParameterizationInfo
getComponentParameterizationInfo(org.eclipse.emf.ecore.EStructuralFeature... features)
Returns theSectionDefinitionBuilder.ComponentParameterizationInfo
for the given feature path.protected static org.eclipse.emf.ecore.EStructuralFeature
getLastFeature(org.eclipse.emf.ecore.EStructuralFeature... features)
Returns the last feature of the given feature array.protected static SectionDefinitionBuilder.ComponentParameterizationInfo
info(Class<? extends IComponent<?>> componentClass, IParameterization parameterization)
BuildsSectionDefinitionBuilder.ComponentParameterizationInfo
with the given parameters and returns it.protected IDefinition
labeledDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, IDefinitionIdentifier definitionIdentifier)
Cretets labeled definition for the provided parameters.T
multiFeatureElement(String label, org.eclipse.emf.ecore.EStructuralFeature... features)
Creates a newFieldDefinition
with specified single-feature paths and adds it to the section.T
navigateTo(IDefinitionIdentifier definitionIdentifier)
Finds the definition with the given identifier.T
navigateTo(String stringIdentifier)
Finds the definition with the given string identifier.T
navigateTo(org.eclipse.emf.ecore.EOperation operation)
Finds the definition with the given operation and positions to it.T
navigateTo(org.eclipse.emf.ecore.EStructuralFeature... features)
Finds the definition with the given feature path and positions to it.protected IDefinition
operationFieldDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, org.eclipse.emf.ecore.EOperation operation)
Cretets operation field definition for the provided parameters.T
separator()
CreatesSeparatorDefinition
and adds it to section definition.protected void
setElementLogger(Consumer<IDefinition> logger)
Sets a logger that will be called from eachelement(String, EStructuralFeature...)
call.SetupDefinitionBuilder<AbstractDefinition,? extends SetupDefinitionBuilder<AbstractDefinition,?,T>,T>
setup()
Returns the instance of the setup builder that allows to setup the currently positioned definition.protected IDefinition
stringIdDefiniton(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, String stringId)
Cretets string identified field definition for the provided parameters.-
Methods inherited from class com._1c.g5.aef2.standard.definitions.builders.AbstractContainerDefinitionBuilder
getAndIncrementPosition, getPosition, insert, setPosition
-
Methods inherited from class com._1c.g5.aef2.standard.definitions.builders.AbstractBuilder
apply, build, self
-
-
-
-
Constructor Detail
-
SectionDefinitionBuilder
protected SectionDefinitionBuilder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult)
Instantiates a new builder.- Parameters:
provider
- the provider of section definition, cannot benull
.endAction
- the action performed when the builder ends section building.endSectionResult
- the object that is returned byendSection()
.
-
-
Method Detail
-
builder
public static <R> SectionDefinitionBuilder<R,?> builder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult)
Creates a new builder.- Parameters:
provider
- the provider of section definition, cannot benull
.endAction
- the action performed the builder ends section building.endSectionResult
- the object that is returned byendSection()
.- Returns:
- a newly created builder instance, never
null
.
-
element
public T element(String label, org.eclipse.emf.ecore.EStructuralFeature... features)
Creates a newFieldDefinition
and adds it to the section.- Parameters:
label
- the label of the field ornull
to disable label creationfeatures
- the features that represents the feature path, may be empty- Returns:
- the builder instance, never
null
.
-
multiFeatureElement
public T multiFeatureElement(String label, org.eclipse.emf.ecore.EStructuralFeature... features)
Creates a newFieldDefinition
with specified single-feature paths and adds it to the section.- Parameters:
label
- the label of the field ornull
to disable label creationfeatures
- the features each of which defines its own single-feature path- Returns:
- the builder instance, never
null
.
-
element
public T element(String label, org.eclipse.emf.ecore.EOperation operation)
Creates a newOperationFieldDefinition
and adds to the section.- Parameters:
label
- the label of the field ornull
to disable label creationoperation
- the operation, cannot benull
.- Returns:
- the builder instance, never
null
.
-
element
public T element(String label, IDefinitionIdentifier definitionIdentifier)
Creates a newILabeledDefinition
and adds to the section.- Parameters:
label
- the label of the field ornull
to disable label creationdefinitionIdentifier
- the definition identifier, cannot benull
.- Returns:
- the builder instance, never
null
.
-
element
public T element(String label, String stringIdentifier)
Creates a newILabeledDefinition
and adds to the section.- Parameters:
label
- the label of the field ornull
to disable label creationstringIdentifier
- the string that identifies definition uniquely, cannot benull
.- Returns:
- the builder instance, never
null
.
-
navigateTo
public T navigateTo(IDefinitionIdentifier definitionIdentifier)
Finds the definition with the given identifier.- Parameters:
definitionIdentifier
- the definition identifier, cannot benull
.- Returns:
- the builder instance, never
null
.
-
navigateTo
public T navigateTo(String stringIdentifier)
Finds the definition with the given string identifier.- Parameters:
stringIdentifier
- the string identifier, cannot benull
.- Returns:
- the builder instance, never
null
.
-
navigateTo
public T navigateTo(org.eclipse.emf.ecore.EStructuralFeature... features)
Finds the definition with the given feature path and positions to it.- Parameters:
features
- the features that represent the feature path, cannot benull
- Returns:
- the builder instance, never
null
.
-
navigateTo
public T navigateTo(org.eclipse.emf.ecore.EOperation operation)
Finds the definition with the given operation and positions to it.- Parameters:
operation
- operation the operation, cannot benull
.- Returns:
- the builder instance, never
null
.
-
setup
public SetupDefinitionBuilder<AbstractDefinition,? extends SetupDefinitionBuilder<AbstractDefinition,?,T>,T> setup()
Returns the instance of the setup builder that allows to setup the currently positioned definition. If there are no definition added it returns the setup builder for the section definition.- Returns:
- setup definition builder instance, never
null
.
-
componentFactory
public T componentFactory(IComponentFactory componentFactory)
A convenience wrapper forSetupDefinitionBuilder.componentFactory(IComponentFactory)
.- Parameters:
componentFactory
- the component factory for the current element- Returns:
- the builder instance, never
null
.
-
component
public T component(Class<? extends IComponent> componentClass, IParameterization parameterization)
A convenience wrapper forSetupDefinitionBuilder.component(Class, IParameterization)
.- Parameters:
componentClass
- Component class for the current elementparameterization
- Component parameterization for the current element- Returns:
- The builder instance, never
null
.
-
separator
public T separator()
CreatesSeparatorDefinition
and adds it to section definition.- Returns:
- the builder instance, never
null
.
-
endSection
public R endSection()
Ends section and performs the action that is given while instantiating the builder.- Returns:
- the object given in constructor, never
null
.
-
fieldDefinition
protected IDefinition fieldDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, org.eclipse.emf.databinding.FeaturePath... featurePaths)
Cretets field definition for the provided parameters.- Parameters:
componentClass
- the component class, cannot benull
parameterization
- the component parameterization, cannot benull
label
- the component label ornull
if nonefeaturePaths
- the EMF feature pathes, cannot benull
- Returns:
- the created definition, never
null
-
operationFieldDefinition
protected IDefinition operationFieldDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, org.eclipse.emf.ecore.EOperation operation)
Cretets operation field definition for the provided parameters.- Parameters:
componentClass
- the component class, cannot benull
parameterization
- the component parameterization, cannot benull
label
- the component label ornull
if noneoperation
- the EMF operation, cannot benull
- Returns:
- the created definition, never
null
-
stringIdDefiniton
protected IDefinition stringIdDefiniton(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, String stringId)
Cretets string identified field definition for the provided parameters.- Parameters:
componentClass
- the component class, cannot benull
parameterization
- the component parameterization, cannot benull
label
- the component label ornull
if nonestringId
- the string identifier of the definition, cannot benull
- Returns:
- the created definition, never
null
-
labeledDefinition
protected IDefinition labeledDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, IDefinitionIdentifier definitionIdentifier)
Cretets labeled definition for the provided parameters.- Parameters:
componentClass
- the component class, cannot benull
parameterization
- the component parameterization, cannot benull
label
- the component label ornull
if nonedefinitionIdentifier
- theIDefinitionIdentifier
instance, cannot benull
.- Returns:
- the created definition, never
null
.
-
getComponentParameterizationInfo
protected SectionDefinitionBuilder.ComponentParameterizationInfo getComponentParameterizationInfo(org.eclipse.emf.ecore.EOperation operation)
Returns theSectionDefinitionBuilder.ComponentParameterizationInfo
for the given operation.- Parameters:
operation
- the operation.- Returns:
- the
SectionDefinitionBuilder.ComponentParameterizationInfo
.
-
getComponentParameterizationInfo
protected SectionDefinitionBuilder.ComponentParameterizationInfo getComponentParameterizationInfo(org.eclipse.emf.ecore.EStructuralFeature... features)
Returns theSectionDefinitionBuilder.ComponentParameterizationInfo
for the given feature path.- Parameters:
features
- the features that represents the feature path.- Returns:
- the c the
SectionDefinitionBuilder.ComponentParameterizationInfo
.
-
getLastFeature
protected static final org.eclipse.emf.ecore.EStructuralFeature getLastFeature(org.eclipse.emf.ecore.EStructuralFeature... features)
Returns the last feature of the given feature array.- Parameters:
features
- the features, may benull
- Returns:
- an
EStructuralFeature
instance ornull
-
info
protected static SectionDefinitionBuilder.ComponentParameterizationInfo info(Class<? extends IComponent<?>> componentClass, IParameterization parameterization)
BuildsSectionDefinitionBuilder.ComponentParameterizationInfo
with the given parameters and returns it.- Parameters:
componentClass
- the component class.parameterization
- the parameterization.- Returns:
SectionDefinitionBuilder.ComponentParameterizationInfo
.
-
setElementLogger
protected void setElementLogger(Consumer<IDefinition> logger)
Sets a logger that will be called from eachelement(String, EStructuralFeature...)
call.
-
-