Class SourceEditor.ActiveSourcesModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.openstreetmap.josm.gui.preferences.SourceEditor.ActiveSourcesModel
- All Implemented Interfaces:
Serializable,TableModel,ReorderableModel<SourceEntry>,ReorderableTableModel<SourceEntry>
- Enclosing class:
- SourceEditor
protected class SourceEditor.ActiveSourcesModel
extends AbstractTableModel
implements ReorderableTableModel<SourceEntry>
Table model of active sources.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<SourceEntry>private final DefaultListSelectionModelFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionActiveSourcesModel(DefaultListSelectionModel selectionModel) Constructs a newActiveSourcesModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtendedSourceEntries(List<ExtendedSourceEntry> sources) Adds multiple sources.voidaddSource(SourceEntry entry) Adds an active source.Class<?>getColumnClass(int column) intintReturns the number of rows in the list/table.Returns the selection model.Returns the active sources.getValue(int index) Get object value at given index.getValueAt(int rowIndex, int columnIndex) booleanisCellEditable(int rowIndex, int columnIndex) voidremoveIdxs(Collection<Integer> idxs) Removes the sources at given indexes.voidRemoves the selected sources.voidsetActiveSources(Collection<? extends SourceEntry> sources) Sets active sources.setValue(int index, SourceEntry value) Set object value at given index.voidsetValueAt(Object aValue, int row, int column) Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnName, getListeners, getTableModelListeners, removeTableModelListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.data.ReorderableModel
canMove, canMoveDown, canMoveUp, doMoveMethods inherited from interface org.openstreetmap.josm.gui.util.ReorderableTableModel
canMove, canMoveDown, canMoveDown, canMoveUp, canMoveUp, getSelectedIndices, move, moveDown, moveDown, moveUp, moveUp, selectedIndices
-
Field Details
-
data
-
selectionModel
-
-
Constructor Details
-
ActiveSourcesModel
Constructs a newActiveSourcesModel.- Parameters:
selectionModel- selection model
-
-
Method Details
-
getColumnCount
- Specified by:
getColumnCountin interfaceTableModel
-
getRowCount
Description copied from interface:ReorderableTableModelReturns the number of rows in the list/table.- Specified by:
getRowCountin interfaceReorderableTableModel<SourceEntry>- Specified by:
getRowCountin interfaceTableModel- Returns:
- the number of rows in the list/table
- See Also:
-
getValueAt
- Specified by:
getValueAtin interfaceTableModel
-
isCellEditable
- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
setActiveSources
Sets active sources.- Parameters:
sources- active sources
-
addSource
Adds an active source.- Parameters:
entry- source to add
-
removeSelected
Removes the selected sources. -
removeIdxs
Removes the sources at given indexes.- Parameters:
idxs- indexes to remove
-
addExtendedSourceEntries
Adds multiple sources.- Parameters:
sources- source entries
-
getSources
Returns the active sources.- Returns:
- the active sources
-
getSelectionModel
Description copied from interface:ReorderableTableModelReturns the selection model.- Specified by:
getSelectionModelin interfaceReorderableTableModel<SourceEntry>- Returns:
- the selection model (never null)
- See Also:
-
getValue
Description copied from interface:ReorderableModelGet object value at given index.- Specified by:
getValuein interfaceReorderableModel<SourceEntry>- Parameters:
index- index- Returns:
- object value at given index
-
setValue
Description copied from interface:ReorderableModelSet object value at given index.- Specified by:
setValuein interfaceReorderableModel<SourceEntry>- Parameters:
index- indexvalue- new value- Returns:
- the value previously at the specified position
-