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(...);
 

Call freeze() during application startup to prevent further modifications once the initial configuration is established.

  • 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.
    • 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()
    • resolve

      public <V> ColumnConfiguration<V> resolve(Class<V> type)
      Returns the effective ColumnConfiguration for the given type. When frozen, returns the nearest registered configuration walking the class hierarchy, or null if none. When not frozen, creates a configuration if one does not yet exist.
      Parameters:
      type - the column value type
      Returns:
      the resolved configuration, or null when frozen and no config was registered