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>dataprivate javax.swing.DefaultListSelectionModelselectionModel
-
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 voidaddPath(java.lang.String path)Adds an icon path.intgetColumnCount()java.util.List<java.lang.String>getIconPaths()Returns the icon paths.intgetRowCount()java.lang.ObjectgetValueAt(int rowIndex, int columnIndex)booleanisCellEditable(int rowIndex, int columnIndex)voidremoveSelected()Removes the selected path.voidsetIconPaths(java.util.Collection<java.lang.String> paths)Sets the icons paths.voidsetValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)protected voidsort()Sorts paths lexicographically.voidupdatePath(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:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein classjavax.swing.table.AbstractTableModel
-
setValueAt
public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin 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
-
-