Class CustomControlSWTRenderer
- java.lang.Object
-
- org.eclipse.emf.ecp.view.model.common.AbstractRenderer<VELEMENT>
-
- org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer<VCustomControl>
-
- org.eclipse.emf.ecp.view.spi.custom.swt.CustomControlSWTRenderer
-
- Direct Known Subclasses:
DICustomControlSWTRenderer
public class CustomControlSWTRenderer extends AbstractSWTRenderer<VCustomControl>
The renderer for custom control view models.- Since:
- 1.3
- Author:
- Eugen Neufeld
-
-
Field Summary
-
Fields inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
CUSTOM_VARIANT
-
-
Constructor Summary
Constructors Constructor Description CustomControlSWTRenderer(VCustomControl vElement, ViewModelContext viewContext, ReportService reportService)
Legacy Constructor.CustomControlSWTRenderer(VCustomControl vElement, ViewModelContext viewContext, ReportService reportService, SWTValidationUiService validationUiService)
Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyEnable()
Allows implementers to set a control to enabled.protected void
applyReadOnly()
Marks a controls as readonly.protected void
applyValidation()
Allows implementers to display the validation state of the control.protected void
applyVisible()
Allows implementers to check and set the visibility on the whole result row.protected boolean
canHandleControlProcessor()
Indicates whether theECPAbstractCustomControlSWT
can handle a possibly existingEMFFormsControlProcessorService
itself.protected void
defaultHandleControlProcessor(org.eclipse.swt.widgets.Control control)
Calls a possibly existingEMFFormsControlProcessorService
for the givencontrol
.protected void
dispose()
Disposes all resources used by the renderer.SWTGridDescription
getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.protected ECPAbstractCustomControlSWT
loadCustomControl(VCustomControl customControl)
Loads and returns theECPAbstractCustomControlSWT
that is referenced by theVCustomControl
.protected void
preInit()
Use this method to initialize objects which are needed already before rendering.org.eclipse.swt.widgets.Control
render(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent)
Renders the passedVElement
.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
applyValidation, canReveal, finalizeRendering, getControls, getDefaultFontName, ignoreEnableOnReadOnly, init, isRenderingFinished, postInit, scrollToReveal, scrollToReveal, setControlEnabled
-
Methods inherited from class org.eclipse.emf.ecp.view.model.common.AbstractRenderer
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
-
-
-
-
Constructor Detail
-
CustomControlSWTRenderer
public CustomControlSWTRenderer(VCustomControl vElement, ViewModelContext viewContext, ReportService reportService)
Legacy Constructor.- Parameters:
vElement
- the view element to be renderedviewContext
- The view model contextreportService
- the ReportService to use- Since:
- 1.6
-
CustomControlSWTRenderer
public CustomControlSWTRenderer(VCustomControl vElement, ViewModelContext viewContext, ReportService reportService, SWTValidationUiService validationUiService)
Default Constructor.- Parameters:
vElement
- the view element to be renderedviewContext
- The view model contextreportService
- the ReportService to usevalidationUiService
- theSWTValidationUiService
to use- Since:
- 1.23
-
-
Method Detail
-
preInit
protected void preInit()
Use this method to initialize objects which are needed already before rendering.- Overrides:
preInit
in classAbstractSWTRenderer<VCustomControl>
- See Also:
AbstractSWTRenderer.preInit()
-
loadCustomControl
protected ECPAbstractCustomControlSWT loadCustomControl(VCustomControl customControl)
Loads and returns theECPAbstractCustomControlSWT
that is referenced by theVCustomControl
.- Parameters:
customControl
- the custom control view model- Returns:
- the swt renderer
- Since:
- 1.4
-
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<VCustomControl>
- See Also:
AbstractSWTRenderer.dispose()
-
getGridDescription
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.- Specified by:
getGridDescription
in classAbstractSWTRenderer<VCustomControl>
- Parameters:
gridDescription
- the currentSWTGridDescription
- Returns:
- the number of controls per row
- See Also:
AbstractSWTRenderer.getGridDescription(SWTGridDescription)
-
render
public org.eclipse.swt.widgets.Control render(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
Renders the passedVElement
.- Overrides:
render
in classAbstractSWTRenderer<VCustomControl>
- Parameters:
cell
- theSWTGridCell
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:
AbstractSWTRenderer.render(org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell, org.eclipse.swt.widgets.Composite)
-
renderControl
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
Renders the passedVElement
.- Specified by:
renderControl
in classAbstractSWTRenderer<VCustomControl>
- 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- See Also:
AbstractSWTRenderer.renderControl(org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell, org.eclipse.swt.widgets.Composite)
-
canHandleControlProcessor
protected boolean canHandleControlProcessor()
Indicates whether theECPAbstractCustomControlSWT
can handle a possibly existingEMFFormsControlProcessorService
itself.- Returns:
true
if theECPAbstractCustomControlSWT
can handle a possibly existingEMFFormsControlProcessorService
itself,false
otherwise.- Since:
- 1.8
-
defaultHandleControlProcessor
protected void defaultHandleControlProcessor(org.eclipse.swt.widgets.Control control)
Calls a possibly existingEMFFormsControlProcessorService
for the givencontrol
.- Parameters:
control
- TheControl
which is to be processed by theEMFFormsControlProcessorService
.- Since:
- 1.8
-
applyReadOnly
protected void applyReadOnly()
Description copied from class:AbstractSWTRenderer
Marks a controls as readonly.- Overrides:
applyReadOnly
in classAbstractSWTRenderer<VCustomControl>
-
applyEnable
protected void applyEnable()
Description copied from class:AbstractSWTRenderer
Allows implementers to set a control to enabled.- Overrides:
applyEnable
in classAbstractSWTRenderer<VCustomControl>
-
applyVisible
protected void applyVisible()
Description copied from class:AbstractSWTRenderer
Allows implementers to check and set the visibility on the whole result row.- Overrides:
applyVisible
in classAbstractSWTRenderer<VCustomControl>
-
applyValidation
protected void applyValidation()
Allows implementers to display the validation state of the control. The default implementation does nothing.- Overrides:
applyValidation
in classAbstractSWTRenderer<VCustomControl>
-
-