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 Object
implements TableConfigurationProvider<T>
Base implementation of a
TableConfigurationProvider
.
The default implementation will add all bindable elements of the serviced class.
Override createTableConfiguration()
to customize.
If the class contains components and their bindables should be added instead, override
addBindableColumns(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
ConstructorDescriptionCreates a table configuration provider.DefaultTableConfigurationProvider
(Class<T> clazz, boolean bundleProvided, TableConfiguration.BINDING bindingType) Creates a table configuration provider. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addBindableColumns
(TableConfiguration<T> configuration, String... components) Adds all bindable columns.
Override this method to specify the optional components.protected void
addBindableColumns
(TableConfiguration<T> configuration, String columnPrefix, String displayPrefix, Class<?> clazz, String... components) Recursively adds all bindable columns including components.protected final TableConfiguration
<T> Creates only the instance of a table configuration w/o column configs.
Override this method to create application-specific implementations.protected TableConfiguration
<T> Creates only the instance of a table configuration w/o column configs.
Override this method to create application-specific implementations.Creates the table configuration.
The default implementation adds all bindable elements and invokesaddBindableColumns(TableConfiguration, String...)
without optional components.Gets the resource bundle for this provider.Gets the table element's class.boolean
Returns whether a resource bundle is provided.
-
Constructor Details
-
DefaultTableConfigurationProvider
public DefaultTableConfigurationProvider()Creates a table configuration provider. -
DefaultTableConfigurationProvider
public DefaultTableConfigurationProvider(Class<T> clazz, boolean bundleProvided, TableConfiguration.BINDING bindingType) Creates a table configuration provider.- Parameters:
clazz
- the table element's classbundleProvided
- true if resource bundle is providedbindingType
- the table binding type
-
-
Method Details
-
getElementClass
Gets the table element's class.- Returns:
- the class
-
isBundleProvided
public boolean isBundleProvided()Returns whether a resource bundle is provided.- Returns:
- true if provided, false if no bundle
-
getBundle
Gets the resource bundle for this provider.Throws
MissingResourceException
if no bundle found.- Returns:
- the resource bundle
-
createTableConfiguration
Creates the table configuration.
The default implementation adds all bindable elements and invokesaddBindableColumns(TableConfiguration, String...)
without optional components.- Specified by:
createTableConfiguration
in interfaceTableConfigurationProvider<T>
- Returns:
- the table configuration
-
createEmptyTableConfiguration
Creates only the instance of a table configuration w/o column configs.
Override this method to create application-specific implementations.- Parameters:
name
- the table's name, null if basename of element class- Returns:
- the table configuration
-
createEmptyTableConfiguration
Creates only the instance of a table configuration w/o column configs.
Override this method to create application-specific implementations.- Returns:
- the table configuration
-
addBindableColumns
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, String columnPrefix, String displayPrefix, Class<?> clazz, 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
-