Class TreeColumnLayout
- java.lang.Object
-
- org.eclipse.swt.widgets.Layout
-
- org.eclipse.jface.layout.AbstractColumnLayout
-
- org.eclipse.jface.layout.TreeColumnLayout
-
public class TreeColumnLayout extends AbstractColumnLayout
The TreeColumnLayout is theLayout
used to maintainTreeColumn
sizes in aTree
.You can only add the
Layout
to a container whose only child is theTree
control you want theLayout
applied to. Don't assign the layout directly theTree
- Since:
- 3.3
-
-
Field Summary
-
Fields inherited from class org.eclipse.jface.layout.AbstractColumnLayout
LAYOUT_DATA
-
-
Constructor Summary
Constructors Constructor Description TreeColumnLayout()
Creates a new tree column layout.TreeColumnLayout(boolean adjustForScrollBar)
Creates a new tree column layout.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getColumnCount(Scrollable tree)
Get the number of columns for the receiver.protected ColumnLayoutData
getLayoutData(Scrollable tableTree, int columnIndex)
Get the layout data for a columnprotected void
layout(Composite composite, boolean flushCache)
Lays out the children of the specified composite according to this layout.protected void
setColumnWidths(Scrollable tree, int[] widths)
Set the widths of the columns.protected void
updateColumnData(Widget column)
Update the layout data for a column-
Methods inherited from class org.eclipse.jface.layout.AbstractColumnLayout
computeSize, getColumnTrim, setColumnData
-
Methods inherited from class org.eclipse.swt.widgets.Layout
flushCache
-
-
-
-
Constructor Detail
-
TreeColumnLayout
public TreeColumnLayout()
Creates a new tree column layout.
-
TreeColumnLayout
public TreeColumnLayout(boolean adjustForScrollBar)
Creates a new tree column layout.- Parameters:
adjustForScrollBar
-true
if the layout should reserve space for the vertical scroll bar- Since:
- 3.12
-
-
Method Detail
-
layout
protected void layout(Composite composite, boolean flushCache)
Description copied from class:Layout
Lays out the children of the specified composite according to this layout.This method positions and sizes the children of a composite using the layout algorithm encoded by this layout. Children of the composite are positioned in the client area of the composite. The position of the composite is not altered by this method.
When the flush cache hint is true, the layout is instructed to flush any cached values associated with the children. Typically, a layout will cache the preferred sizes of the children to avoid the expense of computing these values each time the widget is laid out.
When layout is triggered explicitly by the programmer the flush cache hint is true. When layout is triggered by a resize, either caused by the programmer or by the user, the hint is false.
- Overrides:
layout
in classAbstractColumnLayout
- Parameters:
composite
- a composite widget using this layoutflushCache
-true
means flush cached layout values
-
getColumnCount
protected int getColumnCount(Scrollable tree)
Get the number of columns for the receiver.- Specified by:
getColumnCount
in classAbstractColumnLayout
- Parameters:
tree
- the control- Returns:
- the number of columns
- Since:
- 3.5
-
setColumnWidths
protected void setColumnWidths(Scrollable tree, int[] widths)
Set the widths of the columns.- Specified by:
setColumnWidths
in classAbstractColumnLayout
- Parameters:
tree
- the controlwidths
- the widths of the column- Since:
- 3.5
-
getLayoutData
protected ColumnLayoutData getLayoutData(Scrollable tableTree, int columnIndex)
Get the layout data for a column- Specified by:
getLayoutData
in classAbstractColumnLayout
- Parameters:
tableTree
- the controlcolumnIndex
- the column index- Returns:
- the layout data, might not null
- Since:
- 3.5
-
updateColumnData
protected void updateColumnData(Widget column)
Update the layout data for a column- Specified by:
updateColumnData
in classAbstractColumnLayout
- Parameters:
column
- the column- Since:
- 3.5
-
-