- java.lang.Object
-
- org.tentackle.fx.table.DefaultTableConfigurationProvider<T>
-
- Type Parameters:
T- the table elements type
- All Implemented Interfaces:
TableConfigurationProvider<T>
public class DefaultTableConfigurationProvider<T> extends java.lang.Object implements TableConfigurationProvider<T>
Base implementation of aTableConfigurationProvider.The default implementation will add all bindable elements of the serviced class.
OverridecreateTableConfiguration()to customize.
If the class contains components and their bindables should be added instead, overrideaddBindableColumns(TableConfiguration, String...). Example:@TableConfigurationProviderService(value = TokenLockInfoDTO.class, noBundle = true) public class TokenLockInfoTableConfiguration extends DefaultTableConfigurationProvider<TokenLockInfoDTO> { @Override protected void addBindableColumns(TableConfiguration<TokenLockInfoDTO> configuration, String... components) { super.addBindableColumns(configuration, "pdoKey", "editedBy"); } }- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description DefaultTableConfigurationProvider()Creates a table configuration provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddBindableColumns(TableConfiguration<T> configuration, java.lang.String... components)Adds all bindable columns.
Override this method to specify the optional components.protected voidaddBindableColumns(TableConfiguration<T> configuration, java.lang.String columnPrefix, java.lang.String displayPrefix, java.lang.Class<?> clazz, java.lang.String... components)Recursively adds all bindable columns including components.TableConfiguration<T>createTableConfiguration()Creates the table configuration.
The default implementation adds all bindable elements and invokesaddBindableColumns(TableConfiguration, String...)without optional components.java.util.ResourceBundlegetBundle()Gets the resource bundle for this provider.booleanisBundleProvided()Returns whether a resource bundle is provided.
-
-
-
Method Detail
-
isBundleProvided
public boolean isBundleProvided()
Returns whether a resource bundle is provided.- Returns:
- true if provided, false if no bundle
-
getBundle
public java.util.ResourceBundle getBundle()
Gets the resource bundle for this provider.Throws
MissingResourceExceptionif no bundle found.- Returns:
- the resource bundle
-
createTableConfiguration
public TableConfiguration<T> createTableConfiguration()
Creates the table configuration.
The default implementation adds all bindable elements and invokesaddBindableColumns(TableConfiguration, String...)without optional components.- Specified by:
createTableConfigurationin interfaceTableConfigurationProvider<T>- Returns:
- the table configuration
-
addBindableColumns
protected void addBindableColumns(TableConfiguration<T> configuration, java.lang.String... components)
Adds all bindable columns.
Override this method to specify the optional components.- Parameters:
configuration- the table configurationcomponents- the binding path of components that should in turn be analyzed for bindables
-
addBindableColumns
protected void addBindableColumns(TableConfiguration<T> configuration, java.lang.String columnPrefix, java.lang.String displayPrefix, java.lang.Class<?> clazz, java.lang.String... components)
Recursively adds all bindable columns including components.- Parameters:
configuration- the table configurationcolumnPrefix- the prefix for the column namesdisplayPrefix- the prefix for the display namesclazz- the class to analyze for bindable elementscomponents- the binding path of components that should in turn be analyzed for bindables
-
-