Class MaxCellBoundsHelper
java.lang.Object
org.eclipse.nebula.widgets.nattable.resize.MaxCellBoundsHelper
Helper class that does the calculations needed for the auto resizing feature.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
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- TheIConfigRegistryto get the required configuration values.gcFactory- TheGCFactoryfor creating a temporaryGCneeded 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
nullif 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- TheIConfigRegistryto get the required configuration values.gcFactory- TheGCFactoryfor creating a temporaryGCneeded 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
nullif 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.
-