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 classChangesetContentTableModel.ChangesetContentEntryThe type used internally to keep information aboutHistoryOsmPrimitivewith theirChangesetDataSet.ChangesetModificationType.
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ChangesetContentTableModel.ChangesetContentEntry>dataprivate javax.swing.DefaultListSelectionModelselectionModel
-
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 intgetColumnCount()intgetRowCount()java.util.Set<HistoryOsmPrimitive>getSelectedPrimitives(javax.swing.JTable table)Returns the selected history primitives.javax.swing.DefaultListSelectionModelgetSelectionModel()Replies the selection modeljava.lang.ObjectgetValueAt(int row, int col)booleanhasSelectedPrimitives()Replies true if there is at least one selected primitive in the table modelvoidpopulate(ChangesetDataSet ds)Populates the model with the content of a changeset.voidsetSelectedByIdx(int row)Selects a single item by its index.protected voidsort()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)
-
-