public abstract class EditorMasterDetailsBlock extends AbstractEditorPart implements org.eclipse.jface.viewers.ISelectionChangedListener
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 'IElementDetailsPartProvider' 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.
| Modifier and Type | Field and Description |
|---|---|
protected EditorPartBook |
detailsPartBook
Details part created by the block.
|
protected CSashForm |
sashForm
The form that is the parent of both master and details part.
|
| Constructor and Description |
|---|
EditorMasterDetailsBlock() |
| Modifier and Type | Method and Description |
|---|---|
void |
commit(boolean onSave) |
void |
createContents(org.eclipse.swt.widgets.Composite parent)
Creates the content of the master/details block inside the managed form.
|
protected abstract void |
createMasterPart(org.eclipse.swt.widgets.Composite parent)
Implement this method to create a master part in the provided parent.
|
protected void |
detailsCommitted(org.eclipse.jface.viewers.ISelection selection) |
protected void |
detailsRefreshed(IEditorPart detailsPart) |
void |
dispose() |
boolean |
isDirty() |
boolean |
isStale() |
void |
refresh() |
protected abstract void |
registerParts(EditorPartBook detailsMainPart)
Implement this method to statically register parts for the expected
object types.
|
void |
selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event) |
activate, addPart, addPart, addTextBorder, asyncExec, commitParts, deactivate, disposeParts, getForm, getIgnoreChanges, getParts, getShell, getWidgetFactory, initialize, initialize, refreshParts, removePart, setDirty, setEditorInput, setFocus, setIgnoreChanges, setInput, setStale, syncExecprotected EditorPartBook detailsPartBook
createMasterPart because it has not been
created yet and will be null.protected CSashForm sashForm
public void createContents(org.eclipse.swt.widgets.Composite parent)
createContents in interface IEditorPartmanagedForm - the managed form to create the block inprotected abstract void createMasterPart(org.eclipse.swt.widgets.Composite parent)
parent - the parent compositeprotected abstract void registerParts(EditorPartBook detailsMainPart)
detailsMainPart - the details partpublic void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
selectionChanged in interface org.eclipse.jface.viewers.ISelectionChangedListenerprotected void detailsCommitted(org.eclipse.jface.viewers.ISelection selection)
protected void detailsRefreshed(IEditorPart detailsPart)
public void commit(boolean onSave)
commit in interface IEditorPartcommit in class AbstractEditorPartpublic boolean isDirty()
isDirty in interface IEditorPartisDirty in class AbstractEditorPartpublic boolean isStale()
isStale in interface IEditorPartisStale in class AbstractEditorPartpublic void refresh()
refresh in interface IEditorPartrefresh in class AbstractEditorPartpublic void dispose()
dispose in interface IEditorPartdispose in class AbstractEditorPartCopyright © 2022 Fraunhofer IWU. All rights reserved.