public class TextControlSWTRenderer extends SimpleControlSWTControlSWTRenderer
Modifier and Type | Class and Description |
---|---|
protected class |
TextControlSWTRenderer.ModelToTargetUpdateStrategy
The strategy to convert from model to target.
|
protected class |
TextControlSWTRenderer.TargetToModelUpdateStrategy
The strategy to convert from target to model.
|
CUSTOM_VARIANT
Constructor and Description |
---|
TextControlSWTRenderer(VControl vElement,
ViewModelContext viewContext,
ReportService reportService,
EMFFormsDatabinding emfFormsDatabinding,
EMFFormsLabelProvider emfFormsLabelProvider,
VTViewTemplateProvider vtViewTemplateProvider,
EMFFormsEditSupport emfFormsEditSupport)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.core.databinding.Binding |
bindValue(org.eclipse.swt.widgets.Control text,
org.eclipse.core.databinding.observable.value.IObservableValue modelValue,
org.eclipse.core.databinding.DataBindingContext dataBindingContext,
org.eclipse.core.databinding.UpdateValueStrategy targetToModel,
org.eclipse.core.databinding.UpdateValueStrategy modelToTarget)
Creates a focus out binding for this control.
|
protected org.eclipse.core.databinding.Binding[] |
createBindings(org.eclipse.swt.widgets.Control control)
Create the
Bindings for this controls. |
protected org.eclipse.swt.widgets.Control |
createSWTControl(org.eclipse.swt.widgets.Composite parent)
Creates the Control.
|
protected org.eclipse.core.databinding.Binding |
createTooltipBinding(org.eclipse.swt.widgets.Control text,
org.eclipse.core.databinding.observable.value.IObservableValue modelValue,
org.eclipse.core.databinding.DataBindingContext dataBindingContext,
org.eclipse.core.databinding.UpdateValueStrategy targetToModel,
org.eclipse.core.databinding.UpdateValueStrategy modelToTarget)
Creates a tooltip binding for this control.
|
protected int |
getDefaultAlignment()
Return the default alignment value for this renderer.
|
protected EMFFormsEditSupport |
getEMFFormsEditSupport() |
protected String |
getTextMessage()
Returns the text which should be set as the message text on the Text field.
|
protected String |
getTextVariantID()
The VariantId to use e.g.
|
protected int |
getTextWidgetStyle()
The style to apply to the text widget.
|
protected 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 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.
|
protected boolean |
useOnModifyDatabinding()
Whether
SWT.Modify or SWT.FocusOut shall be used as the target databinding trigger. |
createControl, rootDomainModelChanged
applyValidation, createControlCell, createLabelCell, createValidationCell, dispose, getGridDescription, isUnsettable, renderControl, setControlIdData
applyEnable, canHandleControlProcessor, createLabel, createValidationIcon, defaultHandleControlProcessor, defaultHandleControlProcessorForCell, getDataBindingContext, getEditingDomain, getEMFFormsDatabinding, getEMFFormsLabelProvider, getModelValue, getValidationBackgroundColor, getValidationForegroundColor, getValidationIcon, getVTViewTemplateProvider, hasLeftLabelAlignment, notifyChange, postInit, render
applyReadOnly, applyVisible, finalizeRendering, getControls, getDefaultFontName, init, preInit
checkRenderer, getReportService, getVElement, getViewModelContext
@Inject public TextControlSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, EMFFormsEditSupport emfFormsEditSupport)
vElement
- the view model element to be renderedviewContext
- the view contextreportService
- The ReportService
emfFormsDatabinding
- The EMFFormsDatabinding
emfFormsLabelProvider
- The EMFFormsLabelProvider
vtViewTemplateProvider
- The VTViewTemplateProvider
emfFormsEditSupport
- The EMFFormsEditSupport
protected org.eclipse.core.databinding.Binding[] createBindings(org.eclipse.swt.widgets.Control control) throws DatabindingFailedException
SimpleControlSWTControlSWTRenderer
Bindings
for this controls.createBindings
in class SimpleControlSWTControlSWTRenderer
control
- the Control
to create the binding forDatabindingFailedException
- if the creation of the bindings fails.protected org.eclipse.swt.widgets.Control createSWTControl(org.eclipse.swt.widgets.Composite parent)
SimpleControlSWTControlSWTRenderer
createSWTControl
in class SimpleControlSWTControlSWTRenderer
parent
- the Composite
to use as a parentprotected String getTextMessage()
protected org.eclipse.core.databinding.Binding bindValue(org.eclipse.swt.widgets.Control text, org.eclipse.core.databinding.observable.value.IObservableValue modelValue, org.eclipse.core.databinding.DataBindingContext dataBindingContext, org.eclipse.core.databinding.UpdateValueStrategy targetToModel, org.eclipse.core.databinding.UpdateValueStrategy modelToTarget)
text
- the Text
to bindmodelValue
- the IObservableValue
to binddataBindingContext
- the DataBindingContext
to usetargetToModel
- the UpdateValueStrategy
from target to ModelmodelToTarget
- the UpdateValueStrategy
from model to targetBinding
protected final boolean useOnModifyDatabinding()
SWT.Modify
or SWT.FocusOut
shall be used as the target databinding trigger.true
if Modify should be used, false
otherwiseprotected org.eclipse.core.databinding.Binding createTooltipBinding(org.eclipse.swt.widgets.Control text, org.eclipse.core.databinding.observable.value.IObservableValue modelValue, org.eclipse.core.databinding.DataBindingContext dataBindingContext, org.eclipse.core.databinding.UpdateValueStrategy targetToModel, org.eclipse.core.databinding.UpdateValueStrategy modelToTarget)
text
- the Text
to bindmodelValue
- the IObservableValue
to binddataBindingContext
- the DataBindingContext
to usetargetToModel
- the UpdateValueStrategy
from target to ModelmodelToTarget
- the UpdateValueStrategy
from model to targetBinding
protected int getTextWidgetStyle()
protected EMFFormsEditSupport getEMFFormsEditSupport()
EMFFormsEditSupport
protected int getDefaultAlignment()
protected String getTextVariantID()
protected void setControlEnabled(SWTGridCell gridCell, org.eclipse.swt.widgets.Control control, boolean enabled)
AbstractSWTRenderer
setControlEnabled
in class SimpleControlSWTRenderer
gridCell
- the SWTGridCell
to enable/disablecontrol
- the Control
to enable/disableenabled
- true if control should be enabled, false otherwiseprotected String getUnsetText()
getUnsetText
in class SimpleControlSWTRenderer
SimpleControlSWTRenderer.getUnsetText()
protected void setValidationColor(org.eclipse.swt.widgets.Control control, org.eclipse.swt.graphics.Color validationColor)
SimpleControlSWTRenderer
setValidationColor
in class SimpleControlSWTRenderer
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)
SimpleControlSWTRenderer
setValidationForegroundColor
in class SimpleControlSWTRenderer
control
- the control to set the color onvalidationColor
- the validation color to setCopyright © 2016. All rights reserved.