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 class
ResizableGridRowLayout.GridColumnControlListener
-
Field Summary
Fields Modifier and Type Field Description private int[]
columnOrder
private org.eclipse.swt.widgets.Composite
control
private AbstractGridRowLayout
delegate
-
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 void
addListenersToDelegate(org.eclipse.swt.widgets.Composite row, HeaderLayout delegate)
protected org.eclipse.swt.graphics.Point
computeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)
private void
createNullLayout(org.eclipse.swt.widgets.Composite composite)
private void
findHeader(org.eclipse.swt.widgets.Composite row)
protected org.eclipse.swt.widgets.Widget
getColumnAt(org.eclipse.swt.widgets.Composite rowOrHeader, int offset)
Return the SWT Widget representing the specified column.private CompositeTableLayout
getLayoutDelegate(org.eclipse.swt.widgets.Composite composite)
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
-
-
-
-
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:
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
public AbstractGridRowLayout setWeights(int[] weights)
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
public AbstractGridRowLayout setFittingHorizontally(boolean fittingHorizontally)
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.
-
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)
-
-