All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.butterfaces.model.table.DefaultTableColumnVisibilityModel Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
package org.butterfaces.model.table;

/**
 * Simple implementation of {@link TableColumnVisibilityModel}. Matches visibility by using column unique identifier.
 */
public class DefaultTableColumnVisibilityModel implements TableColumnVisibilityModel {

    private TableColumnVisibility visibility;

    @Override
    public void update(final TableColumnVisibility visibility) {
        this.visibility = visibility;
    }

    @Override
    public Boolean isColumnHidden(final String tableUniqueIdentifier, final String columnUniqueIdentifier) {
        if (visibility == null
                || !visibility.getTableIdentifier().equalsIgnoreCase(tableUniqueIdentifier)
                || (!visibility.getInvisibleColumns().contains(columnUniqueIdentifier)
                    && !visibility.getVisibleColumns().contains(columnUniqueIdentifier))) {
            return null;
        }

        return visibility.getInvisibleColumns().contains(columnUniqueIdentifier);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy