Package com.iizix.swt

Class SWTBorderLayout

java.lang.Object
org.eclipse.swt.widgets.Layout
com.iizix.swt.SWTBorderLayout

public class SWTBorderLayout extends org.eclipse.swt.widgets.Layout
Lays out a composite, arranging and resizing its components to fit in five regions: north, south, east, west, and center.
 shell.setLayout(new SWTBorderLayout());
 
 Button buttonWest=new Button(shell,SWT.PUSH);
 buttonWest.setText("West");
 buttonWest.setLayoutData(new BorderLayout.BorderData(SWTBorderLayout.WEST));
 
 Button buttonEast=new Button(shell,SWT.PUSH);
 buttonEast.setText("East");
 buttonEast.setLayoutData(new BorderLayout.BorderData(SWTBorderLayout.EAST));
 
 Button buttonNorth=new Button(shell,SWT.PUSH);
 buttonNorth.setText("North");
 buttonNorth.setLayoutData(new BorderLayout.BorderData(SWTBorderLayout.NORTH));
 
 Button buttonSouth=new Button(shell,SWT.PUSH);
 buttonSouth.setText("South");
 buttonSouth.setLayoutData(new BorderLayout.BorderData(SWTBorderLayout.SOUTH));
 
 Text text=new Text(shell,SWT.MULTI|SWT.BORDER|SWT.V_SCROLL|SWT.H_SCROLL);
 text.setText("Center");
 text.setLayoutData(new SWTBorderLayout.BorderData(SWTBorderLayout.CENTER));
 
Author:
Christopher Mindus
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Indicates the region that a control belongs to.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.eclipse.swt.graphics.Point
    computeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)
     
    protected void
    layout(org.eclipse.swt.widgets.Composite composite, boolean flushCache)
     

    Methods inherited from class org.eclipse.swt.widgets.Layout

    flushCache

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SWTBorderLayout

      public SWTBorderLayout()
  • Method Details

    • computeSize

      protected org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)
      Specified by:
      computeSize in class org.eclipse.swt.widgets.Layout
    • layout

      protected void layout(org.eclipse.swt.widgets.Composite composite, boolean flushCache)
      Specified by:
      layout in class org.eclipse.swt.widgets.Layout