Class SourceEditor.IconPathTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.openstreetmap.josm.gui.preferences.SourceEditor.IconPathTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
- Enclosing class:
- SourceEditor
protected static class SourceEditor.IconPathTableModel extends javax.swing.table.AbstractTableModel
Table model for icons paths.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
data
private javax.swing.DefaultListSelectionModel
selectionModel
-
Constructor Summary
Constructors Constructor Description IconPathTableModel(javax.swing.DefaultListSelectionModel selectionModel)
Constructs a newIconPathTableModel
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPath(java.lang.String path)
Adds an icon path.int
getColumnCount()
java.util.List<java.lang.String>
getIconPaths()
Returns the icon paths.int
getRowCount()
java.lang.Object
getValueAt(int rowIndex, int columnIndex)
boolean
isCellEditable(int rowIndex, int columnIndex)
void
removeSelected()
Removes the selected path.void
setIconPaths(java.util.Collection<java.lang.String> paths)
Sets the icons paths.void
setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
protected void
sort()
Sorts paths lexicographically.void
updatePath(int pos, java.lang.String path)
Updates icon path at given index.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
data
private final java.util.List<java.lang.String> data
-
selectionModel
private final javax.swing.DefaultListSelectionModel selectionModel
-
-
Constructor Detail
-
IconPathTableModel
public IconPathTableModel(javax.swing.DefaultListSelectionModel selectionModel)
Constructs a newIconPathTableModel
.- Parameters:
selectionModel
- selection model
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
-
getRowCount
public int getRowCount()
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classjavax.swing.table.AbstractTableModel
-
setValueAt
public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in classjavax.swing.table.AbstractTableModel
-
setIconPaths
public void setIconPaths(java.util.Collection<java.lang.String> paths)
Sets the icons paths.- Parameters:
paths
- icons paths
-
addPath
public void addPath(java.lang.String path)
Adds an icon path.- Parameters:
path
- icon path to add
-
updatePath
public void updatePath(int pos, java.lang.String path)
Updates icon path at given index.- Parameters:
pos
- positionpath
- new path
-
removeSelected
public void removeSelected()
Removes the selected path.
-
sort
protected void sort()
Sorts paths lexicographically.
-
getIconPaths
public java.util.List<java.lang.String> getIconPaths()
Returns the icon paths.- Returns:
- the icon paths
-
-