public class EditorConfigurator extends Object
| Constructor and Description |
|---|
EditorConfigurator(Editor editor)
Creates a configurator - object that helps configuring existing
Editor components. |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(String parameter,
Object value)
Adds a parameter to editor's context.
|
<VALUE> void |
addParameters(Map<String,VALUE> parameters)
Adds parameters to editor's context.
|
void |
configure(DataAttribute attribute)
Configures editor in the way that it may be used to manipulate with values of specified attribute and sets all
default configuration that it causes
|
void |
configure(DataType dataType)
Sets default configuration of editor for specified data type
|
void |
configure(Object item,
DataAttribute attribute)
Configures editor in the way that it may be used to manipulate with values of specified attribute and sets all
default configuration that it causes
|
void |
configure(String widgetModelKey,
DataAttribute attribute)
Configures editor in the way that it may be used to manipulate with values of specified attribute.
|
protected <E extends org.zkoss.zk.ui.event.Event> |
createReferenceUpdateListener(DataAttribute attribute) |
void |
enableValidation(String modelKey,
String qualifier,
ValidatableContainer container)
Configures validation for editor.
|
protected String |
getAttributeDescription(String dataType,
String qualifier) |
protected String |
getAttributeLabel(String dataType,
String qualifier) |
protected ObjectValuePath |
getEditorPathPrefix(ObjectValuePath editorProperty,
String attributeQualifier) |
protected EditorRegistry |
getEditorRegistry() |
protected LabelService |
getLabelService() |
protected ObjectFacade |
getObjectFacade() |
protected PermissionFacade |
getPermissionFacade() |
ReferenceModelProperties |
getReferenceModelProperties() |
TypeFacade |
getTypeFacade() |
protected boolean |
isReferenceEditor(DataAttribute genericAttribute) |
protected Map<Pattern,String> |
prepareSinglingEditorMappings() |
void |
setAttached(DataAttribute attribute)
Configures editor in the way that it may be used to manipulate with values of specified attribute.
|
void |
setAttached(Object item,
DataAttribute attribute)
Configures editor in the way that it may be used to manipulate with values of specified attribute.
|
void |
setAttached(Object item,
String qualifier)
Configures editor in the way that it may be used to manipulate with values of specified attribute.
|
void |
setAttached(String qualifier)
Configures editor in the way that it may be used to manipulate with values of specified attribute.
|
void |
setAttached(String widgetModelKey,
String qualifier)
Configures editor in the way that it may be used to manipulate with values of specified attribute.
|
protected void |
setDefaults(DataAttribute attribute) |
protected void |
setDefaults(DataType dataType) |
void |
setDescription(String description)
Some editors are capable of decorating editor component with proper description (i.e.
|
void |
setEditorRegistry(EditorRegistry editorRegistry) |
void |
setLabel(String label)
Some editors are capable of decorating editor component with proper label (i.e.
|
void |
setLabelService(LabelService labelService) |
void |
setMultilingual(boolean multilingual)
Configures editor so that it allows to input values different languages.
|
void |
setMultilingual(boolean multilingual,
Object item)
Configures editor so that it allows to input values different languages.
|
void |
setMultilingual(boolean multilingual,
Set<Locale> locales)
Configures editor so that it allows to input values different languages.
|
void |
setObjectFacade(ObjectFacade objectFacade) |
void |
setPermissionFacade(PermissionFacade permissionFacade) |
void |
setReferenceModelProperties(ReferenceModelProperties referenceModelProperties) |
void |
setSingleValued()
Changes all multivalued editors into single-valued - i.e.
|
void |
setTypeFacade(TypeFacade typeFacade) |
protected void |
updateObjectsReferencedByEditor(DataAttribute attribute) |
void |
useDefaultEditor()
Resets editor, so that is uses the default one for previously configured data type
|
protected PermissionFacade getPermissionFacade()
public void setPermissionFacade(PermissionFacade permissionFacade)
protected EditorRegistry getEditorRegistry()
public void setEditorRegistry(EditorRegistry editorRegistry)
protected ObjectFacade getObjectFacade()
public void setObjectFacade(ObjectFacade objectFacade)
protected LabelService getLabelService()
public void setLabelService(LabelService labelService)
public TypeFacade getTypeFacade()
public void setTypeFacade(TypeFacade typeFacade)
public ReferenceModelProperties getReferenceModelProperties()
public void setReferenceModelProperties(ReferenceModelProperties referenceModelProperties)
public <VALUE> void addParameters(Map<String,VALUE> parameters)
parameters - parameters to be addedpublic void addParameter(String parameter, Object value)
parameter - parameter namevalue - parameterpublic void setSingleValued()
public void setAttached(DataAttribute attribute)
attribute - attribute which values will be changed by editorsetDefaults(DataAttribute)protected boolean isReferenceEditor(DataAttribute genericAttribute)
protected <E extends org.zkoss.zk.ui.event.Event> org.zkoss.zk.ui.event.EventListener<E> createReferenceUpdateListener(DataAttribute attribute)
protected void updateObjectsReferencedByEditor(DataAttribute attribute)
protected ObjectValuePath getEditorPathPrefix(ObjectValuePath editorProperty, String attributeQualifier)
public void setAttached(Object item, DataAttribute attribute)
item - item model which attribute will be changed by editorattribute - attribute which values will be changed by editorconfigure(Object, DataAttribute)public void setAttached(Object item, String qualifier)
item - item model which attribute will be changed by editorqualifier - qualifier of attribute which values will be changed by editorpublic void setAttached(String widgetModelKey, String qualifier)
widgetModelKey - 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 editorconfigure(String, DataAttribute)public void setAttached(String qualifier)
qualifier - qualifier of attribute which values will be changed by editorconfigure(String, DataAttribute)protected void setDefaults(DataType dataType)
protected void setDefaults(DataAttribute attribute)
public void configure(DataType dataType)
dataType - type of data that is to be editedpublic void configure(DataAttribute attribute)
attribute - attribute which values will be changed by editorsetAttached(DataAttribute)public void configure(Object item, DataAttribute attribute)
item - item model which attribute will be changed by editorattribute - attribute which values will be changed by editorsetAttached(Object, DataAttribute)public void configure(String widgetModelKey, DataAttribute attribute)
widgetModelKey - name of widget model value under which an item may be found, which attribute will be changed by editorattribute - attribute which values will be changed by editorsetAttached(String, String)public void setLabel(String label)
label - label to be usedpublic void setDescription(String description)
description - description to be usedpublic void setMultilingual(boolean multilingual)
multilingual - true if editor should allow providing values for different languagessetSingleValued()public void setMultilingual(boolean multilingual,
Object item)
multilingual - true if editor should allow providing values for different languagesitem - an item which values will be provided/displayed by editorPermissionFacade.getReadableLocalesForInstance(Object),
PermissionFacade.getWritableLocalesForInstance(Object)public void setMultilingual(boolean multilingual,
Set<Locale> locales)
multilingual - true if editor should allow providing values for different languageslocales - collection of locales for which value may be providedpublic void useDefaultEditor()
Editor.setType(String)public void 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.