abstract class AbstractGridRowLayout extends CompositeTableLayout
Modifier and Type | Field and Description |
---|---|
protected static int |
CELL_BORDER_WIDTH |
Constructor and Description |
---|
AbstractGridRowLayout()
Constructor AbstractGridRowLayout.
|
AbstractGridRowLayout(int[] weights)
Constructor AbstractGridRowLayout.
|
AbstractGridRowLayout(int[] weights,
boolean fittingHorizontally)
Construct a AbstractGridRowLayout, specifying both the weights and the
fittingHorizontally property.
|
Modifier and Type | Method and Description |
---|---|
protected abstract org.eclipse.swt.graphics.Point |
computeColumnSize(org.eclipse.swt.widgets.Widget columnObject,
int wHint,
int hHint,
boolean flush)
Compute and return the preferred size of the specified column object,
passing the usual SWT wHint, hHint, and flush parameters.
|
protected abstract int |
computeMaxHeight(org.eclipse.swt.widgets.Composite rowOrHeader)
Return the maximum desired height of each of the row or header's children.
|
protected org.eclipse.swt.graphics.Point |
computeSize(org.eclipse.swt.widgets.Composite child,
int wHint,
int hHint,
boolean flushCache) |
protected int |
getAvailableWidth(org.eclipse.swt.widgets.Composite headerOrRow)
Returns the number of horizontal pixels available for column data.
|
protected abstract org.eclipse.swt.widgets.Widget |
getColumnAt(org.eclipse.swt.widgets.Composite rowOrHeader,
int offset)
Return the SWT Widget representing the specified column.
|
protected abstract int |
getNumColumns(org.eclipse.swt.widgets.Composite rowOrHeader)
Return the number of columns in the specified row or header.
|
int |
getSumOfAllWeights()
Returns the sum of all the weights in the weights property
|
int[] |
getWeights()
Method getWeights.
|
boolean |
isFittingHorizontally()
Method isFittingHorizontally.
|
protected boolean |
isWidthWiderThanAllColumns(org.eclipse.swt.widgets.Composite headerOrRow)
Given the specified header or row, computes if the available width
is wider than the sum of all columns' preferred widths.
|
protected void |
layout(org.eclipse.swt.widgets.Composite child,
boolean flushCache) |
protected abstract void |
setBounds(org.eclipse.swt.widgets.Widget columnObject,
int left,
int top,
int width,
int height)
Set the bounds of the specified column object.
|
AbstractGridRowLayout |
setFittingHorizontally(boolean fittingHorizontally)
Method setFittingHorizontally.
|
AbstractGridRowLayout |
setWeights(int[] weights)
Method setWeights.
|
protected static final int CELL_BORDER_WIDTH
public AbstractGridRowLayout()
public AbstractGridRowLayout(int[] weights)
weights
- int[] The amount of weight desired for each column in the
table. If fittingHorizontally is set to true, the sum of all
weights must be 100 and each weight indicates the percentage
of the whole table that each column will occupy. If
fittingHorizontally is set to false, each weight is the
minimum width of the column in pixels. If the table is
narrower than can fit all widths, CompositeTable will display
a horizontal scroll bar. If the table is wider than can fit
all widths, the columns are scaled so that the entire table
fills the desired space and the ratios of the column widths
remains constant. fittingHorizontally defaults to false.public AbstractGridRowLayout(int[] weights, boolean fittingHorizontally)
weights
- int[] The amount of weight desired for each column in the
table. If fittingHorizontally is set to true, the sum of all
weights must be 100 and each weight indicates the percentage
of the whole table that each column will occupy. If
fittingHorizontally is set to false, each weight is the
minimum width of the column in pixels. If the table is
narrower than can fit all widths, CompositeTable will display
a horizontal scroll bar. If the table is wider than all
minimum column widths, the columns will be scaled so that the
ratios of the actual widths remains constant and all columns
fit exactly in the available space. fittingHorizontally
defaults to false.fittingHorizontally
- If true, the weights are interpreted as percentages and the
column widths are scaled so that each column occupies the
percentage of the total width indicated by its weight. If
false, the weights are interpreted as minimum column widths.
If the table is narrower than can accommodate those widths,
CompositeTable will display a horizontal scroll bar. If the
table is wider than all minimum column widths, the columns
will be scaled so that the ratios of the actual widths remains
constant and all columns fit exactly in the available space.protected org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.widgets.Composite child, int wHint, int hHint, boolean flushCache)
computeSize
in class CompositeTableLayout
protected void layout(org.eclipse.swt.widgets.Composite child, boolean flushCache)
layout
in class CompositeTableLayout
protected boolean isWidthWiderThanAllColumns(org.eclipse.swt.widgets.Composite headerOrRow)
headerOrRow
- The header or rowprotected int getAvailableWidth(org.eclipse.swt.widgets.Composite headerOrRow)
headerOrRow
- The header or row objectprotected abstract int getNumColumns(org.eclipse.swt.widgets.Composite rowOrHeader)
rowOrHeader
- The row or header object.protected abstract int computeMaxHeight(org.eclipse.swt.widgets.Composite rowOrHeader)
rowOrHeader
- The row or header Compositeprotected abstract org.eclipse.swt.widgets.Widget getColumnAt(org.eclipse.swt.widgets.Composite rowOrHeader, int offset)
rowOrHeader
- The header or row objectoffset
- The column's offset.protected abstract org.eclipse.swt.graphics.Point computeColumnSize(org.eclipse.swt.widgets.Widget columnObject, int wHint, int hHint, boolean flush)
columnObject
- The column objectwHint
- SWT.DEFAULT or a preferred width as an inthHint
- SWT.DEFAULT or a preferred height as an intflush
- If any cached size should be flushed and recomputed.protected abstract void setBounds(org.eclipse.swt.widgets.Widget columnObject, int left, int top, int width, int height)
columnObject
- The column object to placeleft
- The column's left coordinatetop
- The column's top coordinatewidth
- The column's widthheight
- The column's heightpublic int[] getWeights()
If !isFittingHorizontally, returns an array where each element is the minimum width in pixels of the corresponding column.
public AbstractGridRowLayout setWeights(int[] weights)
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.
weights
- the weights to use if the CompositeTable is automatically
laying out controls.public int getSumOfAllWeights()
public boolean isFittingHorizontally()
public AbstractGridRowLayout setFittingHorizontally(boolean fittingHorizontally)
fittingHorizontally
- true if the table's actual width is set to equal the visible
width; false otherwise.