com.ibm.jdg2e.swt.layouts
Class LayoutView

java.lang.Object
  |
  +--org.eclipse.ui.part.WorkbenchPart
        |
        +--org.eclipse.ui.part.ViewPart
              |
              +--com.ibm.jdg2e.swt.layouts.LayoutView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2

public class LayoutView
extends org.eclipse.ui.part.ViewPart

Demonstrates the use of all the SWT layout managers and their associated classes. These include: FillLayout, RowLayout, GridLayout, and FormLayout. All the layouts are imbedded in a StackLayout with a field to select which layout to display.


Field Summary
(package private)  org.eclipse.swt.widgets.Button b1
           
(package private)  org.eclipse.swt.widgets.Button b2
           
(package private)  org.eclipse.swt.widgets.Button b3
           
(package private)  org.eclipse.swt.widgets.Button b4
           
(package private)  org.eclipse.swt.widgets.Button b5
           
(package private)  org.eclipse.swt.widgets.Button[] buttons
           
(package private)  org.eclipse.swt.widgets.Text city
           
(package private)  org.eclipse.swt.widgets.Label cityLbl
           
(package private)  org.eclipse.swt.widgets.Button clearButton
           
(package private) static java.lang.String CLEARED
           
(package private)  org.eclipse.swt.widgets.Button clearEntryButton
           
(package private)  java.lang.String currentValue
           
(package private)  org.eclipse.swt.widgets.Text displayLED
           
(package private) static int EXAMPLE_COUNT
           
(package private)  org.eclipse.swt.widgets.Text firstName
           
(package private)  org.eclipse.swt.widgets.Label firstNameLbl
           
(package private) static java.lang.String keyLabels
           
(package private)  java.lang.String lastKey
           
(package private)  org.eclipse.swt.widgets.Text lastName
           
(package private)  org.eclipse.swt.widgets.Label lastNameLbl
           
(package private) static java.lang.String[] layoutList
           
(package private) static int line2offset
           
(package private)  java.lang.String op
           
(package private)  java.lang.String previousValue
           
(package private) static java.lang.String SAMPLE_FILL_LAYOUT1
           
(package private) static java.lang.String SAMPLE_FORM_LAYOUT1
           
(package private) static java.lang.String SAMPLE_GRID_LAYOUT1
           
(package private) static java.lang.String SAMPLE_GRID_LAYOUT2
           
(package private) static java.lang.String SAMPLE_ROW_LAYOUT1
           
(package private)  org.eclipse.swt.widgets.Combo state
           
(package private)  org.eclipse.swt.widgets.Label stateLbl
           
(package private)  org.eclipse.swt.widgets.Text street
           
(package private)  org.eclipse.swt.widgets.Label streetLbl
           
 
Fields inherited from class org.eclipse.ui.part.ViewPart
 
Fields inherited from class org.eclipse.ui.part.WorkbenchPart
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
LayoutView()
           
 
Method Summary
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          Populate the view with the example layout managers.
private  void createStackContent(org.eclipse.swt.widgets.Composite[] stackLayoutContent)
           
 void dispose()
           
protected  void setButtons(org.eclipse.swt.widgets.Composite parent)
          Define the buttons used by the row and grid layout managers.
protected  void setCheckBoxes(org.eclipse.swt.widgets.Composite parent)
          Defines a set of checkbox style buttons used by FillLayout.
protected  void setFields(org.eclipse.swt.widgets.Composite group)
          Define the fields used in the grid and form layout examples.
protected  void setFillLayout(org.eclipse.swt.widgets.Composite parent)
          Creates a fill layout.
 void setFocus()
           
protected  void setFormLayoutAddress(org.eclipse.swt.widgets.Composite parent)
          Define a name and address form using a form layout.
protected  void setGridLayoutAddress(org.eclipse.swt.widgets.Composite parent)
          Define a name and address form using a grid layout.
protected  void setGridLayoutButtons(org.eclipse.swt.widgets.Composite parent)
          Layout buttons used by the first grid layout example.
protected  void setRowLayout(org.eclipse.swt.widgets.Composite parent)
          Create a simple row layout of buttons.
protected  void setStackLayout(org.eclipse.swt.widgets.Composite parent)
          Imbed all the layouts into a stack layout with a field to select the layout to display on top.
 
Methods inherited from class org.eclipse.ui.part.ViewPart
getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

b1

org.eclipse.swt.widgets.Button b1

b2

