Class DateTimeControlSWTRenderer
- java.lang.Object
-
- org.eclipse.emf.ecp.view.model.common.AbstractRenderer<VELEMENT>
-
- org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer<VCONTROL>
-
- org.eclipse.emf.ecp.view.spi.core.swt.AbstractControlSWTRenderer<VControl>
-
- org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTRenderer
-
- org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTControlSWTRenderer
-
- org.eclipse.emf.ecp.view.internal.core.swt.renderer.DateTimeControlSWTRenderer
-
- All Implemented Interfaces:
RootDomainModelChangeListener
public class DateTimeControlSWTRenderer extends SimpleControlSWTControlSWTRenderer
A control which can handleDate
.- Author:
- Eugen Neufeld
-
-
Field Summary
-
Fields inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
CUSTOM_VARIANT
-
-
Constructor Summary
Constructors Constructor Description DateTimeControlSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, EMFFormsLocalizationService localizationService, ImageRegistryService imageRegistryService)
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 org.eclipse.core.databinding.Binding[]
createBindings(org.eclipse.swt.widgets.Control control)
Create theBindings
for this controls.protected org.eclipse.swt.widgets.Control
createSWTControl(org.eclipse.swt.widgets.Composite parent)
Creates the Control.protected void
dispose()
Disposes all resources used by the renderer.protected java.lang.String
getUnsetText()
Provide the unset text to show on the label when value is unset.protected void
rootDomainModelChanged()
This method is called inAbstractControlSWTRenderer.notifyChange()
when the root domain model of the view model context changes.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
updateButtonEnabling()
Updates the enablement of buttons according to the bound input.protected void
updateButtonVisibility()
Updates the visibility of buttons according to the bound input.-
Methods inherited from class org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTControlSWTRenderer
createControl, getFeature, withPreSetValidation
-
Methods inherited from class org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTRenderer
applyValidation, createControlCell, createDefaultUnsettableStyleProperty, createLabelCell, createValidationCell, getGridDescription, getLabelWidth, getUnsettableStyleProperty, isUnsettable, renderControl, setControlEnabled, setControlIdData, setValidationForegroundColor
-
Methods inherited from class org.eclipse.emf.ecp.view.spi.core.swt.AbstractControlSWTRenderer
applyUnchangeableFeature, canHandleControlProcessor, createLabel, createValidationIcon, defaultHandleControlProcessor, defaultHandleControlProcessorForCell, getDataBindingContext, getEditingDomain, getEMFFormsDatabinding, getEMFFormsLabelProvider, getLabelStyleBits, getModelValue, getValidationBackgroundColor, getValidationBackgroundColor, getValidationForegroundColor, getValidationForegroundColor, getValidationIcon, getValidationIcon, getVTViewTemplateProvider, hasLeftLabelAlignment, isUnchangeableFeature, notifyChange, postInit, render
-
Methods inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
applyValidation, applyVisible, canReveal, finalizeRendering, getControls, getDefaultFontName, ignoreEnableOnReadOnly, init, isRenderingFinished, preInit, scrollToReveal, scrollToReveal
-
Methods inherited from class org.eclipse.emf.ecp.view.model.common.AbstractRenderer
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
-
-
-
-
Constructor Detail
-
DateTimeControlSWTRenderer
@Inject public DateTimeControlSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, EMFFormsLocalizationService localizationService, ImageRegistryService imageRegistryService)
Default constructor.- Parameters:
vElement
- the view model element to be renderedviewContext
- the view contextreportService
- TheReportService
emfFormsDatabinding
- TheEMFFormsDatabinding
emfFormsLabelProvider
- TheEMFFormsLabelProvider
vtViewTemplateProvider
- TheVTViewTemplateProvider
localizationService
- TheEMFFormsLocalizationService
imageRegistryService
- TheImageRegistryService
-
-
Method Detail
-
createBindings
protected org.eclipse.core.databinding.Binding[] createBindings(org.eclipse.swt.widgets.Control control) throws DatabindingFailedException
Description copied from class:SimpleControlSWTControlSWTRenderer
Create theBindings
for this controls.- Specified by:
createBindings
in classSimpleControlSWTControlSWTRenderer
- Parameters:
control
- theControl
to create the binding for- Returns:
- all the bindings created by this renderer
- Throws:
DatabindingFailedException
- if the creation of the bindings fails.
-
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 classSimpleControlSWTRenderer
- See Also:
SimpleControlSWTRenderer.dispose()
-
createSWTControl
protected org.eclipse.swt.widgets.Control createSWTControl(org.eclipse.swt.widgets.Composite parent) throws DatabindingFailedException
Description copied from class:SimpleControlSWTControlSWTRenderer
Creates the Control.- Specified by:
createSWTControl
in classSimpleControlSWTControlSWTRenderer
- Parameters:
parent
- theComposite
to use as a parent- Returns:
- the created control
- Throws:
DatabindingFailedException
- if the creation of the control fails due to databinding problems
-
applyReadOnly
protected void applyReadOnly()
Description copied from class:AbstractControlSWTRenderer
Marks a controls as readonly.- Overrides:
applyReadOnly
in classSimpleControlSWTRenderer
- See Also:
AbstractSWTRenderer.applyReadOnly()
-
applyEnable
protected void applyEnable()
Description copied from class:AbstractControlSWTRenderer
Allows implementers to set a control to enabled.- Overrides:
applyEnable
in classAbstractControlSWTRenderer<VControl>
- See Also:
AbstractSWTRenderer.applyEnable()
-
updateButtonEnabling
protected void updateButtonEnabling()
Updates the enablement of buttons according to the bound input.
-
updateButtonVisibility
protected void updateButtonVisibility()
Updates the visibility of buttons according to the bound input.
-
setValidationColor
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.- Overrides:
setValidationColor
in classSimpleControlSWTRenderer
- Parameters:
control
- the control to set the color onvalidationColor
- the validation color to set- See Also:
SimpleControlSWTRenderer.setValidationColor(org.eclipse.swt.widgets.Control, org.eclipse.swt.graphics.Color)
-
getUnsetText
protected java.lang.String getUnsetText()
Provide the unset text to show on the label when value is unset.- Specified by:
getUnsetText
in classSimpleControlSWTRenderer
- Returns:
- the text to show on the unset label
- See Also:
SimpleControlSWTRenderer.getUnsetText()
-
rootDomainModelChanged
protected void rootDomainModelChanged() throws DatabindingFailedException
This method is called inAbstractControlSWTRenderer.notifyChange()
when the root domain model of the view model context changes.- Overrides:
rootDomainModelChanged
in classSimpleControlSWTControlSWTRenderer
- Throws:
DatabindingFailedException
- If the databinding failed- See Also:
SimpleControlSWTControlSWTRenderer.rootDomainModelChanged()
-
-