public class ViewUpdateUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ViewUpdateUtils.UpdateCallbackObject
An object that can be attached to a zk component
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MODIFIED_ITEM_KEY |
static java.lang.String |
MODIFIED_PROPERTIES_KEY |
| Constructor and Description |
|---|
ViewUpdateUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
createItemPropertyContext(TypedObject item,
java.util.Collection<PropertyDescriptor> modifiedProperties)
Convenience method to create a context map that can be checked later by
isMatchingItemPropertyContext(Map, TypedObject, PropertyDescriptor) and
isUpdateNeeded(Map, TypedObject, PropertyDescriptor, TypeService, ValueService). |
static boolean |
isMatchingItemPropertyContext(java.util.Map<java.lang.String,java.lang.Object> ctx,
TypedObject item,
PropertyDescriptor propertyDescriptor)
Checks, if a TypedObject and PropertyDescriptor is contained in the given context
|
static boolean |
isUpdateNeeded(java.util.Map<java.lang.String,java.lang.Object> ctx,
TypedObject item,
PropertyDescriptor propertyDescriptor,
TypeService typeService,
ValueService valueService)
Utility method to check, if an update is needed regarding to changes of an item.
|
static void |
performViewUpdate(Component component,
java.util.Map<java.lang.String,java.lang.Object> ctx,
boolean recursive)
Try to update the current zk component, according to the attached
ViewUpdateUtils.UpdateCallbackObject object. |
static void |
setUpdateCallback(Component component,
ViewUpdateUtils.UpdateCallbackObject updateCallbackObject)
Attaches an
ViewUpdateUtils.UpdateCallbackObject object to a zk component |
static void |
suppressNextUpdateOn(Component component)
Marks the given zk component to prevent an update at the next run of
performViewUpdate(Component, Map, boolean). |
public static final java.lang.String MODIFIED_PROPERTIES_KEY
public static final java.lang.String MODIFIED_ITEM_KEY
public static void performViewUpdate(Component component,
java.util.Map<java.lang.String,java.lang.Object> ctx,
boolean recursive)
ViewUpdateUtils.UpdateCallbackObject object. If
recursive is set to true, also recursively updates the child components.component - the zk component to updatectx - additional context parameters, which are passed to the
ViewUpdateUtils.UpdateCallbackObject.update(Component, Map) method.recursive - true, if the update should include all child componentspublic static void setUpdateCallback(Component component,
ViewUpdateUtils.UpdateCallbackObject updateCallbackObject)
ViewUpdateUtils.UpdateCallbackObject object to a zk componentcomponent - the zk componentupdateCallbackObject - an instance of ViewUpdateUtils.UpdateCallbackObjectpublic static void suppressNextUpdateOn(Component component)
performViewUpdate(Component, Map, boolean). This is pretty useful e.g. when changing a value in a cockpit
editor which usually causes an item changed event that again may the reason for re-rendering the editor. In most
cases this is not necessary, since the change is immediately reflected to the editor and a re-rendering will lose
the focus on it.component - the componentpublic static boolean isUpdateNeeded(java.util.Map<java.lang.String,java.lang.Object> ctx,
TypedObject item,
PropertyDescriptor propertyDescriptor,
TypeService typeService,
ValueService valueService)
isMatchingItemPropertyContext(Map, TypedObject, PropertyDescriptor) and does some additionally tests, if
the changed item may be referenced by the propertyctx - a map that contains informations about modified item and properties, mapped to the keys
MODIFIED_ITEM_KEY and MODIFIED_PROPERTIES_KEYitem - the item that should be checked against the contextpropertyDescriptor - the property the should be checked against the contexttypeService - the typeServicepublic static boolean isMatchingItemPropertyContext(java.util.Map<java.lang.String,java.lang.Object> ctx,
TypedObject item,
PropertyDescriptor propertyDescriptor)
ctx - a map that contains informations about modified item and properties, mapped to the keys
MODIFIED_ITEM_KEY and MODIFIED_PROPERTIES_KEYitem - the item that should be checked against the contextpropertyDescriptor - the property the should be checked against the contextpublic static java.util.Map<java.lang.String,java.lang.Object> createItemPropertyContext(TypedObject item, java.util.Collection<PropertyDescriptor> modifiedProperties)
isMatchingItemPropertyContext(Map, TypedObject, PropertyDescriptor) and
isUpdateNeeded(Map, TypedObject, PropertyDescriptor, TypeService, ValueService).item - the item that should be added to the contextmodifiedProperties - the properties that should be added to the contextCopyright © 2018 SAP SE. All Rights Reserved.