package com.onaro.sanscreen.client.view.tabular; import com.onaro.commons.swing.table.PropertyColumn; import com.onaro.util.jfc.tables.FilterTable; import com.onaro.util.jfc.tables.filter.Filter; import java.beans.BeanInfo; import java.beans.PropertyDescriptor; import java.util.List; /** * Column class that merges the capabilities of the PropertyColumn with the features of ITabularColumn * for use in AbstractTabularTableModels. The implementation of ITabularColumn here should match * AbstractTabularColumn. * * @param the object type for the rows the column can operate on. * * @see AbstractTabularTableModel * @see AbstractTabularColumn */ public abstract class TabularPropertyColumn extends PropertyColumn implements ITabularColumn { private static final long serialVersionUID = 1L; /** * Filter for use with this column. May be null if no filter is applicable. */ private Filter filter; /** * Tells if this column should be visible by default. */ protected boolean visibleByDefault = true; /** * Is this column a system (i.e. NOT user viewable column). */ private boolean system = false; /** * The display name of this column's group. */ private String groupName = null; public TabularPropertyColumn(BeanInfo beanInfo, String propertyPath, String name) { super(beanInfo, propertyPath, name); } public TabularPropertyColumn(BeanInfo beanInfo, String propertyName) { super(beanInfo, propertyName); } public TabularPropertyColumn(Class beanClass, String propertyPath, String name) { super(beanClass, propertyPath, name); } public TabularPropertyColumn(Class beanClass, String propertyPath) { super(beanClass, propertyPath); } public TabularPropertyColumn(List propertyDescriptors, String name) { super(propertyDescriptors, name); } public TabularPropertyColumn(PropertyDescriptor propertyDescriptor, String name) { super(propertyDescriptor, name); } public TabularPropertyColumn(PropertyDescriptor propertyDescriptor) { super(propertyDescriptor); } public void installDefaultFilter() { Class valueType = getValueType(); Filter filter = FilterTable.DEFAULT_FILTER_FACTORY.create(valueType); setFilter(filter); } public final Filter getFilter() { return filter; } public final void setFilter(Filter filter) { this.filter = filter; } public final String getGroupName() { return groupName; } public final void setGroupName(String groupName) { this.groupName = groupName; } public final boolean isSystem() { return system; } public final void setSystem(boolean system) { this.system = system; } public boolean isVisibleByDefault() { return visibleByDefault; } public void setVisibleByDefault(boolean visibleByDefault) { this.visibleByDefault = visibleByDefault; } }