Class ResizableGridRowLayout
public class ResizableGridRowLayout extends GridRowLayout
Use a ResizableGridRowLayout when you have used a ResizableGridHeaderLayout on the Header object. ResizableGridRowLayout gets all of its layout settings from the ResizableGridHeaderLayout object, so there is no need to set any additional layout information on the ResizableGridRowLayout itself.
-
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.compositetable.AbstractGridRowLayout
CELL_BORDER_WIDTH -
Constructor Summary
Constructors Constructor Description ResizableGridRowLayout()Constructor ResizableGridRowLayout. -
Method Summary
Modifier and Type Method Description protected org.eclipse.swt.graphics.PointcomputeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)protected org.eclipse.swt.widgets.WidgetgetColumnAt(org.eclipse.swt.widgets.Composite rowOrHeader, int offset)Return the SWT Widget representing the specified column.intgetSumOfAllWeights()Returns the sum of all the weights in the weights propertyint[]getWeights()Method getWeights.booleanisFittingHorizontally()Method isFittingHorizontally.protected voidlayout(org.eclipse.swt.widgets.Composite composite, boolean flushCache)AbstractGridRowLayoutsetFittingHorizontally(boolean fittingHorizontally)Method setFittingHorizontally.AbstractGridRowLayoutsetWeights(int[] weights)Method setWeights.Methods inherited from class org.eclipse.nebula.widgets.compositetable.GridRowLayout
computeColumnSize, computeMaxHeight, getNumColumns, setBoundsMethods inherited from class org.eclipse.nebula.widgets.compositetable.AbstractGridRowLayout
getAvailableWidth, isWidthWiderThanAllColumns
-
Constructor Details
-
ResizableGridRowLayout
public ResizableGridRowLayout()Constructor ResizableGridRowLayout. Create a ResizableGridRowLayout object. Since a ResizableGridRowLayout object will automatically find the associated HeaderLayout, no properties need to be set on a ResizableGridRowLayout.
-
-
Method Details
-
computeSize
protected org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)- Overrides:
computeSizein classAbstractGridRowLayout
-
layout
protected void layout(org.eclipse.swt.widgets.Composite composite, boolean flushCache)- Overrides:
layoutin classAbstractGridRowLayout
-
getWeights
public int[] getWeights()Description copied from class:AbstractGridRowLayoutMethod getWeights. If isFittingHorizontally, returns an array representing the percentage of the total width each column is allocated or null if no weights have been specified.If !isFittingHorizontally, returns an array where each element is the minimum width in pixels of the corresponding column.
- Overrides:
getWeightsin classAbstractGridRowLayout- Returns:
- the current weights array or null if no weights have been specified.
-
setWeights
Description copied from class:AbstractGridRowLayoutMethod setWeights. If isFittingHorizontally, specifies an array representing the percentage of the total width each column is allocated or null if no weights have been specified.If !isFittingHorizontally, specifies an array where each element is the minimum width in pixels of the corresponding column.
This property is ignored if the programmer has set a layout manager on the header and/or the row prototype objects.
The number of elements in the array must match the number of columns and if isFittingHorizontally, the sum of all elements must equal 100. If either of these constraints is not true, this property will be ignored and all columns will be created equal in width.
- Overrides:
setWeightsin classAbstractGridRowLayout- Parameters:
weights- the weights to use if the CompositeTable is automatically laying out controls.- Returns:
- this
-
getSumOfAllWeights
public int getSumOfAllWeights()Description copied from class:AbstractGridRowLayoutReturns the sum of all the weights in the weights property- Overrides:
getSumOfAllWeightsin classAbstractGridRowLayout- Returns:
- the sum of all the weights in the weights property
-
isFittingHorizontally
public boolean isFittingHorizontally()Description copied from class:AbstractGridRowLayoutMethod isFittingHorizontally. Returns if the CompositeTable control will scale the widths of all columns so that they all fit into the available space. The default value is false.- Overrides:
isFittingHorizontallyin classAbstractGridRowLayout- Returns:
- Returns true if the table's actual width is set to equal the visible width; false otherwise.
-
setFittingHorizontally
Description copied from class:AbstractGridRowLayoutMethod setFittingHorizontally. Sets if the CompositeTable control will scale the widths of all columns so that they all fit into the available space. The default value is false.- Overrides:
setFittingHorizontallyin classAbstractGridRowLayout- Parameters:
fittingHorizontally- true if the table's actual width is set to equal the visible width; false otherwise.- Returns:
- this
-
getColumnAt
protected org.eclipse.swt.widgets.Widget getColumnAt(org.eclipse.swt.widgets.Composite rowOrHeader, int offset)Description copied from class:AbstractGridRowLayoutReturn the SWT Widget representing the specified column.- Overrides:
getColumnAtin classGridRowLayout- Parameters:
rowOrHeader- The header or row objectoffset- The column's offset.- Returns:
- The SWT Widget.
-