Package org.adempiere.base
Class UIBehaviourProvider
java.lang.Object
org.adempiere.base.UIBehaviourProvider
IDEMPIERE-7024
Static helper that aggregates the three UI decisions exposed by
IUIBehaviour.
Registered as an immediate OSGi DS component; all IUIBehaviour providers
are injected via @Reference (cardinality 0..n, dynamic policy).
The static methods delegate to the component instance so callers
(MLookup, GridField) need no OSGi awareness.
For each decision the aggregator applies AND/veto logic:
- all providers return true -> true
- at least one provider returns false -> false
With no registered provider returns true (vanilla behaviour).
Provider failures are isolated: any Exception raised by a provider is
logged at WARNING and treated as neutral (allowing), so a single bad plug-in
cannot abort lookup resolution or field-editability for the whole window.
JVM errors (OutOfMemoryError, etc.) are intentionally not caught and propagate normally.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidaddIUIBehaviour(IUIBehaviour behaviour) voidstatic StringgetLookupCacheKeySuffix(Lookup lookup, MLookupInfo lookupInfo) Concatenate all non-null suffixes returned by registered providers with|as separator, or returnnullif no provider supplies one.static booleanisFieldEditable(Properties ctx, GridField field, boolean checkContext, boolean isGrid) static booleanisTabEditable(Properties ctx, GridTab tab) voidremoveIUIBehaviour(IUIBehaviour behaviour)
-
Constructor Details
-
UIBehaviourProvider
public UIBehaviourProvider()
-
-
Method Details
-
activate
public void activate() -
deactivate
public void deactivate() -
addIUIBehaviour
-
removeIUIBehaviour
-
getLookupCacheKeySuffix
Concatenate all non-null suffixes returned by registered providers with|as separator, or returnnullif no provider supplies one. Each provider contributes an independent dimension to the composite cache key (e.g."HST@2026-06-23|ROLE@admin"), keeping caching active and well-defined for any number of registered providers.- Returns:
- concatenated suffixes, or null if no provider supplies one
-
isTabEditable
- Returns:
- true if every registered IUIBehaviour allows tab editing, or if no provider is registered.
-
isFieldEditable
public static boolean isFieldEditable(Properties ctx, GridField field, boolean checkContext, boolean isGrid) - Returns:
- true if every registered IUIBehaviour allows field editing, or if no provider is registered.
-