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.Point
computeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)
protected org.eclipse.swt.widgets.Widget
getColumnAt(org.eclipse.swt.widgets.Composite rowOrHeader, int offset)
Return the SWT Widget representing the specified column.int
getSumOfAllWeights()
Returns the sum of all the weights in the weights propertyint[]
getWeights()
Method getWeights.boolean
isFittingHorizontally()
Method isFittingHorizontally.protected void
layout(org.eclipse.swt.widgets.Composite composite, boolean flushCache)
AbstractGridRowLayout
setFittingHorizontally(boolean fittingHorizontally)
Method setFittingHorizontally.AbstractGridRowLayout
setWeights(int[] weights)
Method setWeights.Methods inherited from class org.eclipse.nebula.widgets.compositetable.GridRowLayout
computeColumnSize, computeMaxHeight, getNumColumns, setBounds
Methods 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:
computeSize
in classAbstractGridRowLayout
-
layout
protected void layout(org.eclipse.swt.widgets.Composite composite, boolean flushCache)- Overrides:
layout
in classAbstractGridRowLayout
-
getWeights
public int[] getWeights()Description copied from class:AbstractGridRowLayout
Method 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:
getWeights
in classAbstractGridRowLayout
- Returns:
- the current weights array or null if no weights have been specified.
-
setWeights
Description copied from class:AbstractGridRowLayout
Method 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:
setWeights
in 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:AbstractGridRowLayout
Returns the sum of all the weights in the weights property- Overrides:
getSumOfAllWeights
in classAbstractGridRowLayout
- Returns:
- the sum of all the weights in the weights property
-
isFittingHorizontally
public boolean isFittingHorizontally()Description copied from class:AbstractGridRowLayout
Method 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:
isFittingHorizontally
in classAbstractGridRowLayout
- Returns:
- Returns true if the table's actual width is set to equal the visible width; false otherwise.
-
setFittingHorizontally
Description copied from class:AbstractGridRowLayout
Method 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:
setFittingHorizontally
in 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:AbstractGridRowLayout
Return the SWT Widget representing the specified column.- Overrides:
getColumnAt
in classGridRowLayout
- Parameters:
rowOrHeader
- The header or row objectoffset
- The column's offset.- Returns:
- The SWT Widget.
-