Package org.adempiere.base
Interface IUIBehaviour
public interface IUIBehaviour
IDEMPIERE-7024
OSGi extension point that lets a plugin participate in three UI decisions:
- lookup cache partitioning via
getLookupCacheKeySuffix(org.compiere.model.Lookup, org.compiere.model.MLookupInfo)
- whether a tab is editable (e.g. workflow approval, role-based read-only)
- whether a single field is editable (e.g. PII masking for certain roles,
license-based feature gating)
Lookup cache
A non-null suffix appended to the cache key creates an isolated cache bucket (e.g. one per history date) using the existingCCache
infrastructure — caching stays active, just partitioned.
Returning null (the default) is a no-op with zero overhead.
Veto semantics
Boolean methods use veto semantics: return true when not relevant (neutral/allow), false to deny. The aggregator inUIBehaviourProvider returns false as soon
as any provider returns false.
Implementations must be registered via OSGi Declarative Services as
providers of this interface. The core helper UIBehaviourProvider iterates
all registered providers and aggregates their answers with AND logic.-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetLookupCacheKeySuffix(Lookup lookup, MLookupInfo lookupInfo) Return a suffix appended to the lookup cache key to create an isolated cache bucket, ornullto use the standard key.booleanisFieldEditable(Properties ctx, GridField field, boolean checkContext, boolean isGrid) Additional check on field editability.booleanisTabEditable(Properties ctx, GridTab tab) Additional check on tab editability.
-
Method Details
-
getLookupCacheKeySuffix
Return a suffix appended to the lookup cache key to create an isolated cache bucket, ornullto use the standard key.Example: a time-machine provider returns
"HST@2026-06-23"so each history date gets its own cache partition while caching stays active. In normal (non-time-travel) mode the provider returnsnull— zero overhead, identical to vanilla iDempiere.- Parameters:
lookup- the lookup being evaluatedlookupInfo- the lookup info (may be null)- Returns:
- null to use the standard cache key, or a non-empty string to partition
-
isTabEditable
Additional check on tab editability. The tab is editable only if EVERY registered provider allows it.- Parameters:
ctx- current contexttab- the tab being evaluated- Returns:
- true to allow edit (or when not relevant), false to deny
-
isFieldEditable
Additional check on field editability. The field is editable only if EVERY registered provider allows it.- Parameters:
ctx- current contextfield- the field being evaluatedcheckContext- pass-through flag from GridField.isEditableisGrid- pass-through flag from GridField.isEditable- Returns:
- true to allow edit (or when not relevant), false to deny
-