Class BeanTableAdapter<T>
- java.lang.Object
-
- io.github.jonestimd.swing.table.model.BeanTableAdapter<T>
-
- Type Parameters:
T
- the class representing a row in the table
public class BeanTableAdapter<T> extends java.lang.Object
Adapter class for mapping bean properties to table columns.
-
-
Constructor Summary
Constructors Constructor Description BeanTableAdapter(javax.swing.table.AbstractTableModel tableModel, java.util.List<? extends ColumnAdapter<? super T,?>> columnAdapters, java.lang.Iterable<? extends TableDataProvider<T>> dataProviders)
BeanTableAdapter(javax.swing.table.AbstractTableModel tableModel, java.util.List<? extends ColumnAdapter<T,?>> columnAdapters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBean(T bean)
ColumnAdapter<? super T,?>
getColumnAdapter(int index)
java.lang.Class<?>
getColumnClass(int columnIndex)
int
getColumnCount()
java.lang.String
getColumnName(int columnIndex)
java.lang.Object
getValue(T row, int columnIndex)
boolean
isCellEditable(T bean, int columnIndex)
void
notifyDataProviders(T row, int rowIndex, java.lang.String columnId, java.lang.Object oldValue)
void
removeBean(T bean)
void
setBeans(java.util.Collection<T> beans)
void
setColumnAdapters(java.util.Collection<? extends ColumnAdapter<? super T,?>> columnAdapters)
void
setValue(java.lang.Object value, T row, int rowIndex, int columnIndex)
void
updateBean(T bean, java.lang.String columnId, java.lang.Object oldValue)
-
-
-
Constructor Detail
-
BeanTableAdapter
public BeanTableAdapter(javax.swing.table.AbstractTableModel tableModel, java.util.List<? extends ColumnAdapter<T,?>> columnAdapters)
-
BeanTableAdapter
public BeanTableAdapter(javax.swing.table.AbstractTableModel tableModel, java.util.List<? extends ColumnAdapter<? super T,?>> columnAdapters, java.lang.Iterable<? extends TableDataProvider<T>> dataProviders)
-
-
Method Detail
-
setColumnAdapters
public void setColumnAdapters(java.util.Collection<? extends ColumnAdapter<? super T,?>> columnAdapters)
-
getColumnAdapter
public ColumnAdapter<? super T,?> getColumnAdapter(int index)
-
getColumnCount
public int getColumnCount()
-
getColumnName
public java.lang.String getColumnName(int columnIndex)
-
getColumnClass
public java.lang.Class<?> getColumnClass(int columnIndex)
-
isCellEditable
public boolean isCellEditable(T bean, int columnIndex)
-
getValue
public java.lang.Object getValue(T row, int columnIndex)
-
setValue
public void setValue(java.lang.Object value, T row, int rowIndex, int columnIndex)
-
setBeans
public void setBeans(java.util.Collection<T> beans)
-
addBean
public void addBean(T bean)
-
updateBean
public void updateBean(T bean, java.lang.String columnId, java.lang.Object oldValue)
-
removeBean
public void removeBean(T bean)
-
notifyDataProviders
public void notifyDataProviders(T row, int rowIndex, java.lang.String columnId, java.lang.Object oldValue)
-
-