Class UIBehaviourProvider

java.lang.Object
org.adempiere.base.UIBehaviourProvider

public class UIBehaviourProvider extends Object
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 Details

    • UIBehaviourProvider

      public UIBehaviourProvider()
  • Method Details

    • activate

      public void activate()
    • deactivate

      public void deactivate()
    • addIUIBehaviour

      public void addIUIBehaviour(IUIBehaviour behaviour)
    • removeIUIBehaviour

      public void removeIUIBehaviour(IUIBehaviour behaviour)
    • getLookupCacheKeySuffix

      public static String getLookupCacheKeySuffix(Lookup lookup, MLookupInfo lookupInfo)
      Concatenate all non-null suffixes returned by registered providers with | as separator, or return null if 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

      public static boolean isTabEditable(Properties ctx, GridTab tab)
      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.