public abstract class MasterDetailsBlock extends Object
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.
DetailsPart
,
IDetailsPage
,
IDetailsPageProvider
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
MasterDetailsBlock() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected DetailsPart detailsPart
createMasterPart
because it has not been
created yet and will be null
.protected SashForm sashForm
public void createContent(IManagedForm managedForm)
managedForm
- the managed form to create the block inpublic void createContent(IManagedForm managedForm, Composite parent)
managedForm
- the managed form to create the block inprotected void applyLayoutData(SashForm sashForm)
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.
sashForm
- The sash form to be laid out on the parent composite.applyLayout(Composite)
protected void applyLayout(Composite parent)
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.
parent
- parent composite for the master/details blockapplyLayoutData(SashForm)
protected abstract void createMasterPart(IManagedForm managedForm, Composite parent)
managedForm
- the parent formparent
- the parent compositeprotected abstract void registerPages(DetailsPart detailsPart)
detailsPart
- the details partprotected abstract void createToolBarActions(IManagedForm managedForm)
managedForm
- the form that owns the tool bar
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.