com.ibm.jdg2e.swt.layouts
Class LayoutView

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.ui.part.WorkbenchPart
          extended byorg.eclipse.ui.part.ViewPart
              extended bycom.ibm.jdg2e.swt.layouts.LayoutView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation

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
 
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.
 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
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
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
 

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.

See Also:
IWorkbenchPart.createPartControl(Composite)

dispose

public void dispose()

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()
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 -