Class DefaultTableConfigurationProvider<T>

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 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 class
      bundleProvided - true if resource bundle is provided
      bindingType - the table binding type
  • Method Details

    • getElementClass

      public Class<T> 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

      public ResourceBundle getBundle()
      Gets the resource bundle for this provider.

      Throws MissingResourceException if no bundle found.

      Returns:
      the resource bundle
    • createTableConfiguration

      public TableConfiguration<T> createTableConfiguration()
      Creates the table configuration.
      The default implementation adds all bindable elements and invokes addBindableColumns(TableConfiguration, String...) without optional components.
      Specified by:
      createTableConfiguration in interface TableConfigurationProvider<T>
      Returns:
      the table configuration
    • createEmptyTableConfiguration

      protected TableConfiguration<T> createEmptyTableConfiguration(String name)
      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

      protected final TableConfiguration<T> 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

      protected void addBindableColumns(TableConfiguration<T> configuration, String... components)
      Adds all bindable columns.
      Override this method to specify the optional components.
      Parameters:
      configuration - the table configuration
      components - 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 configuration
      columnPrefix - the prefix for the column names
      displayPrefix - the prefix for the display names
      clazz - the class to analyze for bindable elements
      components - the binding path of components that should in turn be analyzed for bindables