| Modifier and Type | Class and Description |
|---|---|
protected class |
EditorBuilder.AbstractConditional<ELEMENT> |
static interface |
EditorBuilder.Conditional<ELEMENT>
Defines builder configuration depending on condition
|
protected class |
EditorBuilder.EditorBuilderConditional |
protected class |
EditorBuilder.EditorConditional |
| Constructor and Description |
|---|
EditorBuilder(EditorContext<?> editorContext)
Creates new builder basing on provided editor's context.
|
EditorBuilder(WidgetInstanceManager widgetInstanceManager)
Creates new builder for
Editor that will work with provided widget. |
EditorBuilder(WidgetInstanceManager widgetInstanceManager,
DataAttribute genericAttribute,
String referencedModelProperty)
Deprecated.
since 6.7, use instead:
configure(DataAttribute),set configure(String, DataAttribute) |
| Modifier and Type | Method and Description |
|---|---|
EditorBuilder |
addParameter(String parameter,
Object value)
Adds a parameter to editor's context.
|
<V> EditorBuilder |
addParameters(Map<String,V> parameters)
Adds parameters to editor's context.
|
<ELEMENT> EditorBuilder |
addParameters(Stream<ELEMENT> stream,
Function<ELEMENT,String> keySupplier,
Function<ELEMENT,Object> valueSupplier)
Adds a parameter to editor's context.
|
EditorBuilder |
appendSClass(String sclass)
Adds a CSS class to editor component.
|
EditorBuilder |
apply(Consumer<Editor> configuration)
Allows any modification of editor to be applied before it is initialized.
|
EditorBuilder |
attach(String qualifier)
Configures editor in the way that it may be used to manipulate with values of specified attribute.
|
Editor |
build()
Builds editor component
|
Editor |
buildNotInitialized()
Deprecated.
since 6.7, please create an instance manually and use
EditorConfigurator instead |
EditorBuilder |
configure(DataAttribute attribute)
Configures component to use default behavior for specified attribute
|
EditorBuilder |
configure(DataType dataType)
Configures component to use default behavior for specified type.
|
EditorBuilder |
configure(String itemKey,
DataAttribute attribute)
Configures component to use default behavior for specified attribute of item
|
EditorBuilder |
configure(String itemKey,
String qualifier)
Configures component to use default behavior for specified attribute of item
|
EditorBuilder |
enableValidation(String modelKey,
String qualifier,
ValidatableContainer container)
Configures validation for editor.
|
protected ObjectFacade |
getObjectFacade() |
protected PermissionFacade |
getPermissionFacade() |
protected TypeFacade |
getTypeFacade() |
WidgetInstanceManager |
getWidgetInstanceManager() |
EditorBuilder.Conditional<Editor> |
ifTrue(boolean test)
Allows conditional modification of editor before it is initialized using flow programming.
|
EditorBuilder |
setDescription(String description)
Some editors are capable of decorating editor component with proper description (i.e.
|
EditorBuilder |
setEditor(String editorType)
Deprecated.
since 6.7, use #
useEditor(String) instead |
EditorBuilder |
setEditorRegistry(EditorRegistry editorRegistry) |
EditorBuilder |
setEditorType(String editorType)
Deprecated.
since 6.7, use
useEditor(String) instead |
EditorBuilder |
setLabel(String label)
Some editors are capable of decorating editor component with proper label (i.e.
|
EditorBuilder |
setLabelService(LabelService labelService) |
EditorBuilder |
setMultilingual(boolean multilingual)
Configures editor in context of allowing providing localized values in regards to specified flag.
|
EditorBuilder |
setMultilingual(boolean multilingual,
Object item)
Configures editor in context of allowing providing localized values in regards to specified flag.
|
EditorBuilder |
setObjectFacade(ObjectFacade objectFacade) |
EditorBuilder |
setOptional(boolean optional)
Informs whether editor value should be mandatory.
|
EditorBuilder |
setPermissionFacade(PermissionFacade permissionFacade) |
EditorBuilder |
setReadOnly(boolean readOnly)
Informs whether editor value should work in read-only mode.
|
EditorBuilder |
setReferenceModelProperties(ReferenceModelProperties referenceModelProperties) |
EditorBuilder |
setSingleValued()
Changes all multivalued editors into single-valued - i.e.
|
EditorBuilder |
setTypeFacade(TypeFacade typeFacade) |
EditorBuilder |
setValue(Object value)
Initializes editor component with provided value.
|
EditorBuilder |
setValueCreationEnabled(boolean enabled)
Some editors allows creation new values (i.e.
|
EditorBuilder |
setValueType(String valueType)
Sets an encoded type of value that editor is supposed to provide (i.e.
|
EditorBuilder |
useDefaultEditor()
Updates editor definition to be used basing on value type
|
EditorBuilder |
useEditor(String editorType)
Explicitly defines which editor definition should be used by component
|
EditorBuilder.Conditional<EditorBuilder> |
when(boolean test)
Allows conditional builder configuration using flow programming.
|
public EditorBuilder(WidgetInstanceManager widgetInstanceManager)
Editor that will work with provided widget.
Specific implementations of facades may be provided.
widgetInstanceManager - editor manager of widget with which editor is supposed to workpublic EditorBuilder(EditorContext<?> editorContext)
editorContext - base editor context@Deprecated public EditorBuilder(WidgetInstanceManager widgetInstanceManager, DataAttribute genericAttribute, String referencedModelProperty)
configure(DataAttribute),set configure(String, DataAttribute)protected TypeFacade getTypeFacade()
public EditorBuilder setTypeFacade(TypeFacade typeFacade)
protected PermissionFacade getPermissionFacade()
public EditorBuilder setPermissionFacade(PermissionFacade permissionFacade)
protected ObjectFacade getObjectFacade()
public EditorBuilder setObjectFacade(ObjectFacade objectFacade)
public EditorBuilder setReferenceModelProperties(ReferenceModelProperties referenceModelProperties)
public EditorBuilder setEditorRegistry(EditorRegistry editorRegistry)
public EditorBuilder setLabelService(LabelService labelService)
public WidgetInstanceManager getWidgetInstanceManager()
@Deprecated public Editor buildNotInitialized()
EditorConfigurator insteadEditor.initialize() should be performed
before using Editor.EditorEditorConfiguratorpublic EditorBuilder apply(Consumer<Editor> configuration)
configuration - a function configuring editorpublic EditorBuilder.Conditional<Editor> ifTrue(boolean test)
test - condition to be met for modification to be appliedpublic EditorBuilder.Conditional<EditorBuilder> when(boolean test)
test - condition to be met for configuration to be appliedpublic EditorBuilder configure(DataAttribute attribute)
attribute - attribute to be manipulated by editorconfigure(String, String),
configure(String, DataAttribute)public EditorBuilder configure(String itemKey, DataAttribute attribute)
itemKey - model value key under which a manipulated item may be foundattribute - attribute to be manipulated by editorconfigure(String, String)public EditorBuilder configure(String itemKey, String qualifier)
itemKey - model value key under which a manipulated item may be foundqualifier - qualifier of attribute to be manipulated by editorconfigure(String, DataAttribute)public EditorBuilder configure(DataType dataType)
Method should be used, if editor is not supposed to manipulate with any item, rather to provide a value of specified type.
dataType - type of value to be provided by editorconfigure(String, DataAttribute),
configure(String, String)public EditorBuilder attach(String qualifier)
qualifier - qualifier of attribute which values will be changed by editorpublic EditorBuilder addParameter(String parameter, Object value)
parameter - parameter's namevalue - parameters's valuepublic <V> EditorBuilder addParameters(Map<String,V> parameters)
parameters - parameters to be addedpublic <ELEMENT> EditorBuilder addParameters(Stream<ELEMENT> stream, Function<ELEMENT,String> keySupplier, Function<ELEMENT,Object> valueSupplier)
stream - stream of parameters definitionskeySupplier - a supplier to provide parameter name out of definitionvalueSupplier - a supplier to provide parameter value out of definitionpublic EditorBuilder setSingleValued()
public EditorBuilder setReadOnly(boolean readOnly)
readOnly - true if value should work in read-only mode.public EditorBuilder setMultilingual(boolean multilingual)
multilingual - true if editor should allow localized values, false otherwisesetMultilingual(boolean, Object)public EditorBuilder setMultilingual(boolean multilingual, Object item)
item - item which attribute will be manipulated with editormultilingual - true if editor should allow localized values, false otherwisepublic EditorBuilder setOptional(boolean optional)
optional - true if value should not be mandatorypublic EditorBuilder setValue(Object value)
value - value to be displayed initiallypublic EditorBuilder setValueType(String valueType)
Editor type is not updated in this method!
valueType - encoded value typeuseEditor(String)@Deprecated public EditorBuilder setEditorType(String editorType)
useEditor(String) insteadpublic EditorBuilder useEditor(String editorType)
editorType - editor definition idsetValueType(String)public EditorBuilder useDefaultEditor()
setValueType(String)@Deprecated public EditorBuilder setEditor(String editorType)
useEditor(String) insteadeditorType - editor to be used or null for defaultpublic EditorBuilder setValueCreationEnabled(boolean enabled)
enabled - true if value creation should be possiblepublic EditorBuilder appendSClass(String sclass)
sclass - name of CSS class to be addedpublic EditorBuilder setLabel(String label)
label - label to be usedpublic EditorBuilder setDescription(String description)
description - description to be usedpublic EditorBuilder enableValidation(String modelKey, String qualifier, ValidatableContainer container)
modelKey - name of widget model value under which an item may be found, which attribute will be changed by editorqualifier - qualifier of attribute which values will be changed by editorcontainer - validatable containerCopyright © 2018. All rights reserved.