java.lang.Object
de.bernd_michaely.common.desktop.fx.collections.selection.TransformationListUtil

public class TransformationListUtil extends Object
Utility for index calculations on TransformationList chains.
  • Constructor Details

    • TransformationListUtil

      public TransformationListUtil()
  • Method Details

    • getViewIndexFor

      public static int getViewIndexFor(@Nullable TransformationList<?,?> transformationList, int index)
      Maps the given index of the transformation lists direct 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 of TransformationList.getViewIndex(int).
      Parameters:
      transformationList - the given transformation list
      index - the given source list index
      Returns:
      the corresponding transformation list index
      Throws:
      IllegalArgumentException - if the source list is not in the transformation chain
      Since:
      2.0
      See Also:
    • getViewIndexFor

      public static int getViewIndexFor(@Nullable ObservableList<?> sourceList, @Nullable 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 of TransformationList.getViewIndex(int).
      Parameters:
      sourceList - the given source list
      transformationList - the given transformation list
      index - 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: