Class PageLayout
- java.lang.Object
-
- org.eclipse.swt.widgets.Layout
-
- org.eclipse.swt.custom.StackLayout
-
- org.eclipse.emf.ecp.view.spi.swt.layout.PageLayout
-
public class PageLayout extends org.eclipse.swt.custom.StackLayout
A specialization of the
StackLayout
that behaves more like the layout of thePageBook
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 publicStackLayout.topControl
field. Clients should not access or modify this field directly but instead use the providedgetCurrentPage()
andshowPage(Control)
APIs.- Since:
- 1.22
-
-
Constructor Summary
Constructors Constructor Description PageLayout(org.eclipse.swt.widgets.Composite composite)
Initializes me with the composite for which I provide layout.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 givencontrol
as the current page and re-compute the composite's layout.
-
-
-
Method Detail
-
showPage
public void showPage(org.eclipse.swt.widgets.Control control)
Show the givencontrol
as the current page and re-compute the composite's layout.- Parameters:
control
- the control to show (must not benull
)- Throws:
java.lang.NullPointerException
- if thecontrol
isnull
java.lang.IllegalArgumentException
- if thecontrol
is not a child of my composite
-
getCurrentPage
public org.eclipse.swt.widgets.Control getCurrentPage()
Query what is the current page that I am showing.- Returns:
- my current page, or
null
if none is current
-
computeSize
protected org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)
- Overrides:
computeSize
in classorg.eclipse.swt.custom.StackLayout
-
-