public class DomainModelReferenceControlSWTRenderer extends SimpleControlSWTControlSWTRenderer
CUSTOM_VARIANT
Constructor and Description |
---|
DomainModelReferenceControlSWTRenderer(VControl vElement,
ViewModelContext viewContext,
ReportService reportService,
EMFFormsDatabindingEMF emfFormsDatabindingEMF,
EMFFormsLabelProvider emfFormsLabelProvider,
VTViewTemplateProvider vtViewTemplateProvider,
EMFFormsEditSupport emfFormsEditSupport)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addNewSegmentDmr(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EReference reference)
Create a new segment based domain model reference and set it in the
reference of the given
container object. |
protected org.eclipse.core.databinding.Binding[] |
createBindings(org.eclipse.swt.widgets.Control control)
Create the
Bindings for this controls. |
protected org.eclipse.swt.widgets.Button |
createButtonForAction(org.eclipse.jface.action.Action action,
org.eclipse.swt.widgets.Composite composite)
A helper method which creates a button for an action on a composite.
|
protected org.eclipse.swt.widgets.Control |
createSWTControl(org.eclipse.swt.widgets.Composite parent)
Creates the Control.
|
protected void |
editSegmentDmr(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EReference reference,
VDomainModelReference dmr)
Edits the existing DMR set in the
reference of the given
container object. |
protected org.eclipse.emf.ecore.EClass |
getDmrRootEClass()
Returns the root EClass of the domain model reference.
|
protected String |
getUnsetText()
Provide the unset text to show on the label when value is unset.
|
protected void |
rootDomainModelChanged()
This method is called in
AbstractControlSWTRenderer.notifyChange() when the root domain model of the view model context changes. |
void |
scrollToReveal()
If my control is rendered within a scrolled composite, scroll that composite to reveal me.
|
createControl, getFeature, withPreSetValidation
applyReadOnly, applyValidation, createControlCell, createDefaultUnsettableStyleProperty, createLabelCell, createValidationCell, dispose, getGridDescription, getLabelWidth, getUnsettableStyleProperty, isUnsettable, renderControl, setControlEnabled, setControlIdData, setValidationColor, setValidationForegroundColor
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
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
@Inject public DomainModelReferenceControlSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabindingEMF emfFormsDatabindingEMF, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, EMFFormsEditSupport emfFormsEditSupport)
vElement
- the view model element to be renderedviewContext
- the view contextreportService
- The ReportService
emfFormsDatabindingEMF
- 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) throws DatabindingFailedException
SimpleControlSWTControlSWTRenderer
createSWTControl
in class SimpleControlSWTControlSWTRenderer
parent
- the Composite
to use as a parentDatabindingFailedException
- if the creation of the control fails due to databinding problemsprotected org.eclipse.swt.widgets.Button createButtonForAction(org.eclipse.jface.action.Action action, org.eclipse.swt.widgets.Composite composite)
action
- the action to create a button forcomposite
- the composite to create the button ontoprotected String getUnsetText()
SimpleControlSWTRenderer
getUnsetText
in class SimpleControlSWTRenderer
protected void addNewSegmentDmr(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference)
reference
of the given
container
object.container
- The EObject which will contain the new domain model referencereference
- The EReference which the new domain model reference will be set inprotected void editSegmentDmr(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference, VDomainModelReference dmr)
reference
of the given
container
object.container
- The EObject which will contain the new domain model referencereference
- The EReference which contains the current new domain model referencedmr
- The domain model reference to editprotected org.eclipse.emf.ecore.EClass getDmrRootEClass()
protected void rootDomainModelChanged() throws DatabindingFailedException
SimpleControlSWTControlSWTRenderer
AbstractControlSWTRenderer.notifyChange()
when the root domain model of the view model context changes.rootDomainModelChanged
in class SimpleControlSWTControlSWTRenderer
DatabindingFailedException
- If the databinding failedAbstractControlSWTRenderer.rootDomainModelChanged()
public void scrollToReveal()
AbstractSWTRenderer
scrollToReveal
in class AbstractSWTRenderer<VControl>
Copyright © 2019. All rights reserved.