Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.forms
Class MasterDetailsBlock


java.lang.Object
  extended by 
org.eclipse.ui.forms.MasterDetailsBlock

public abstract class MasterDetailsBlock
extends Object

This class implements the 'master/details' UI pattern suitable for inclusion in a form. The block consists of two parts: 'master' and 'details' in a sash form that allows users to change the relative ratio on the page. The master part needs to be created by the users of this class. The details part is created by the block.

The master part is responsible for adding itself as a form part and firing selection events. The details part catches the selection events and tries to load a page registered to handle the selected object(s). The page shows the details of the selected object(s) and allows users to edit them.

Details pages can be registered statically using 'registerPage' or dynamically through the use of 'IDetailsPageProvider' in case where different pages need to be shown for objects of the same type depending on their state.

Subclasses are required to implement abstract methods of this class. Master part must be created and at least one details page should be registered in order to show details of the objects selected in the master part. Tool bar actions can be optionally added to the tool bar manager.

Since:
3.0
See Also:
DetailsPart, IDetailsPage, IDetailsPageProvider

Field Summary
protected   DetailsPart detailsPart
          Details part created by the block.
protected   SashForm sashForm
          The form that is the parent of both master and details part.
 
Constructor Summary
MasterDetailsBlock ()
           
 
Method Summary
protected  void applyLayout ( Composite parent)
          Applies layout to the parent composite of the master/details block.
protected  void applyLayoutData ( SashForm sashForm)
          Applies layout data to the sash form containing master and detail parts of the master/details block.
 void createContent ( IManagedForm managedForm)
          Creates the content of the master/details block inside the managed form.
 void createContent ( IManagedForm managedForm, Composite parent)
          Creates the content of the master/details block inside the parent composite.
protected abstract  void createMasterPart ( IManagedForm managedForm, Composite parent)
          Implement this method to create a master part in the provided parent.
protected abstract  void createToolBarActions ( IManagedForm managedForm)
          Implement this method to create form tool bar actions and add them to the form tool bar if desired.
protected abstract  void registerPages ( DetailsPart detailsPart)
          Implement this method to statically register pages for the expected object types.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

detailsPart

protected 
DetailsPart detailsPart
Details part created by the block. No attempt should be made to access this field inside createMasterPart because it has not been created yet and will be null.


sashForm

protected 
SashForm sashForm
The form that is the parent of both master and details part. The form allows users to change the ratio between the two parts.

Constructor Detail

MasterDetailsBlock

public MasterDetailsBlock()
Method Detail

createContent

public void createContent(
IManagedForm managedForm)
Creates the content of the master/details block inside the managed form. This method should be called as late as possible inside the parent part.

Parameters:
managedForm - the managed form to create the block in

createContent

public void createContent(
IManagedForm managedForm,
                          
Composite parent)
Creates the content of the master/details block inside the parent composite. This method should be called as late as possible inside the parent part.

Parameters:
managedForm - the managed form to create the block in
Since:
3.4

applyLayoutData

protected void applyLayoutData(
SashForm sashForm)
Applies layout data to the sash form containing master and detail parts of the master/details block.

The default implementation fills the whole parent composite area. Override this method if master/details block is to be placed on a form along with other components.

Implementations that override this method should also override applyLayout(Composite) method implementation.

Parameters:
sashForm - The sash form to be laid out on the parent composite.
Since:
3.4
See Also:
applyLayout(Composite)

applyLayout

protected void applyLayout(
Composite parent)
Applies layout to the parent composite of the master/details block.

The default implementation fills the whole parent composite area. Override this method if master/details block is to be placed on a form along with other components.

Implementations that override this method should also override applyLayoutData(SashForm) method implementation.

Parameters:
parent - parent composite for the master/details block
Since:
3.4
See Also:
applyLayoutData(SashForm)

createMasterPart

protected abstract void createMasterPart(
IManagedForm managedForm,
                                         
Composite parent)
Implement this method to create a master part in the provided parent. Typical master parts are section parts that contain tree or table viewer.

Parameters:
managedForm - the parent form
parent - the parent composite

registerPages

protected abstract void registerPages(
DetailsPart detailsPart)
Implement this method to statically register pages for the expected object types. This mechanism can be used when there is 1->1 mapping between object classes and details pages.

Parameters:
detailsPart - the details part

createToolBarActions

protected abstract void createToolBarActions(
IManagedForm managedForm)
Implement this method to create form tool bar actions and add them to the form tool bar if desired.

Parameters:
managedForm - the form that owns the tool bar

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire