Class PageLayout


  • 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.

    Since:
    1.22
    • Field Summary

      • Fields inherited from class org.eclipse.swt.custom.StackLayout

        marginHeight, marginWidth, topControl
    • 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 given control as the current page and re-compute the composite's layout.
      • Methods inherited from class org.eclipse.swt.custom.StackLayout

        flushCache, layout, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PageLayout

        public PageLayout​(org.eclipse.swt.widgets.Composite composite)
        Initializes me with the composite for which I provide layout.
        Parameters:
        composite - my composite
    • Method Detail

      • showPage

        public void showPage​(org.eclipse.swt.widgets.Control control)
        Show the given control as the current page and re-compute the composite's layout.
        Parameters:
        control - the control to show (must not be null)
        Throws:
        java.lang.NullPointerException - if the control is null
        java.lang.IllegalArgumentException - if the control 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 class org.eclipse.swt.custom.StackLayout