Class AbstractSectionSWTRenderer
- java.lang.Object
-
- org.eclipse.emf.ecp.view.model.common.AbstractRenderer<VELEMENT>
-
- org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer<VSection>
-
- org.eclipse.emf.ecp.view.spi.section.swt.AbstractSectionSWTRenderer
-
- Direct Known Subclasses:
SectionLeafSWTRenderer
,SectionNodeSWTRenderer
public abstract class AbstractSectionSWTRenderer extends AbstractSWTRenderer<VSection>
Common super class for all section renderer.- Author:
- jfaltermeier
-
-
Field Summary
-
Fields inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
CUSTOM_VARIANT
-
-
Constructor Summary
Constructors Constructor Description AbstractSectionSWTRenderer(VSection vElement, ViewModelContext viewContext, ReportService reportService, VTViewTemplateProvider viewTemplateProvider)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
adjustLayoutData(boolean collapsed)
Adjusts the visibility for all gridcells based on the collapse state.protected int
computeLeftMargin()
protected abstract org.eclipse.swt.widgets.Control
createFirstColumn(org.eclipse.swt.widgets.Composite parent)
Renders the first column.protected void
dispose()
Disposes all resources used by the renderer.protected org.eclipse.emf.databinding.EMFDataBindingContext
getDataBindingContext()
Returns theEMFDataBindingContext
.protected EMFFormsRendererFactory
getEMFFormsRendererFactory()
Access to the EMFFormsRendererFactory.protected Optional<java.lang.Integer>
getLabelWidth()
The label width.protected VTViewTemplateProvider
getViewTemplateProvider()
protected abstract void
initCollapseState()
Called by theVSectionedArea
when all children have been renderered.protected org.eclipse.swt.widgets.Control
renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent)
Renders the passedVElement
.-
Methods inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
applyEnable, applyReadOnly, applyValidation, applyValidation, applyVisible, canReveal, finalizeRendering, getControls, getDefaultFontName, getGridDescription, ignoreEnableOnReadOnly, init, isRenderingFinished, postInit, preInit, render, scrollToReveal, scrollToReveal, setControlEnabled
-
Methods inherited from class org.eclipse.emf.ecp.view.model.common.AbstractRenderer
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
-
-
-
-
Constructor Detail
-
AbstractSectionSWTRenderer
public AbstractSectionSWTRenderer(VSection vElement, ViewModelContext viewContext, ReportService reportService, VTViewTemplateProvider viewTemplateProvider)
- Parameters:
vElement
- the view model element to be renderedviewContext
- the view contextreportService
- theReportService
viewTemplateProvider
- theVTViewTemplateProvider
- Since:
- 1.18
-
-
Method Detail
-
getViewTemplateProvider
protected VTViewTemplateProvider getViewTemplateProvider()
- Returns:
- the viewTemplateProvider the
VTViewTemplateProvider
- Since:
- 1.18
-
renderControl
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
Description copied from class:AbstractSWTRenderer
Renders the passedVElement
.- Specified by:
renderControl
in classAbstractSWTRenderer<VSection>
- Parameters:
cell
- theGridCell
of the control to renderparent
- theComposite
to render on- Returns:
- the rendered
Control
- Throws:
NoRendererFoundException
- this is thrown when a renderer cannot be foundNoPropertyDescriptorFoundExeption
- this is thrown when no property descriptor can be found
-
createFirstColumn
protected abstract org.eclipse.swt.widgets.Control createFirstColumn(org.eclipse.swt.widgets.Composite parent)
Renders the first column.- Parameters:
parent
- the parent composite- Returns:
- the rendered control
-
adjustLayoutData
protected void adjustLayoutData(boolean collapsed)
Adjusts the visibility for all gridcells based on the collapse state.- Parameters:
collapsed
- the collapse state
-
getEMFFormsRendererFactory
protected EMFFormsRendererFactory getEMFFormsRendererFactory()
Access to the EMFFormsRendererFactory.- Returns:
- The
EMFFormsRendererFactory
- Since:
- 1.6
-
getDataBindingContext
protected org.eclipse.emf.databinding.EMFDataBindingContext getDataBindingContext()
Returns theEMFDataBindingContext
.- Returns:
- the data binding context
- Since:
- 1.13
-
dispose
protected void dispose()
Disposes all resources used by the renderer. Don't forget to call super.dispose if overwriting this method.- Overrides:
dispose
in classAbstractSWTRenderer<VSection>
- See Also:
AbstractSWTRenderer.dispose()
-
initCollapseState
protected abstract void initCollapseState()
Called by theVSectionedArea
when all children have been renderered. Initialises the collapse state based onVSection.isCollapsed()
.- Since:
- 1.6
-
computeLeftMargin
protected int computeLeftMargin()
- Returns:
- the left margin
- Since:
- 1.16
-
getLabelWidth
protected Optional<java.lang.Integer> getLabelWidth()
The label width.- Returns:
- the width
- Since:
- 1.18
-
-