public abstract class SimpleControlSWTRenderer extends AbstractControlSWTRenderer<VControl>
CUSTOM_VARIANT
Constructor and Description |
---|
SimpleControlSWTRenderer(VControl vElement,
ViewModelContext viewContext,
ReportService reportService,
EMFFormsDatabinding emfFormsDatabinding,
EMFFormsLabelProvider emfFormsLabelProvider,
VTViewTemplateProvider vtViewTemplateProvider)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyReadOnly()
Marks a controls as readonly.
|
protected void |
applyValidation()
Allows implementers to display the validation state of the control.
|
protected abstract org.eclipse.swt.widgets.Control |
createControl(org.eclipse.swt.widgets.Composite parent)
Creates the control itself.
|
protected SWTGridCell |
createControlCell(int column)
Creates the control cell.
|
protected VTUnsettableStyleProperty |
createDefaultUnsettableStyleProperty()
Creates the default
VTUnsettableStyleProperty . |
protected SWTGridCell |
createLabelCell(int column)
Creates the label cell if necessary.
|
protected SWTGridCell |
createValidationCell(int column)
Creates the validation cell.
|
protected void |
dispose()
Disposes all resources used by the renderer.
|
SWTGridDescription |
getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.
|
protected Optional<Integer> |
getLabelWidth() |
protected VTUnsettableStyleProperty |
getUnsettableStyleProperty()
Returns the
VTUnsettableStyleProperty . |
protected abstract String |
getUnsetText()
Provide the unset text to show on the label when value is unset.
|
protected boolean |
isUnsettable()
Returns true if the control is unsettable.
|
protected org.eclipse.swt.widgets.Control |
renderControl(SWTGridCell gridCell,
org.eclipse.swt.widgets.Composite parent)
Renders the passed
VElement . |
protected void |
rootDomainModelChanged()
This method is called in
AbstractControlSWTRenderer.notifyChange() when the root domain model of the view model context changes. |
protected void |
setControlEnabled(SWTGridCell gridCell,
org.eclipse.swt.widgets.Control control,
boolean enabled)
Wraps the call to enable/disable a control.
|
protected void |
setControlIdData(org.eclipse.swt.widgets.Control control)
This method will set the element id data on the control created by
createControl(Composite) . |
protected void |
setValidationColor(org.eclipse.swt.widgets.Control control,
org.eclipse.swt.graphics.Color validationColor)
Set the provided validation color as the background for the provided control.
|
protected void |
setValidationForegroundColor(org.eclipse.swt.widgets.Control control,
org.eclipse.swt.graphics.Color validationColor)
Set the provided validation color as the foreground for the provided control.
|
applyEnable, applyUnchangeableFeature, canHandleControlProcessor, createLabel, createValidationIcon, defaultHandleControlProcessor, defaultHandleControlProcessorForCell, getDataBindingContext, getEditingDomain, getEMFFormsDatabinding, getEMFFormsLabelProvider, getLabelStyleBits, getModelValue, getValidationBackgroundColor, getValidationForegroundColor, getValidationIcon, getVTViewTemplateProvider, hasLeftLabelAlignment, isUnchangeableFeature, notifyChange, postInit, render
applyValidation, applyVisible, canReveal, finalizeRendering, getControls, getDefaultFontName, ignoreEnableOnReadOnly, init, isRenderingFinished, preInit, scrollToReveal, scrollToReveal
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
public SimpleControlSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider)
vElement
- the view model element to be renderedviewContext
- the view contextreportService
- The ReportService
emfFormsDatabinding
- The EMFFormsDatabinding
emfFormsLabelProvider
- The EMFFormsLabelProvider
vtViewTemplateProvider
- The VTViewTemplateProvider
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
getGridDescription
in class AbstractSWTRenderer<VControl>
gridDescription
- the current SWTGridDescription
AbstractSWTRenderer.getGridDescription(SWTGridDescription)
protected SWTGridCell createLabelCell(int column)
column
- column number within the grid rowprotected Optional<Integer> getLabelWidth()
protected SWTGridCell createValidationCell(int column)
column
- column number within the grid rowprotected SWTGridCell createControlCell(int column)
column
- column number within the grid rowprotected final org.eclipse.swt.widgets.Control renderControl(SWTGridCell gridCell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
VElement
.renderControl
in class AbstractSWTRenderer<VControl>
gridCell
- 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 foundorg.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)
protected boolean isUnsettable() throws DatabindingFailedException
DatabindingFailedException
- if the databinding failsprotected abstract String getUnsetText()
protected void setValidationColor(org.eclipse.swt.widgets.Control control, org.eclipse.swt.graphics.Color validationColor)
control
- the control to set the color onvalidationColor
- the validation color to setprotected void setValidationForegroundColor(org.eclipse.swt.widgets.Control control, org.eclipse.swt.graphics.Color validationColor)
control
- the control to set the color onvalidationColor
- the validation color to setprotected void setControlEnabled(SWTGridCell gridCell, org.eclipse.swt.widgets.Control control, boolean enabled)
AbstractSWTRenderer
setControlEnabled
in class AbstractSWTRenderer<VControl>
gridCell
- the SWTGridCell
to enable/disablecontrol
- the Control
to enable/disableenabled
- true if control should be enabled, false otherwiseprotected final void applyValidation()
AbstractSWTRenderer
applyValidation
in class AbstractSWTRenderer<VControl>
protected abstract org.eclipse.swt.widgets.Control createControl(org.eclipse.swt.widgets.Composite parent) throws DatabindingFailedException
parent
- the Composite
to render ontoDatabindingFailedException
- if the databinding of the control failsprotected void setControlIdData(org.eclipse.swt.widgets.Control control)
createControl(Composite)
.control
- the control created by createControl(Composite)
protected void dispose()
dispose
in class AbstractControlSWTRenderer<VControl>
AbstractSWTRenderer.dispose()
protected void rootDomainModelChanged() throws DatabindingFailedException
AbstractControlSWTRenderer
AbstractControlSWTRenderer.notifyChange()
when the root domain model of the view model context changes.rootDomainModelChanged
in class AbstractControlSWTRenderer<VControl>
DatabindingFailedException
- If the databinding failedprotected VTUnsettableStyleProperty createDefaultUnsettableStyleProperty()
VTUnsettableStyleProperty
.VTUnsettableStyleProperty
protected VTUnsettableStyleProperty getUnsettableStyleProperty()
VTUnsettableStyleProperty
.VTUnsettableStyleProperty
protected void applyReadOnly()
AbstractControlSWTRenderer
applyReadOnly
in class AbstractControlSWTRenderer<VControl>
AbstractSWTRenderer.applyReadOnly()
Copyright © 2019. All rights reserved.