Class DefaultTableConfiguration<S>

  • Type Parameters:
    S - type of the objects contained within the table's items list
    All Implemented Interfaces:
    TableConfiguration<S>

    public class DefaultTableConfiguration<S>
    extends java.lang.Object
    implements TableConfiguration<S>
    Default implementation of a table configuration.
    Author:
    harald
    • Constructor Detail

      • DefaultTableConfiguration

        public DefaultTableConfiguration​(S template,
                                         java.lang.String name)
        Creates a configuration.
        Parameters:
        template - a template object
        name - the table's name, null if basename from effective class of template
      • DefaultTableConfiguration

        public DefaultTableConfiguration​(java.lang.Class<S> objectClass,
                                         java.lang.String name)
        Creates a configuration.
        Parameters:
        objectClass - the object class
        name - the table's name, null if basename from effective class of template
    • Method Detail

      • getTemplate

        public S getTemplate()
        Gets the template.
        Returns:
        the template, null if only class given
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • addColumn

        public TableColumnConfiguration<S,​?> addColumn​(java.lang.String name,
                                                             java.lang.String displayedName)
        Description copied from interface: TableConfiguration
        Adds a column via binding path.
        Specified by:
        addColumn in interface TableConfiguration<S>
        Parameters:
        name - the column's binding path
        displayedName - the displayed column name
        Returns:
        the created column configuration
      • getName

        public java.lang.String getName()
        Description copied from interface: TableConfiguration
        Gets the name of the table.
        The name is also used as a key to the table preferences.
        Specified by:
        getName in interface TableConfiguration<S>
        Returns:
        the name, never null
      • isSortingIncluded

        public boolean isSortingIncluded()
        Description copied from interface: TableConfiguration
        Returns whether the preferences include the column sorting.
        Specified by:
        isSortingIncluded in interface TableConfiguration<S>
        Returns:
        true if sorting is restored from the preferences (default is false)
      • setSortingIncluded

        public void setSortingIncluded​(boolean sortingIncluded)
        Description copied from interface: TableConfiguration
        Sets whether the preferences include the column sorting.
        Specified by:
        setSortingIncluded in interface TableConfiguration<S>
        Parameters:
        sortingIncluded - true if sorting is restored from the preferences (default is false)
      • isViewSizeIncluded

        public boolean isViewSizeIncluded()
        Description copied from interface: TableConfiguration
        Returns whether the preferences include the view size.
        Specified by:
        isViewSizeIncluded in interface TableConfiguration<S>
        Returns:
        true if the preferred size is restored from the preferences (default is true)
      • setViewSizeIncluded

        public void setViewSizeIncluded​(boolean viewSizeIncluded)
        Description copied from interface: TableConfiguration
        Sets whether the preferences include the view size.
        Specified by:
        setViewSizeIncluded in interface TableConfiguration<S>
        Parameters:
        viewSizeIncluded - true if the preferred size is restored from the preferences (default is true)
      • savePreferences

        public void savePreferences​(FxTableView<S> table,
                                    java.lang.String suffix,
                                    boolean system)
        Description copied from interface: TableConfiguration
        Saves the column sizes, visability, view size and sorting to the preferences.
        Specified by:
        savePreferences in interface TableConfiguration<S>
        Parameters:
        table - the table
        suffix - the configuration suffix, null if none
        system - true if save to system prefs, else user prefs
      • loadPreferences

        public void loadPreferences​(FxTableView<S> table,
                                    java.lang.String suffix,
                                    boolean system)
        Description copied from interface: TableConfiguration
        Loads the column sizes, visability, view size and sorting from the preferences.
        Specified by:
        loadPreferences in interface TableConfiguration<S>
        Parameters:
        table - the table
        suffix - the configuration suffix, null if none
        system - true if load from system prefs only, else user prefs first
      • getBinder

        public FxTableBinder<S> getBinder()
        Description copied from interface: TableConfiguration
        Gets the table binder.
        Don't mix up the table's binder with the FxController's binder! The table binder is responsible to bind the cells to the model, whereas the controller binder binds the data list to the table.
        As a consequence, binding properties such as the DomainContext, if necessary for cell editors, must be applied to the table binder!
        Specified by:
        getBinder in interface TableConfiguration<S>
        Returns:
        the binder
      • getCellType

        public <T> TableCellType<T> getCellType​(java.lang.Class<T> type)
        Description copied from interface: TableConfiguration
        Gets the cell type according to the item type.
        Specified by:
        getCellType in interface TableConfiguration<S>
        Type Parameters:
        T - the item type
        Parameters:
        type - the item class
        Returns:
        the cell type, never null