org.eclipse.swt.widgets.Button b2

b3

org.eclipse.swt.widgets.Button b3

b4

org.eclipse.swt.widgets.Button b4

b5

org.eclipse.swt.widgets.Button b5

buttons

org.eclipse.swt.widgets.Button[] buttons

city

org.eclipse.swt.widgets.Text city

cityLbl

org.eclipse.swt.widgets.Label cityLbl

clearButton

org.eclipse.swt.widgets.Button clearButton

CLEARED

static final java.lang.String CLEARED
See Also:
Constant Field Values

clearEntryButton

org.eclipse.swt.widgets.Button clearEntryButton

currentValue

java.lang.String currentValue

displayLED

org.eclipse.swt.widgets.Text displayLED

EXAMPLE_COUNT

static final int EXAMPLE_COUNT
See Also:
Constant Field Values

firstName

org.eclipse.swt.widgets.Text firstName

firstNameLbl

org.eclipse.swt.widgets.Label firstNameLbl

keyLabels

static final java.lang.String keyLabels
See Also:
Constant Field Values

lastKey

java.lang.String lastKey

lastName

org.eclipse.swt.widgets.Text lastName

lastNameLbl

org.eclipse.swt.widgets.Label lastNameLbl

layoutList

static java.lang.String[] layoutList

line2offset

static final int line2offset
See Also:
Constant Field Values

op

java.lang.String op

previousValue

java.lang.String previousValue

SAMPLE_FILL_LAYOUT1

static final java.lang.String SAMPLE_FILL_LAYOUT1
See Also:
Constant Field Values

SAMPLE_FORM_LAYOUT1

static final java.lang.String SAMPLE_FORM_LAYOUT1
See Also:
Constant Field Values

SAMPLE_GRID_LAYOUT1

static final java.lang.String SAMPLE_GRID_LAYOUT1
See Also:
Constant Field Values

SAMPLE_GRID_LAYOUT2

static final java.lang.String SAMPLE_GRID_LAYOUT2
See Also:
Constant Field Values

SAMPLE_ROW_LAYOUT1

static final java.lang.String SAMPLE_ROW_LAYOUT1
See Also:
Constant Field Values

state

org.eclipse.swt.widgets.Combo state

stateLbl

org.eclipse.swt.widgets.Label stateLbl

street

org.eclipse.swt.widgets.Text street

streetLbl

org.eclipse.swt.widgets.Label streetLbl
Constructor Detail

LayoutView

public LayoutView()
Method Detail

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Populate the view with the example layout managers.

Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart
See Also:
IWorkbenchPart.createPartControl(Composite)

createStackContent

private void createStackContent(org.eclipse.swt.widgets.Composite[] stackLayoutContent)

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart

setButtons

protected void setButtons(org.eclipse.swt.widgets.Composite parent)
Define the buttons used by the row and grid layout managers. Note: A listener is defined on Button b1 to demonstrate that different instances of these buttons are used in more than one layout. Widget disposal is not an issue. Even though the same names b1..b5 are used by each layout manager calling this method, they are separate Button instances, with separate Composite parent objects. Each parent is reponsible for disposal of it own children.


setCheckBoxes

protected void setCheckBoxes(org.eclipse.swt.widgets.Composite parent)
Defines a set of checkbox style buttons used by FillLayout.


setFields

protected void setFields(org.eclipse.swt.widgets.Composite group)
Define the fields used in the grid and form layout examples.


setFillLayout

protected void setFillLayout(org.eclipse.swt.widgets.Composite parent)
Creates a fill layout.


setFocus

public void setFocus()
Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart
See Also:
WorkbenchPart.setFocus()

setFormLayoutAddress

protected void setFormLayoutAddress(org.eclipse.swt.widgets.Composite parent)
Define a name and address form using a form layout.


setGridLayoutAddress

protected void setGridLayoutAddress(org.eclipse.swt.widgets.Composite parent)
Define a name and address form using a grid layout.


setGridLayoutButtons

protected void setGridLayoutButtons(org.eclipse.swt.widgets.Composite parent)
Layout buttons used by the first grid layout example.


setRowLayout

protected void setRowLayout(org.eclipse.swt.widgets.Composite parent)
Create a simple row layout of buttons.


setStackLayout

protected void setStackLayout(org.eclipse.swt.widgets.Composite parent)
Imbed all the layouts into a stack layout with a field to select the layout to display on top.

Parameters:
parent -