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
Static string.
|
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.
|
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.
|
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.
|
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 . |
applyReadOnly, applyValidation, applyVisible, finalizeRendering, getControls, init, postInit, preInit, render, setControlEnabled
checkRenderer, getReportService, getVElement, getViewModelContext
public static final String DETAIL_KEY
public static final String ROOT_KEY
public static final String GLOBAL_ADDITIONS
@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()
dispose
in class AbstractSWTRenderer<VTreeMasterDetail>
AbstractSWTRenderer.dispose()
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()
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 © 2018. All rights reserved.