Class ResizableGridRowLayout
- java.lang.Object
-
- org.eclipse.swt.widgets.Layout
-
- org.eclipse.nebula.widgets.compositetable.CompositeTableLayout
-
- org.eclipse.nebula.widgets.compositetable.AbstractGridRowLayout
-
- org.eclipse.nebula.widgets.compositetable.GridRowLayout
-
- org.eclipse.nebula.widgets.compositetable.ResizableGridRowLayout
-
public class ResizableGridRowLayout extends GridRowLayout
ResizableGridRowLayout works with HeaderLayout to implement column resizing semantics for CompositeTable UIs.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classResizableGridRowLayout.GridColumnControlListener
-
Field Summary
Fields Modifier and Type Field Description private int[]columnOrderprivate org.eclipse.swt.widgets.Compositecontrolprivate AbstractGridRowLayoutdelegate-
Fields inherited from class org.eclipse.nebula.widgets.compositetable.AbstractGridRowLayout
CELL_BORDER_WIDTH
-
-
Constructor Summary
Constructors Constructor Description ResizableGridRowLayout()Constructor ResizableGridRowLayout.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddListenersToDelegate(org.eclipse.swt.widgets.Composite row, HeaderLayout delegate)protected org.eclipse.swt.graphics.PointcomputeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)private voidcreateNullLayout(org.eclipse.swt.widgets.Composite composite)private voidfindHeader(org.eclipse.swt.widgets.Composite row)protected org.eclipse.swt.widgets.WidgetgetColumnAt(org.eclipse.swt.widgets.Composite rowOrHeader, int offset)Return the SWT Widget representing the specified column.private CompositeTableLayoutgetLayoutDelegate(org.eclipse.swt.widgets.Composite composite)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, setBounds
-
Methods inherited from class org.eclipse.nebula.widgets.compositetable.AbstractGridRowLayout
getAvailableWidth, isWidthWiderThanAllColumns
-
-
-
-
Field Detail
-
delegate
private AbstractGridRowLayout delegate
-
columnOrder
private int[] columnOrder
-
control
private org.eclipse.swt.widgets.Composite control
-
-
Method Detail
-
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
public AbstractGridRowLayout setWeights(int[] weights)
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
public AbstractGridRowLayout setFittingHorizontally(boolean fittingHorizontally)
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.
-
getLayoutDelegate
private CompositeTableLayout getLayoutDelegate(org.eclipse.swt.widgets.Composite composite)
-
createNullLayout
private void createNullLayout(org.eclipse.swt.widgets.Composite composite)
-
findHeader
private void findHeader(org.eclipse.swt.widgets.Composite row)
-
addListenersToDelegate
private void addListenersToDelegate(org.eclipse.swt.widgets.Composite row, HeaderLayout delegate)
-
-