Class SelectionSynchronizer
java.lang.Object
org.openstreetmap.josm.gui.history.SelectionSynchronizer
- All Implemented Interfaces:
EventListener,ListSelectionListener
Helper class to ensure that two (or more)
JTables always
have the same entries selected.
The tables are usually displayed side-by-side.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<ListSelectionModel>private booleanprivate BiFunction<Integer,ListSelectionModel, IntStream> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAddListSelectionModelof the table to participate in selection synchronization.(package private) voidsetSelectionIndexMapper(BiFunction<Integer, ListSelectionModel, IntStream> selectionIndexMapper) void
-
Field Details
-
participants
-
preventRecursion
-
selectionIndexMapper
-
-
Constructor Details
-
SelectionSynchronizer
public SelectionSynchronizer()Constructs a newSelectionSynchronizer.
-
-
Method Details
-
participateInSynchronizedSelection
AddListSelectionModelof the table to participate in selection synchronization. Call this method for all tables that should have their selection synchronized.- Parameters:
model- the selection model of the table
-
setSelectionIndexMapper
-
valueChanged
- Specified by:
valueChangedin interfaceListSelectionListener
-