Class CorrectionTableModel<C extends Correction>
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.openstreetmap.josm.gui.correction.CorrectionTableModel<C>
-
- Type Parameters:
C- type of correction
- All Implemented Interfaces:
java.io.Serializable,javax.swing.table.TableModel
- Direct Known Subclasses:
RoleCorrectionTableModel,TagCorrectionTableModel
public abstract class CorrectionTableModel<C extends Correction> extends javax.swing.table.AbstractTableModel
Abstract correction table model.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean[]applyprivate intapplyColumnprivate java.util.List<C>corrections
-
Constructor Summary
Constructors Modifier Constructor Description protectedCorrectionTableModel(java.util.List<C> corrections)Constructs a newCorrectionTableModel.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleangetApply(int i)Returns the "Apply" flag for given index.intgetApplyColumn()Returns the index of the "Apply" column.java.lang.Class<?>getColumnClass(int columnIndex)java.lang.StringgetColumnName(int columnIndex)abstract java.lang.StringgetCorrectionColumnName(int colIndex)Returns the column name for columns other than "Apply".java.util.List<C>getCorrections()Returns the list of corrections.abstract java.lang.ObjectgetCorrectionValueAt(int rowIndex, int colIndex)Returns the correction value at given position.intgetRowCount()java.lang.ObjectgetValueAt(int rowIndex, int colIndex)protected abstract booleanisBoldCell(int row, int column)booleanisCellEditable(int rowIndex, int columnIndex)voidsetValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
corrections
private final transient java.util.List<C extends Correction> corrections
-
apply
private final boolean[] apply
-
applyColumn
private final int applyColumn
-
-
Constructor Detail
-
CorrectionTableModel
protected CorrectionTableModel(java.util.List<C> corrections)
Constructs a newCorrectionTableModel.- Parameters:
corrections- list of corrections
-
-
Method Detail
-
isBoldCell
protected abstract boolean isBoldCell(int row, int column)
-
getCorrectionColumnName
public abstract java.lang.String getCorrectionColumnName(int colIndex)
Returns the column name for columns other than "Apply".- Parameters:
colIndex- column index- Returns:
- the translated column name for given index
- See Also:
getApplyColumn()
-
getCorrectionValueAt
public abstract java.lang.Object getCorrectionValueAt(int rowIndex, int colIndex)
Returns the correction value at given position.- Parameters:
rowIndex- row indexcolIndex- column index- Returns:
- the correction value at given position
-
getCorrections
public java.util.List<C> getCorrections()
Returns the list of corrections.- Returns:
- the list of corrections
-
getApplyColumn
public int getApplyColumn()
Returns the index of the "Apply" column.- Returns:
- the index of the "Apply" column
-
getApply
public boolean getApply(int i)
Returns the "Apply" flag for given index.- Parameters:
i- index- Returns:
- the "Apply" flag for given index
-
getRowCount
public int getRowCount()
-
getColumnClass
public java.lang.Class<?> getColumnClass(int columnIndex)
- Specified by:
getColumnClassin interfacejavax.swing.table.TableModel- Overrides:
getColumnClassin classjavax.swing.table.AbstractTableModel
-
getColumnName
public java.lang.String getColumnName(int columnIndex)
- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classjavax.swing.table.AbstractTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)
- Specified by:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein classjavax.swing.table.AbstractTableModel
-
setValueAt
public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin classjavax.swing.table.AbstractTableModel
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int colIndex)
-
-