public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMasterDetail>
VTreeMasterDetail
element.Modifier and Type | Field and Description |
---|---|
static String |
DETAIL_KEY
The detail key passed to the view model context.
|
static String |
GLOBAL_ADDITIONS
Menu separator ID for the group to which additional menu contributions are added in the
tree's context menu.
|
static String |
ROOT_KEY
Context key for the root.
|
CUSTOM_VARIANT
Constructor and Description |
---|
TreeMasterDetailSWTRenderer(VTreeMasterDetail vElement,
ViewModelContext viewContext,
ReportService reportService)
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyEnable()
Allows implementers to set a control to enabled.
|
protected void |
applyValidation(VDiagnostic oldDia,
VDiagnostic newDia)
Called before the
AbstractSWTRenderer.applyValidation() . |
protected void |
cleanCustomOnSelectionChange()
Gets called after a detail composite was disposed.
|
protected void |
createHeader(org.eclipse.swt.widgets.Composite parent)
Adds the header to a parent composite.
|
protected org.eclipse.swt.widgets.Composite |
createMasterDetailForm(org.eclipse.swt.widgets.Composite parent)
Create the parent of the master detail form.
|
protected org.eclipse.swt.widgets.Composite |
createMasterPanel(org.eclipse.swt.custom.SashForm sash)
Creates the composite for the master panel.
|
protected org.eclipse.jface.viewers.TreeViewer |
createMasterTree(org.eclipse.swt.widgets.Composite masterPanel)
Creates the tree viewer for the master.
|
protected org.eclipse.swt.custom.ScrolledComposite |
createRightPanelContent(org.eclipse.swt.widgets.Composite parent)
Creates the composite holding the details.
|
protected org.eclipse.swt.custom.SashForm |
createSash(org.eclipse.swt.widgets.Composite parent)
Creates the sashform for the master detail colums.
|
protected void |
dispose()
Disposes all resources used by the renderer.
|
protected String |
getDefaultFontName(org.eclipse.swt.widgets.Control control) |
protected org.eclipse.swt.widgets.Composite |
getDetailContainer()
Returns the composite for the detail.
|
ViewModelContext |
getDetailContext()
Obtain the current detail context, if any.
|
SWTGridDescription |
getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.
|
protected org.eclipse.jface.viewers.ILabelProvider |
getLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider adapterFactoryLabelProvider)
Returns the label provider.
|
org.eclipse.jface.viewers.TreePath |
getTreePathFor(Object object)
Get a path to an in my tree.
|
protected boolean |
hasContextMenu()
Return true if a context menu should be shown in the tree.
|
protected boolean |
hasDnDSupport()
Return true if the tree should support DnD.
|
boolean |
hasPath(org.eclipse.jface.viewers.TreePath path)
Query whether the given
path exists in my tree. |
protected Object |
manipulateSelection(Object treeSelected)
Allows to manipulate the selection by returning a specific child.
|
protected void |
manipulateViewContext(ViewModelContext viewContext)
Allows to manipulate the view context for the selected element that is about to be rendered.
|
protected List<MasterDetailAction> |
readMasterDetailActions()
Returns a list of all
MasterDetailActions which shall be displayed in the context menu
of the master treeviewer. |
protected void |
relayoutDetail()
Relayouts the detail composite.
|
protected org.eclipse.swt.widgets.Control |
renderControl(SWTGridCell cell,
org.eclipse.swt.widgets.Composite parent)
Renders the passed
VElement . |
boolean |
reveal(Object object)
Reveal the given
object in my tree. |
boolean |
reveal(org.eclipse.jface.viewers.TreePath path)
Reveal the given
path in my tree. |
applyReadOnly, applyValidation, applyVisible, canReveal, finalizeRendering, getControls, ignoreEnableOnReadOnly, init, isRenderingFinished, postInit, preInit, render, scrollToReveal, scrollToReveal, setControlEnabled
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
public static final String DETAIL_KEY
public static final String GLOBAL_ADDITIONS
public static final String ROOT_KEY
@Inject public TreeMasterDetailSWTRenderer(VTreeMasterDetail vElement, ViewModelContext viewContext, ReportService reportService)
vElement
- the view element to be renderedviewContext
- The view model contextreportService
- the ReportService to useprotected void dispose()
AbstractSWTRenderer
dispose
in class AbstractSWTRenderer<VTreeMasterDetail>
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
getGridDescription
in class AbstractSWTRenderer<VTreeMasterDetail>
gridDescription
- the current SWTGridDescription
AbstractSWTRenderer.getGridDescription(SWTGridDescription)
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
VElement
.renderControl
in class AbstractSWTRenderer<VTreeMasterDetail>
cell
- the GridCell
of the control to renderparent
- the Composite
to render onControl
NoRendererFoundException
- this is thrown when a renderer cannot be foundNoPropertyDescriptorFoundExeption
- this is thrown when no property descriptor can be foundAbstractSWTRenderer.renderControl(org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell,
org.eclipse.swt.widgets.Composite)
protected org.eclipse.swt.custom.SashForm createSash(org.eclipse.swt.widgets.Composite parent)
parent
- the parentprotected org.eclipse.swt.widgets.Composite createMasterDetailForm(org.eclipse.swt.widgets.Composite parent)
parent
- the parentprotected org.eclipse.jface.viewers.TreeViewer createMasterTree(org.eclipse.swt.widgets.Composite masterPanel)
masterPanel
- the parentprotected boolean hasContextMenu()
protected boolean hasDnDSupport()
protected org.eclipse.jface.viewers.ILabelProvider getLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider adapterFactoryLabelProvider)
adapterFactoryLabelProvider
- the adaper factory label providerprotected org.eclipse.swt.widgets.Composite createMasterPanel(org.eclipse.swt.custom.SashForm sash)
sash
- the parentprotected void createHeader(org.eclipse.swt.widgets.Composite parent)
parent
- the parentprotected org.eclipse.swt.custom.ScrolledComposite createRightPanelContent(org.eclipse.swt.widgets.Composite parent)
parent
- the parentprotected String getDefaultFontName(org.eclipse.swt.widgets.Control control)
getDefaultFontName
in class AbstractSWTRenderer<VTreeMasterDetail>
control
- The control to derive the default font name fromprotected List<MasterDetailAction> readMasterDetailActions()
MasterDetailActions
which shall be displayed in the context menu
of the master treeviewer.protected void manipulateViewContext(ViewModelContext viewContext)
viewContext
- the view context.protected org.eclipse.swt.widgets.Composite getDetailContainer()
protected Object manipulateSelection(Object treeSelected)
treeSelected
- the selected element in the treeprotected void cleanCustomOnSelectionChange()
protected void relayoutDetail()
public boolean reveal(Object object)
object
in my tree.object
- an object to revealpublic org.eclipse.jface.viewers.TreePath getTreePathFor(Object object)
object
- an object in my treepublic boolean reveal(org.eclipse.jface.viewers.TreePath path)
path
in my tree.path
- a tree path to revealpublic boolean hasPath(org.eclipse.jface.viewers.TreePath path)
path
exists in my tree.path
- a tree pathpublic ViewModelContext getDetailContext()
null
if none (usually because there is no selection in the tree)protected void applyEnable()
AbstractSWTRenderer
applyEnable
in class AbstractSWTRenderer<VTreeMasterDetail>
protected void applyValidation(VDiagnostic oldDia, VDiagnostic newDia)
AbstractSWTRenderer.applyValidation()
. This method allows to create a diff between the old diagnostic and
the new diagnostic and thus improve the performance of the overlay apply by triggering it only on the relevant
elements.applyValidation
in class AbstractSWTRenderer<VTreeMasterDetail>
oldDia
- The previous VDiagnostic
newDia
- The current VDiagnostic
AbstractSWTRenderer.applyValidation()
Copyright © 2019. All rights reserved.