Class GlobalEasyGridConfiguration
java.lang.Object
com.flowingcode.vaadin.addons.easygrid.config.GlobalEasyGridConfiguration
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> ColumnConfiguration<V>Returns theColumnConfigurationfor the given type at the global level, creating it if it does not yet exist.static voidfreeze()Freezes the global configuration, preventing further calls toforType(Class), which will throwIllegalStateExceptiononce frozen.<V> ColumnConfiguration<V>Returns the effectiveColumnConfigurationfor the given type.
-
Constructor Details
-
GlobalEasyGridConfiguration
public GlobalEasyGridConfiguration()
-
-
Method Details
-
freeze
public static void freeze()Freezes the global configuration, preventing further calls toforType(Class), which will throwIllegalStateExceptiononce frozen. Freezing is irreversible. -
forType
Returns theColumnConfigurationfor 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
ColumnConfigurationfor the given type - Throws:
IllegalStateException- if the global configuration has been frozen viafreeze()
-
resolve
Returns the effectiveColumnConfigurationfor the given type. When frozen, returns the nearest registered configuration walking the class hierarchy, ornullif none. When not frozen, creates a configuration if one does not yet exist.- Parameters:
type- the column value type- Returns:
- the resolved configuration, or
nullwhen frozen and no config was registered
-