public class PageLayout
extends org.eclipse.swt.custom.StackLayout
A specialization of the StackLayout
that behaves more like the layout
of the PageBook
control that implements paged views in Eclipse.
Most importantly, it does not constrain all of its "page" controls to have
the size of the largest among them.
Note that as this class is a kind of StackLayout
, it
exposes a public StackLayout.topControl
field. Clients should not
access or modify this field directly but instead use the provided
getCurrentPage()
and showPage(Control)
APIs.
Constructor and Description |
---|
PageLayout(org.eclipse.swt.widgets.Composite composite)
Initializes me with the composite for which I provide layout.
|
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.swt.graphics.Point |
computeSize(org.eclipse.swt.widgets.Composite composite,
int wHint,
int hHint,
boolean flushCache) |
org.eclipse.swt.widgets.Control |
getCurrentPage()
Query what is the current page that I am showing.
|
void |
showPage(org.eclipse.swt.widgets.Control control)
Show the given
control as the current page and re-compute the
composite's layout. |
public PageLayout(org.eclipse.swt.widgets.Composite composite)
composite
- my compositepublic void showPage(org.eclipse.swt.widgets.Control control)
control
as the current page and re-compute the
composite's layout.control
- the control to show (must not be null
)NullPointerException
- if the control
is null
IllegalArgumentException
- if the control
is not a child of my compositepublic org.eclipse.swt.widgets.Control getCurrentPage()
null
if none is currentprotected org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)
computeSize
in class org.eclipse.swt.custom.StackLayout
Copyright © 2020. All rights reserved.