Class GlobalEasyGridConfiguration

java.lang.Object
com.flowingcode.vaadin.addons.easygrid.config.GlobalEasyGridConfiguration

public class GlobalEasyGridConfiguration extends Object
System-wide EasyGrid configuration. Configurations registered here apply to all EasyGrid instances across all sessions.

Use forType(Class) to obtain a configuration for a given type:

 GlobalEasyGridConfiguration.forType(LocalDate.class).setRendererFactory(...);
 

Startup and thread safety: This class is a mutable static singleton shared across all user sessions. All calls to forType(Class) must be made during application startup, before any session is created, to avoid data races between concurrent sessions. Call freeze() at the end of startup to lock the configuration and prevent accidental post-startup modifications. Omitting freeze() is a stability risk: any code that runs after startup — including request-handling code — could inadvertently alter rendering for every active session.

  • Constructor Details

    • GlobalEasyGridConfiguration

      public GlobalEasyGridConfiguration()
  • Method Details

    • freeze

      public static void freeze()
      Freezes the global configuration, preventing further calls to forType(Class), which will throw IllegalStateException once frozen. Freezing is irreversible. This method should be called at the end of application startup, after all type configurations have been registered.
    • forType

      public static <V> ColumnConfiguration<V> forType(Class<V> type)
      Returns the ColumnConfiguration for the given type at the global level, creating it if it does not yet exist. Modifications to the returned configuration take effect immediately.
      Parameters:
      type - the column value type
      Returns:
      the ColumnConfiguration for the given type
      Throws:
      IllegalStateException - if the global configuration has been frozen via freeze()