Changeset 16601 in josm for trunk/src/org/openstreetmap/josm/gui/util/TableHelper.java
- Timestamp:
- 2020-06-11T14:19:10+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/TableHelper.java
r15226 r16601 3 3 4 4 import java.awt.Component; 5 import java.util.stream.IntStream; 5 6 6 7 import javax.swing.JTable; … … 147 148 return rv; 148 149 } 150 151 /** 152 * Selects the given indices in the selection model 153 * @param selectionModel list selection model. 154 * @param indices the indices to select 155 * @see ListSelectionModel#addSelectionInterval(int, int) 156 * @since 16601 157 */ 158 public static void setSelectedIndices(ListSelectionModel selectionModel, IntStream indices) { 159 selectionModel.setValueIsAdjusting(true); 160 selectionModel.clearSelection(); 161 indices.filter(i -> i >= 0).forEach(i -> selectionModel.addSelectionInterval(i, i)); 162 selectionModel.setValueIsAdjusting(false); 163 } 149 164 }
Note:
See TracChangeset
for help on using the changeset viewer.