Class ChangesetContentTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.openstreetmap.josm.gui.dialogs.changeset.ChangesetContentTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
public class ChangesetContentTableModel extends javax.swing.table.AbstractTableModel
This is the table model for the content of a changeset.- Since:
- 2689
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ChangesetContentTableModel.ChangesetContentEntry
The type used internally to keep information aboutHistoryOsmPrimitive
with theirChangesetDataSet.ChangesetModificationType
.
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ChangesetContentTableModel.ChangesetContentEntry>
data
private javax.swing.DefaultListSelectionModel
selectionModel
-
Constructor Summary
Constructors Constructor Description ChangesetContentTableModel(javax.swing.DefaultListSelectionModel selectionModel)
Constructs a newChangesetContentTableModel
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
int
getRowCount()
java.util.Set<HistoryOsmPrimitive>
getSelectedPrimitives(javax.swing.JTable table)
Returns the selected history primitives.javax.swing.DefaultListSelectionModel
getSelectionModel()
Replies the selection modeljava.lang.Object
getValueAt(int row, int col)
boolean
hasSelectedPrimitives()
Replies true if there is at least one selected primitive in the table modelvoid
populate(ChangesetDataSet ds)
Populates the model with the content of a changeset.void
setSelectedByIdx(int row)
Selects a single item by its index.protected void
sort()
Sort data.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Field Detail
-
data
private final transient java.util.List<ChangesetContentTableModel.ChangesetContentEntry> data
-
selectionModel
private final javax.swing.DefaultListSelectionModel selectionModel
-
-
Constructor Detail
-
ChangesetContentTableModel
public ChangesetContentTableModel(javax.swing.DefaultListSelectionModel selectionModel)
Constructs a newChangesetContentTableModel
.- Parameters:
selectionModel
- selection model
-
-
Method Detail
-
hasSelectedPrimitives
public boolean hasSelectedPrimitives()
Replies true if there is at least one selected primitive in the table model- Returns:
- true if there is at least one selected primitive in the table model
-
setSelectedByIdx
public void setSelectedByIdx(int row)
Selects a single item by its index.- Parameters:
row
- index
-
getSelectionModel
public javax.swing.DefaultListSelectionModel getSelectionModel()
Replies the selection model- Returns:
- the selection model
-
getSelectedPrimitives
public java.util.Set<HistoryOsmPrimitive> getSelectedPrimitives(javax.swing.JTable table)
Returns the selected history primitives.- Parameters:
table
- the JTable used with this model- Returns:
- the selected history primitives
-
populate
public void populate(ChangesetDataSet ds)
Populates the model with the content of a changeset. If ds is null, the table is cleared.- Parameters:
ds
- the changeset content.
-
sort
protected void sort()
Sort data.
-
getColumnCount
public int getColumnCount()
-
getRowCount
public int getRowCount()
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
-
-