Class TransformationListUtil
java.lang.Object
de.bernd_michaely.common.desktop.fx.collections.selection.TransformationListUtil
Utility for index calculations on TransformationList chains.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getViewIndexFor(ObservableList<?> sourceList, TransformationList<?,?> transformationList, int index)
Maps the given index of the source list to an index in the transformation list.
-
Constructor Details
-
TransformationListUtil
public TransformationListUtil()
-
-
Method Details
-
getViewIndexFor
public static int getViewIndexFor(ObservableList<?> sourceList, TransformationList<?,?> transformationList, int index)Maps the given index of the source list to an index in the transformation list. Returns a negative value, if the source index is not mapped. This method is also a workaround for undefined index-out-of-bounds behavior ofTransformationList.getViewIndex(int)
.- Parameters:
sourceList
- the given source listtransformationList
- the given transformation listindex
- the given source list index- Returns:
- the corresponding transformation list index
- Throws:
IllegalArgumentException
- if the source list is not in the transformation chain- See Also:
- http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8271865, https://bugs.openjdk.java.net/browse/JDK-8271865
-