Class XMLDateControlSWTRenderer
- 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.spi.core.swt.renderer.TextControlSWTRenderer
-
- org.eclipse.emf.ecp.view.internal.core.swt.renderer.XMLDateControlSWTRenderer
-
- All Implemented Interfaces:
RootDomainModelChangeListener
public class XMLDateControlSWTRenderer extends TextControlSWTRenderer
- Author:
- Eugen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.emf.ecp.view.spi.core.swt.renderer.TextControlSWTRenderer
TextControlSWTRenderer.ModelToTargetUpdateStrategy, TextControlSWTRenderer.TargetToModelUpdateStrategy
-
-
Field Summary
-
Fields inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
CUSTOM_VARIANT
-
-
Constructor Summary
Constructors Constructor Description XMLDateControlSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, EMFFormsEditSupport emfFormsEditSupport, EMFFormsLocalizationService localizationService, EMFFormsLocaleProvider localeProvider, ImageRegistryService imageRegistryService)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
convert(org.eclipse.swt.widgets.Text text, org.eclipse.emf.ecore.EDataType attributeType, java.lang.String value)
Convert the given value from target to model.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
getTextMessage()
Returns the text which should be set as the message text on the Text field.protected java.lang.String
getTextVariantID()
The VariantId to use e.g.protected java.lang.String
getUnsetText()
Provide the unset text to show on the label when value is unset.protected void
setControlEnabled(SWTGridCell gridCell, org.eclipse.swt.widgets.Control control, boolean enabled)
Wraps the call to enable/disable a control.protected java.text.DateFormat
setupFormat()
Setups theDateFormat
.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.-
Methods inherited from class org.eclipse.emf.ecp.view.spi.core.swt.renderer.TextControlSWTRenderer
bindValue, createTooltipBinding, getControlCompositeFromControl, getDefaultAlignment, getEMFFormsEditSupport, getTextFromTextField, getTextWidgetStyle, isUnsetButtonLeftOfControlComposite, useOnModifyDatabinding
-
Methods inherited from class org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTControlSWTRenderer
createControl, getFeature, rootDomainModelChanged, withPreSetValidation
-
Methods inherited from class org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTRenderer
applyReadOnly, applyValidation, createControlCell, createDefaultUnsettableStyleProperty, createLabelCell, createValidationCell, getGridDescription, getLabelWidth, getUnsettableStyleProperty, isUnsettable, renderControl, setControlIdData
-
Methods inherited from class org.eclipse.emf.ecp.view.spi.core.swt.AbstractControlSWTRenderer
applyEnable, 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
-
XMLDateControlSWTRenderer
@Inject public XMLDateControlSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, EMFFormsEditSupport emfFormsEditSupport, EMFFormsLocalizationService localizationService, EMFFormsLocaleProvider localeProvider, ImageRegistryService imageRegistryService)
Default constructor.- Parameters:
vElement
- the view model element to be renderedviewContext
- the view contextreportService
- TheReportService
emfFormsDatabinding
- TheEMFFormsDatabinding
emfFormsLabelProvider
- TheEMFFormsLabelProvider
vtViewTemplateProvider
- TheVTViewTemplateProvider
emfFormsEditSupport
- TheEMFFormsEditSupport
localizationService
- TheEMFFormsLocalizationService
localeProvider
- TheEMFFormsLocaleProvider
imageRegistryService
- TheImageRegistryService
-
-
Method Detail
-
convert
protected java.lang.Object convert(org.eclipse.swt.widgets.Text text, org.eclipse.emf.ecore.EDataType attributeType, java.lang.String value) throws DatabindingFailedException
Description copied from class:TextControlSWTRenderer
Convert the given value from target to model.- Overrides:
convert
in classTextControlSWTRenderer
- Parameters:
text
- the Text controlattributeType
- the model data typevalue
- the target value to convert- Returns:
- the converted value
- Throws:
DatabindingFailedException
- in case the databinding failed
-
createSWTControl
protected org.eclipse.swt.widgets.Control createSWTControl(org.eclipse.swt.widgets.Composite parent)
Description copied from class:SimpleControlSWTControlSWTRenderer
Creates the Control.- Overrides:
createSWTControl
in classTextControlSWTRenderer
- Parameters:
parent
- theComposite
to use as a parent- Returns:
- the created control
-
getTextMessage
protected java.lang.String getTextMessage()
Description copied from class:TextControlSWTRenderer
Returns the text which should be set as the message text on the Text field.- Overrides:
getTextMessage
in classTextControlSWTRenderer
- Returns:
- the string to show as the message
-
getTextVariantID
protected java.lang.String getTextVariantID()
Description copied from class:TextControlSWTRenderer
The VariantId to use e.g. for RAP- Overrides:
getTextVariantID
in classTextControlSWTRenderer
- Returns:
- the String identifying this control
-
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.- Overrides:
createBindings
in classTextControlSWTRenderer
- 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.
-
setupFormat
protected java.text.DateFormat setupFormat()
Setups theDateFormat
.- Returns:
- the
DateFormat
-
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 classTextControlSWTRenderer
- 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)
-
setValidationForegroundColor
protected void setValidationForegroundColor(org.eclipse.swt.widgets.Control control, org.eclipse.swt.graphics.Color validationColor)
Description copied from class:SimpleControlSWTRenderer
Set the provided validation color as the foreground for the provided control.- Overrides:
setValidationForegroundColor
in classTextControlSWTRenderer
- Parameters:
control
- the control to set the color onvalidationColor
- the validation color to set
-
setControlEnabled
protected void setControlEnabled(SWTGridCell gridCell, org.eclipse.swt.widgets.Control control, boolean enabled)
Description copied from class:AbstractSWTRenderer
Wraps the call to enable/disable a control.- Overrides:
setControlEnabled
in classTextControlSWTRenderer
- Parameters:
gridCell
- theSWTGridCell
to enable/disablecontrol
- theControl
to enable/disableenabled
- true if control should be enabled, false otherwise
-
getUnsetText
protected java.lang.String getUnsetText()
Provide the unset text to show on the label when value is unset.- Overrides:
getUnsetText
in classTextControlSWTRenderer
- Returns:
- the text to show on the unset label
- See Also:
TextControlSWTRenderer.getUnsetText()
-
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()
-
-