Class ContainerSWTRenderer<VELEMENT extends VElement>
- java.lang.Object
-
- org.eclipse.emf.ecp.view.model.common.AbstractRenderer<VELEMENT>
-
- org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer<VELEMENT>
-
- org.eclipse.emf.ecp.view.spi.core.swt.ContainerSWTRenderer<VELEMENT>
-
- Type Parameters:
VELEMENT
- theVElement
of the renderer
- Direct Known Subclasses:
CollapsableGroupSWTRenderer
,DIContainerSWTRenderer
,GroupSWTRenderer
,PGroupRenderer
,SWTCategoryRenderer
,SWTStackItemRenderer
,VerticalLayoutSWTRenderer
,ViewSWTRenderer
public abstract class ContainerSWTRenderer<VELEMENT extends VElement> extends AbstractSWTRenderer<VELEMENT>
TheContainerSWTRenderer
is a super class for all Renderer which renders its contents vertically.- Author:
- Eugen Neufeld
-
-
Field Summary
-
Fields inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
CUSTOM_VARIANT
-
-
Constructor Summary
Constructors Constructor Description ContainerSWTRenderer(VELEMENT vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsRendererFactory factory)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
dispose()
Disposes all resources used by the renderer.protected java.util.Collection<VContainedElement>
getChildren()
The collection of children to iterate over.protected org.eclipse.swt.widgets.Composite
getComposite(org.eclipse.swt.widgets.Composite parent)
Allows to customize the composite which is used to render the children onto.protected java.lang.String
getCustomVariant()
The custom variant to set for styling.protected EMFFormsRendererFactory
getEMFFormsRendererFactory()
TheEMFFormsRendererFactory
to use.SWTGridDescription
getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.protected org.eclipse.swt.widgets.Layout
getLayout(int numControls, boolean equalWidth)
Returns the layout to use.protected org.eclipse.swt.widgets.Control
renderControl(SWTGridCell gridCell, org.eclipse.swt.widgets.Composite parent)
Renders the passedVElement
.protected void
setLayoutDataForControl(SWTGridCell gridCell, SWTGridDescription gridDescription, SWTGridDescription currentRowGridDescription, SWTGridDescription fullGridDescription, VElement vElement, org.eclipse.swt.widgets.Control control)
Sets the LayoutData for the specified control.-
Methods inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
applyEnable, applyReadOnly, applyValidation, applyValidation, applyVisible, canReveal, finalizeRendering, getControls, getDefaultFontName, 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
-
ContainerSWTRenderer
public ContainerSWTRenderer(VELEMENT vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsRendererFactory factory)
Default constructor.- Parameters:
vElement
- the view model element to be renderedviewContext
- the view contextreportService
- theReportService
factory
- theEMFFormsRendererFactory
- Since:
- 1.20
-
-
Method Detail
-
getEMFFormsRendererFactory
protected final EMFFormsRendererFactory getEMFFormsRendererFactory()
TheEMFFormsRendererFactory
to use.- Returns:
- the
EMFFormsRendererFactory
- Since:
- 1.6
-
getGridDescription
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.- Specified by:
getGridDescription
in classAbstractSWTRenderer<VELEMENT extends VElement>
- Parameters:
gridDescription
- the currentSWTGridDescription
- Returns:
- the number of controls per row
- See Also:
AbstractSWTRenderer.getGridDescription(SWTGridDescription)
-
renderControl
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell gridCell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
Renders the passedVElement
.- Specified by:
renderControl
in classAbstractSWTRenderer<VELEMENT extends VElement>
- Parameters:
gridCell
- 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- See Also:
org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer#renderControl(int, org.eclipse.swt.widgets.Composite, org.eclipse.emf.ecp.view.spi.model.VElement, org.eclipse.emf.ecp.view.spi.context.ViewModelContext)
-
getCustomVariant
protected java.lang.String getCustomVariant()
The custom variant to set for styling.- Returns:
- the string used by rap for styling
-
getChildren
protected java.util.Collection<VContainedElement> getChildren()
The collection of children to iterate over.- Returns:
- the collection of children to render
-
getComposite
protected org.eclipse.swt.widgets.Composite getComposite(org.eclipse.swt.widgets.Composite parent)
Allows to customize the composite which is used to render the children onto.- Parameters:
parent
- the parentComposite
to use as a parent- Returns:
- the
Composite
or a subclass to use
-
getLayout
protected org.eclipse.swt.widgets.Layout getLayout(int numControls, boolean equalWidth)
Returns the layout to use.- Parameters:
numControls
- number of columns to createequalWidth
- whether the columns should be equal- Returns:
- the
Layout
-
setLayoutDataForControl
protected void setLayoutDataForControl(SWTGridCell gridCell, SWTGridDescription gridDescription, SWTGridDescription currentRowGridDescription, SWTGridDescription fullGridDescription, VElement vElement, org.eclipse.swt.widgets.Control control)
Sets the LayoutData for the specified control.- Parameters:
gridCell
- theGridCell
used to render the controlgridDescription
- theGridDescription
of the parent which rendered the controlcurrentRowGridDescription
- theGridDescription
of the current rowfullGridDescription
- theGridDescription
of the whole containervElement
- theVElement
to set the layoutData forcontrol
- the control to set the layout to- Since:
- 1.6
-
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<VELEMENT extends VElement>
- See Also:
AbstractSWTRenderer.dispose()
-
-