public class EditorHelper
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
EditorHelper.LanguageAwareEditorListener |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALLOWED_VALUES_LIST |
static java.lang.String |
EVENT_SOURCE |
protected static java.lang.String |
PARAM_DISABLE_DRAG_AND_DROP |
| Constructor and Description |
|---|
EditorHelper() |
| Modifier and Type | Method and Description |
|---|---|
static CreateContext |
applyReferenceRelatedAttributes(ReferenceUIEditor referenceEditor,
PropertyDescriptor propertyDescriptor,
java.util.Map<java.lang.String,? extends java.lang.Object> parameters,
TypedObject currentObject,
java.lang.Object currentValue,
java.lang.String isoCode,
UICockpitArea cockpitArea,
UISession session) |
protected static boolean |
checkLanguageVisibility(TypedObject item,
java.lang.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,
java.lang.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,
java.lang.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,
java.lang.String editorCode,
java.util.Map<java.lang.String,? extends java.lang.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,
java.lang.String editorCode,
java.util.Map<java.lang.String,? extends java.lang.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,
java.lang.String editorCode,
java.util.Map<java.lang.String,? extends java.lang.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,
java.lang.String editorCode,
java.util.Map<java.lang.String,? extends java.lang.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> java.util.List<? extends T> |
filterValues(PropertyDescriptor propDescr,
java.util.List<? extends T> values)
Deprecated.
since 6.3
|
static java.util.List<java.lang.Object> |
getAvailableValues(java.util.Map<java.lang.String,? extends java.lang.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,
java.lang.String editorCode)
Convenience method for creating and retrieving a
UIEditor. |
static void |
initializeSections(EditorConfiguration cfg,
ObjectType type,
TypedObject object,
TypeService typeService) |
static boolean |
isDragAndDropDisabled(java.util.Map<java.lang.String,? extends java.lang.Object> parameters)
Check whether "Drag & Drop" action for item's qualifier paremeter is disabled.
|
static boolean |
isEditable(PropertyDescriptor propDescr,
boolean creationMode)
Deprecated.
since 6.3, use
UIAccessRightService's isWritable methods instead. |
static java.util.Set<ObjectType> |
parseTemplateCodes(java.lang.String input,
TypeService typeService) |
static void |
persistValues(TypedObject item,
ObjectValueContainer valueContainer) |
static void |
persistValues(TypedObject item,
ObjectValueContainer valueContainer,
java.util.Map<java.lang.String,? extends java.lang.Object> params) |
static ObjectTemplate |
processVariantTypeCheck(ObjectTemplate type,
TypedObject object,
PropertyDescriptor propertyDescriptor,
TypeService typeService) |
static java.util.List<java.lang.String> |
removeHiddenLanguages(TypedObject item,
java.util.Collection<java.lang.String> languages) |
static void |
renderLocalizedEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
java.lang.String editorCode,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
boolean focus) |
static void |
renderLocalizedEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
java.lang.String editorCode,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
boolean focus,
EditorListener editorListener) |
static void |
renderSingleEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
java.lang.String editorCode,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
java.lang.String isoCode,
boolean focus) |
static void |
renderSingleEditor(TypedObject item,
PropertyDescriptor propDescr,
HtmlBasedComponent parent,
ObjectValueContainer valueContainer,
boolean autoPersist,
java.lang.String editorCode,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
java.lang.String isoCode,
boolean focus,
EditorListener editorListener) |
static void |
setAvailableValuesInListEditor(ListUIEditor editor,
PropertyDescriptor propertyDescriptor,
java.util.Map<java.lang.String,? extends java.lang.Object> params)
Helper method to set available values in
ListUIEditor editor. |
static void |
tryOpenContextAreaEditor(UICockpitPerspective perspective,
ObjectTemplate type,
java.util.Collection value,
TypedObject currentObject,
PropertyDescriptor propertyDescriptor,
java.util.Map<java.lang.String,? extends java.lang.Object> parameters) |
public static final java.lang.String EVENT_SOURCE
public static final java.lang.String ALLOWED_VALUES_LIST
protected static final java.lang.String PARAM_DISABLE_DRAG_AND_DROP
public static CreateContext applyReferenceRelatedAttributes(ReferenceUIEditor referenceEditor, PropertyDescriptor propertyDescriptor, java.util.Map<java.lang.String,? extends java.lang.Object> parameters, TypedObject currentObject, java.lang.Object currentValue, java.lang.String isoCode, UICockpitArea cockpitArea, UISession session)
public static void createEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist) throws java.lang.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 notjava.lang.IllegalArgumentException - 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, java.lang.String editorCode) throws java.lang.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 onejava.lang.IllegalArgumentException - 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, java.lang.String editorCode) throws java.lang.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 onejava.lang.IllegalArgumentException - 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, java.lang.String editorCode, java.util.Map<java.lang.String,? extends java.lang.Object> params) throws java.lang.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 parametersjava.lang.IllegalArgumentException - 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, java.lang.String editorCode, java.util.Map<java.lang.String,? extends java.lang.Object> params, boolean focus) throws java.lang.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 notjava.lang.IllegalArgumentException - 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, java.lang.String editorCode, java.util.Map<java.lang.String,? extends java.lang.Object> params, EditorListener editorListener) throws java.lang.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 EditorListenerjava.lang.IllegalArgumentException - 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, java.lang.String editorCode, java.util.Map<java.lang.String,? extends java.lang.Object> params, EditorListener editorListener, boolean focus) throws java.lang.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 notjava.lang.IllegalArgumentException - 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 java.lang.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 notjava.lang.IllegalArgumentException - 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> java.util.List<? extends T> filterValues(PropertyDescriptor propDescr, java.util.List<? extends T> values)
public static SearchType getRootSearchType(PropertyDescriptor propDescr, UISession session)
protected static UIAccessRightService getUIAccessRightService()
public static UIEditor getUIEditor(PropertyDescriptor propDescr, java.lang.String editorCode) throws java.lang.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
variantjava.lang.IllegalArgumentException - 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, java.util.Map<java.lang.String,? extends java.lang.Object> params) throws ValueHandlerException
ValueHandlerExceptionpublic static ObjectTemplate processVariantTypeCheck(ObjectTemplate type, TypedObject object, PropertyDescriptor propertyDescriptor, TypeService typeService)
public static void tryOpenContextAreaEditor(UICockpitPerspective perspective, ObjectTemplate type, java.util.Collection value, TypedObject currentObject, PropertyDescriptor propertyDescriptor, java.util.Map<java.lang.String,? extends java.lang.Object> parameters)
public static final java.util.Set<ObjectType> parseTemplateCodes(java.lang.String input, TypeService typeService)
public static void renderLocalizedEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, java.lang.String editorCode, java.util.Map<java.lang.String,? extends java.lang.Object> params, boolean focus)
protected static boolean checkLanguageVisibility(TypedObject item, java.lang.String languageIso)
public static void renderLocalizedEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, java.lang.String editorCode, java.util.Map<java.lang.String,? extends java.lang.Object> params, boolean focus, EditorListener editorListener)
public static void renderSingleEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, java.lang.String editorCode, java.util.Map<java.lang.String,? extends java.lang.Object> params, java.lang.String isoCode, boolean focus)
public static void renderSingleEditor(TypedObject item, PropertyDescriptor propDescr, HtmlBasedComponent parent, ObjectValueContainer valueContainer, boolean autoPersist, java.lang.String editorCode, java.util.Map<java.lang.String,? extends java.lang.Object> params, java.lang.String isoCode, boolean focus, EditorListener editorListener)
public static java.util.List<java.lang.Object> getAvailableValues(java.util.Map<java.lang.String,? extends java.lang.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, java.util.Map<java.lang.String,? extends java.lang.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 java.util.List<java.lang.String> removeHiddenLanguages(TypedObject item, java.util.Collection<java.lang.String> languages)
public static boolean isDragAndDropDisabled(java.util.Map<java.lang.String,? extends java.lang.Object> parameters)
parameters - - all item's qualifier parametersCopyright © 2018 SAP SE. All Rights Reserved.