Class MaxCellBoundsHelper
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.resize.MaxCellBoundsHelper
-
public class MaxCellBoundsHelper extends Object
Helper class that does the calculations needed for the auto resizing feature.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]
getPreferredColumnWidths(IConfigRegistry configRegistry, GCFactory gcFactory, ILayer layer, int[] columnPositions)
Calculates the preferred column widths of the given columns based on the givenIConfigRegistry
.static int[]
getPreferredRowHeights(IConfigRegistry configRegistry, GCFactory gcFactory, ILayer layer, int[] rowPositions)
Calculates the preferred row heights of the given rows based on the givenIConfigRegistry
.static int[]
greater(int[] array1, int[] array2)
Traverse the two arrays and return the greater element in each index position.
-
-
-
Method Detail
-
getPreferredColumnWidths
public static int[] getPreferredColumnWidths(IConfigRegistry configRegistry, GCFactory gcFactory, ILayer layer, int[] columnPositions)
Calculates the preferred column widths of the given columns based on the givenIConfigRegistry
. The preferred column width is the width needed at minimum to fit all the contents horizontally.- Parameters:
configRegistry
- TheIConfigRegistry
to get the required configuration values.gcFactory
- TheGCFactory
for creating a temporaryGC
needed for UI related calculations without blocking the UI thread.layer
- The layer to which the column positions match.columnPositions
- The column positions for which the preferred width should be calculated.- Returns:
- The preferred column widths of the given columns or
null
if an error occurred on processing.
-
getPreferredRowHeights
public static int[] getPreferredRowHeights(IConfigRegistry configRegistry, GCFactory gcFactory, ILayer layer, int[] rowPositions)
Calculates the preferred row heights of the given rows based on the givenIConfigRegistry
. The preferred row height is the height needed at minimum to fit all the content vertically.- Parameters:
configRegistry
- TheIConfigRegistry
to get the required configuration values.gcFactory
- TheGCFactory
for creating a temporaryGC
needed for UI related calculations without blocking the UI thread.layer
- The layer to which the row positions match.rowPositions
- The row positions for which the preferred height should be calculated.- Returns:
- The preferred row heights of the given rows or
null
if an error occurred on processing.
-
greater
public static int[] greater(int[] array1, int[] array2)
Traverse the two arrays and return the greater element in each index position.
-
-