public class EditorHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
EditorHelper.LanguageAwareEditorListener |
| Modifier and Type | Field and Description |
|---|---|
static String |
ALLOWED_VALUES_LIST |
static String |
EVENT_SOURCE |
| Constructor and Description |
|---|
EditorHelper() |
| Modifier and Type | Method and Description |
|---|---|
static CreateContext |
applyReferenceRelatedAttributes(ReferenceUIEditor referenceEditor,
PropertyDescriptor propertyDescriptor,
Map<String,? extends Object> parameters,
TypedObject currentObject,
Object currentValue,
String isoCode,
UICockpitArea cockpitArea,
UISession session) |
protected static boolean |
checkLanguageVisibility(TypedObject item,
String languageIso) |
static void |
createEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist)
Convenience method for creating and rendering a
UIEditor. |
static void |
createEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
EditorListener editorListener,
String editorCode)
Convenience method for creating and rendering a
UIEditor variant specified by editorCode. |
static void |
createEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
String editorCode)
Convenience method for creating and rendering a
UIEditor variant specified by editorCode. |
static void |
createEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
String editorCode,
Map<String,? extends Object> params)
Convenience method for creating and rendering a
UIEditor variant specified by editorCode. |
static void |
createEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
String editorCode,
Map<String,? extends Object> params,
boolean focus)
Convenience method for creating and rendering a
UIEditor variant specified by editorCode. |
static void |
createEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
String editorCode,
Map<String,? extends Object> params,
EditorListener editorListener)
Convenience method for creating and rendering a
UIEditor variant specified by editorCode. |
static void |
createEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
String editorCode,
Map<String,? extends Object> params,
EditorListener editorListener,
boolean focus)
Convenience method for creating and rendering a
UIEditor variant specified by editorCode. |
static void |
createEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
EditorListener editorListener,
boolean autoPersist)
Convenience method for creating and rendering a
UIEditor. |
static <T> List<? extends T> |
filterValues(PropertyDescriptor propDescr,
List<? extends T> values)
Deprecated.
|
static List<Object> |
getAvailableValues(Map<String,? extends Object> params,
PropertyDescriptor propertyDescriptor)
Gets available values for a ListUIEditor using configured
AvailableValuesProvider spring bean. |
static TypedObject |
getCatalogVersionIfPresent(TypedObject item) |
static SearchType |
getRootSearchType(PropertyDescriptor propDescr,
UISession session) |
protected static UIAccessRightService |
getUIAccessRightService() |
static UIEditor |
getUIEditor(PropertyDescriptor propDescr,
String editorCode)
Convenience method for creating and retrieving a
UIEditor. |
static void |
initializeSections(EditorConfiguration cfg,
ObjectType type,
TypedObject object,
TypeService typeService) |
static boolean |
isEditable(PropertyDescriptor propDescr,
boolean creationMode)
Deprecated.
Use
UIAccessRightService's isWritable methods instead. |
static Set<ObjectType> |
parseTemplateCodes(String input,
TypeService typeService) |
static void |
persistValues(TypedObject item,
ObjectValueContainer valueContainer) |
static void |
persistValues(TypedObject item,
ObjectValueContainer valueContainer,
Map<String,? extends Object> params) |
static ObjectTemplate |
processVariantTypeCheck(ObjectTemplate type,
TypedObject object,
PropertyDescriptor propertyDescriptor,
TypeService typeService) |
static List<String> |
removeHiddenLanguages(TypedObject item,
Collection<String> languages) |
static void |
renderLocalizedEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
String editorCode,
Map<String,? extends Object> params,
boolean focus) |
static void |
renderLocalizedEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
String editorCode,
Map<String,? extends Object> params,
boolean focus,
EditorListener editorListener) |
static void |
renderSingleEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
String editorCode,
Map<String,? extends Object> params,
String isoCode,
boolean focus) |
static void |
renderSingleEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
String editorCode,
Map<String,? extends Object> params,
String isoCode,
boolean focus,
EditorListener editorListener) |
static void |
setAvailableValuesInListEditor(ListUIEditor editor,
PropertyDescriptor propertyDescriptor,
Map<String,? extends Object> params)
Helper method to set available values in
ListUIEditor editor. |
static void |
tryOpenContextAreaEditor(UICockpitPerspective perspective,
ObjectTemplate type,
Collection value,
TypedObject currentObject,
PropertyDescriptor propertyDescriptor,
Map<String,? extends Object> parameters) |
public static final String EVENT_SOURCE
public static final String ALLOWED_VALUES_LIST
public static CreateContext applyReferenceRelatedAttributes(ReferenceUIEditor referenceEditor, PropertyDescriptor propertyDescriptor, Map<String,? extends Object> parameters, TypedObject currentObject, Object currentValue, String isoCode, UICockpitArea cockpitArea, UISession session)
public static void createEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist) throws IllegalArgumentException
UIEditor. Handles editor events and loads/stores data
from/to the specified ObjectValueContainer valueContainer.
If autoPersist is true values are stored in the value container and instantly persisted.
Creates the default editor for the property type specified. Internally calls
createEditor(propDescr, parent, valueContainer, null).item - the item instance for which an editor is to be createdpropDescr - the property descriptor for which a corresponding editor is to be createdparent - the parent component to which the editor is to be addedvalueContainer - the ObjectValueContainer used for loading/storing valuesautoPersist - whether values should be automatically persisted or notIllegalArgumentException - if the property descriptor, parent component or value container is invalidcreateEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map),
getUIEditor(PropertyDescriptor, String)public static void createEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, EditorListener editorListener, String editorCode) throws IllegalArgumentException
UIEditor variant specified by editorCode.
Handles editor events and loads/stores data from/to the specified ObjectValueContainer
valueContainer.
If autoPersist is true values are stored in the value container and instantly persisted.
In order to create the default editor for the specified property use
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean) instead.item - the item instance for which an editor is to be createdpropDescr - the property descriptor for which a corresponding editor is to be createdparent - the parent component to which the editor is to be addedvalueContainer - the ObjectValueContainer used for loading/storing valuesautoPersist - whether values should be automatically persisted or noteditorListener - current editor listener instance EditorListenereditorCode - the editor variant to be created or null for the default oneIllegalArgumentException - if the property descriptor, parent component or value container is invalidcreateEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, EditorListener,
boolean),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, EditorListener),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, EditorListener, boolean),
getUIEditor(PropertyDescriptor, String)public static void createEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, String editorCode) throws IllegalArgumentException
UIEditor variant specified by editorCode.
Handles editor events and loads/stores data from/to the specified ObjectValueContainer
valueContainer.
If autoPersist is true values are stored in the value container and instantly persisted.
In order to create the default editor for the specified property use
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean) instead.item - the item instance for which an editor is to be createdpropDescr - the property descriptor for which a corresponding editor is to be createdparent - the parent component to which the editor is to be addedvalueContainer - the ObjectValueContainer used for loading/storing valuesautoPersist - whether values should be automatically persisted or noteditorCode - the editor variant to be created or null for the default oneIllegalArgumentException - if the property descriptor, parent component or value container is invalidcreateEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map),
getUIEditor(PropertyDescriptor, String)public static void createEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, String editorCode, Map<String,? extends Object> params) throws IllegalArgumentException
UIEditor variant specified by editorCode.
Handles editor events and loads/stores data from/to the specified ObjectValueContainer
valueContainer.
If autoPersist is true values are stored in the value container and instantly persisted.
In order to create the default editor for the specified property use
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean) instead.item - the item instance for which an editor is to be createdpropDescr - the property descriptor for which a corresponding editor is to be createdparent - the parent component to which the editor is to be addedvalueContainer - the ObjectValueContainer used for loading/storing valuesautoPersist - whether values should be automatically persisted or noteditorCode - the editor variant to be created or null for the default oneparams - creation parametersIllegalArgumentException - if the property descriptor, parent component or value container is invalidcreateEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, boolean),
getUIEditor(PropertyDescriptor, String)public static void createEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, String editorCode, Map<String,? extends Object> params, boolean focus) throws IllegalArgumentException
UIEditor variant specified by editorCode.
Handles editor events and loads/stores data from/to the specified ObjectValueContainer
valueContainer.
If autoPersist is true values are stored in the value container and instantly persisted.
In order to create the default editor for the specified property use
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean) instead.item - the item instance for which an editor is to be createdpropDescr - the property descriptor for which a corresponding editor is to be createdparent - the parent component to which the editor is to be addedvalueContainer - the ObjectValueContainer used for loading/storing valuesautoPersist - whether values should be automatically persisted or noteditorCode - the editor variant to be created or null for the default oneparams - creation parametersfocus - whether the created editor should be given initial focus or notIllegalArgumentException - if the property descriptor, parent component or value container is invalidcreateEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean),
getUIEditor(PropertyDescriptor, String)public static void createEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, String editorCode, Map<String,? extends Object> params, EditorListener editorListener) throws IllegalArgumentException
UIEditor variant specified by editorCode.
Handles editor events and loads/stores data from/to the specified ObjectValueContainer
valueContainer.
If autoPersist is true values are stored in the value container and instantly persisted.
In order to create the default editor for the specified property use
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean) instead.item - the item instance for which an editor is to be createdpropDescr - the property descriptor for which a corresponding editor is to be createdparent - the parent component to which the editor is to be addedvalueContainer - the ObjectValueContainer used for loading/storing valuesautoPersist - whether values should be automatically persisted or noteditorCode - the editor variant to be created or null for the default oneparams - creation parameterseditorListener - current editor listener instance EditorListenerIllegalArgumentException - if the property descriptor, parent component or value container is invalidcreateEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, EditorListener,
boolean),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean,
EditorListener, String),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, EditorListener, boolean),
getUIEditor(PropertyDescriptor, String)public static void createEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, String editorCode, Map<String,? extends Object> params, EditorListener editorListener, boolean focus) throws IllegalArgumentException
UIEditor variant specified by editorCode.
Handles editor events and loads/stores data from/to the specified ObjectValueContainer
valueContainer.
If autoPersist is true values are stored in the value container and instantly persisted.
In order to create the default editor for the specified property use
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean) instead.item - the item instance for which an editor is to be createdpropDescr - the property descriptor for which a corresponding editor is to be createdparent - the parent component to which the editor is to be addedvalueContainer - the ObjectValueContainer used for loading/storing valuesautoPersist - whether values should be automatically persisted or noteditorCode - the editor variant to be created or null for the default oneparams - creation parameterseditorListener - current editor listener instance EditorListenerfocus - whether the created editor should be given initial focus or notIllegalArgumentException - if the property descriptor, parent component or value container is invalidcreateEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, EditorListener,
boolean),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean,
EditorListener, String),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, EditorListener),
getUIEditor(PropertyDescriptor, String)public static void createEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, EditorListener editorListener, boolean autoPersist) throws IllegalArgumentException
UIEditor. Handles editor events and loads/stores data
from/to the specified ObjectValueContainer valueContainer.
If autoPersist is true values are stored in the value container and instantly persisted.
Creates the default editor for the property type specified. Internally calls
createEditor(propDescr, parent, valueContainer, null).item - the item instance for which an editor is to be createdpropDescr - the property descriptor for which a corresponding editor is to be createdparent - the parent component to which the editor is to be addedvalueContainer - the ObjectValueContainer used for loading/storing valueseditorListener - current editor listener instance EditorListenerautoPersist - whether values should be automatically persisted or notIllegalArgumentException - if the property descriptor, parent component or value container is invalidcreateEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean,
EditorListener, String),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, EditorListener),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, EditorListener, boolean),
getUIEditor(PropertyDescriptor, String)@Deprecated public static <T> List<? extends T> filterValues(PropertyDescriptor propDescr, List<? extends T> values)
public static SearchType getRootSearchType(PropertyDescriptor propDescr, UISession session)
protected static UIAccessRightService getUIAccessRightService()
public static UIEditor getUIEditor(PropertyDescriptor propDescr, String editorCode) throws IllegalArgumentException
UIEditor.
Note: If no editor variant is found with the code editorCode, the default editor for the
specified property is returned.propDescr - the property descriptor for which a corresponding editor is to be retrievededitorCode - the editor variant to be usedUIEditor instance for the specified property and - if available - for the specified editor
variantIllegalArgumentException - if the property descriptor is invalidcreateEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, boolean),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, EditorListener,
boolean),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean,
EditorListener, String),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, EditorListener),
createEditor(TypedObject, PropertyDescriptor, HtmlBasedComponent, ObjectValueContainer, boolean, String,
Map, EditorListener, boolean)public static void initializeSections(EditorConfiguration cfg, ObjectType type, TypedObject object, TypeService typeService)
@Deprecated public static boolean isEditable(PropertyDescriptor propDescr, boolean creationMode)
UIAccessRightService's isWritable methods instead.propDescr - the property descriptortrue if the property is editable, false otherwisepublic static void persistValues(TypedObject item, ObjectValueContainer valueContainer) throws ValueHandlerException
ValueHandlerExceptionpublic static void persistValues(TypedObject item, ObjectValueContainer valueContainer, Map<String,? extends Object> params) throws ValueHandlerException
ValueHandlerExceptionpublic static ObjectTemplate processVariantTypeCheck(ObjectTemplate type, TypedObject object, PropertyDescriptor propertyDescriptor, TypeService typeService)
public static void tryOpenContextAreaEditor(UICockpitPerspective perspective, ObjectTemplate type, Collection value, TypedObject currentObject, PropertyDescriptor propertyDescriptor, Map<String,? extends Object> parameters)
public static final Set<ObjectType> parseTemplateCodes(String input, TypeService typeService)
public static void renderLocalizedEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, String editorCode, Map<String,? extends Object> params, boolean focus)
protected static boolean checkLanguageVisibility(TypedObject item, String languageIso)
public static void renderLocalizedEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, String editorCode, Map<String,? extends Object> params, boolean focus, EditorListener editorListener)
public static void renderSingleEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, String editorCode, Map<String,? extends Object> params, String isoCode, boolean focus)
public static void renderSingleEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, String editorCode, Map<String,? extends Object> params, String isoCode, boolean focus, EditorListener editorListener)
public static List<Object> getAvailableValues(Map<String,? extends Object> params, PropertyDescriptor propertyDescriptor)
AvailableValuesProvider spring bean. Spring
bean's name is passed as a value of the ALLOWED_VALUES_LIST configuration parameter -
ALLOWED_VALUES_LISTpublic static void setAvailableValuesInListEditor(ListUIEditor editor, PropertyDescriptor propertyDescriptor, Map<String,? extends Object> params)
ListUIEditor editor. First it tries to use configured
AvailableValuesProvider spring bean to get a list of available values. If no bean is configured, it uses
TypeService.getAvailableValues(PropertyDescriptor) method.editor - target editor.propertyDescriptor - The property descriptor of the property to be set with one of the "available values".params - keeps the set of parameters configured for the editor.public static TypedObject getCatalogVersionIfPresent(TypedObject item)
public static List<String> removeHiddenLanguages(TypedObject item, Collection<String> languages)
Copyright © 2017 SAP SE. All Rights Reserved.