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:
Serializable
,TableModel
- Direct Known Subclasses:
RoleCorrectionTableModel
,TagCorrectionTableModel
public abstract class CorrectionTableModel<C extends Correction> extends AbstractTableModel
Abstract correction table model.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean[]
apply
private int
applyColumn
private List<C>
corrections
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CorrectionTableModel(List<C> corrections)
Constructs a newCorrectionTableModel
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
getApply(int i)
Returns the "Apply" flag for given index.int
getApplyColumn()
Returns the index of the "Apply" column.Class<?>
getColumnClass(int columnIndex)
String
getColumnName(int columnIndex)
abstract String
getCorrectionColumnName(int colIndex)
Returns the column name for columns other than "Apply".List<C>
getCorrections()
Returns the list of corrections.abstract Object
getCorrectionValueAt(int rowIndex, int colIndex)
Returns the correction value at given position.int
getRowCount()
Object
getValueAt(int rowIndex, int colIndex)
protected abstract boolean
isBoldCell(int row, int column)
boolean
isCellEditable(int rowIndex, int columnIndex)
void
setValueAt(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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.table.TableModel
getColumnCount
-
-
-
-
Field Detail
-
corrections
private final transient List<C extends Correction> corrections
-
apply
private final boolean[] apply
-
applyColumn
private final int applyColumn
-
-
Constructor Detail
-
CorrectionTableModel
protected CorrectionTableModel(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 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 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 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 Class<?> getColumnClass(int columnIndex)
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
getColumnName
public String getColumnName(int columnIndex)
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)
- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
-
setValueAt
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
-
getValueAt
public Object getValueAt(int rowIndex, int colIndex)
-
-