Class SourceEditor.IconPathTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.openstreetmap.josm.gui.preferences.SourceEditor.IconPathTableModel
-
- All Implemented Interfaces:
Serializable
,TableModel
- Enclosing class:
- SourceEditor
protected static class SourceEditor.IconPathTableModel extends AbstractTableModel
Table model for icons paths.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private List<String>
data
private DefaultListSelectionModel
selectionModel
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description IconPathTableModel(DefaultListSelectionModel selectionModel)
Constructs a newIconPathTableModel
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPath(String path)
Adds an icon path.int
getColumnCount()
List<String>
getIconPaths()
Returns the icon paths.int
getRowCount()
Object
getValueAt(int rowIndex, int columnIndex)
boolean
isCellEditable(int rowIndex, int columnIndex)
void
removeSelected()
Removes the selected path.void
setIconPaths(Collection<String> paths)
Sets the icons paths.void
setValueAt(Object aValue, int rowIndex, int columnIndex)
protected void
sort()
Sorts paths lexicographically.void
updatePath(int pos, 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
-
selectionModel
private final DefaultListSelectionModel selectionModel
-
-
Constructor Detail
-
IconPathTableModel
public IconPathTableModel(DefaultListSelectionModel selectionModel)
Constructs a newIconPathTableModel
.- Parameters:
selectionModel
- selection model
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
-
getRowCount
public int getRowCount()
-
getValueAt
public Object getValueAt(int rowIndex, int columnIndex)
-
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
-
setIconPaths
public void setIconPaths(Collection<String> paths)
Sets the icons paths.- Parameters:
paths
- icons paths
-
updatePath
public void updatePath(int pos, 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 List<String> getIconPaths()
Returns the icon paths.- Returns:
- the icon paths
-
-