Class EcorePathsRenderer
- 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.emfforms.spi.view.control.multiattribute.MultiAttributeSWTRenderer
-
- org.eclipse.emf.ecp.view.internal.editor.controls.EcorePathsRenderer
-
- All Implemented Interfaces:
RootDomainModelChangeListener
public class EcorePathsRenderer extends MultiAttributeSWTRenderer
Custom Renderer for the EcorePath List of a View. This Renderer changes the behavior of the add and remove button so that a user gets a Dialog to select an Ecore from the Workspace in the case of an add. In the case of a remove the Ecore is deregistered.- Author:
- Eugen Neufeld
-
-
Field Summary
-
Fields inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
CUSTOM_VARIANT
-
-
Constructor Summary
Constructors Constructor Description EcorePathsRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, ImageRegistryService imageRegistryService)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createUpDownButtons(org.eclipse.swt.widgets.Composite composite, org.eclipse.core.databinding.observable.list.IObservableList list)
Create the up and down buttons.void
finalizeRendering(org.eclipse.swt.widgets.Composite parent)
Called by the framework to initialize listener.protected java.lang.Object
getValueForNewRow(org.eclipse.emf.ecore.EAttribute attribute)
Returns the attribute value which should be added as a new element.protected void
initButtons(org.eclipse.core.databinding.observable.list.IObservableList list)
Initializes the buttons.protected void
postRemove(org.eclipse.jface.viewers.IStructuredSelection selection)
This is called after the selected elements were deleted so that the user can handle this removal.-
Methods inherited from class org.eclipse.emfforms.spi.view.control.multiattribute.MultiAttributeSWTRenderer
applyEnable, applyReadOnly, applyValidation, createButtonComposite, createControlComposite, createDefaultTableStyleProperty, createErrorLabel, createTitleComposite, dispose, getGridDescription, getImage, getTableHeightHint, getTableStyleProperty, getTableViewer, ignoreEnableOnReadOnly, renderControl, renderMultiAttributeControl, rootDomainModelChanged, updateButtonEnabling, updateButtons, updateButtonVisibility
-
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, getControls, getDefaultFontName, init, isRenderingFinished, preInit, scrollToReveal, scrollToReveal, setControlEnabled
-
Methods inherited from class org.eclipse.emf.ecp.view.model.common.AbstractRenderer
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
-
-
-
-
Constructor Detail
-
EcorePathsRenderer
@Inject public EcorePathsRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, ImageRegistryService imageRegistryService)
Default constructor.- Parameters:
vElement
- TheVControl
of the RendererviewContext
- TheViewModelContext
of the RendererreportService
- TheReportService
to use for loggingemfFormsDatabinding
- TheEMFFormsDatabinding
to useemfFormsLabelProvider
- TheEMFFormsLabelProvider
to usevtViewTemplateProvider
- TheVTViewTemplateProvider
to useimageRegistryService
- TheImageRegistryService
to use
-
-
Method Detail
-
finalizeRendering
public void finalizeRendering(org.eclipse.swt.widgets.Composite parent)
Description copied from class:AbstractSWTRenderer
Called by the framework to initialize listener.- Overrides:
finalizeRendering
in classAbstractSWTRenderer<VControl>
- Parameters:
parent
- the parent used during render
-
initButtons
protected void initButtons(org.eclipse.core.databinding.observable.list.IObservableList list)
Description copied from class:MultiAttributeSWTRenderer
Initializes the buttons. Call this after table is created.- Overrides:
initButtons
in classMultiAttributeSWTRenderer
- Parameters:
list
- theIObservableList
.
-
getValueForNewRow
protected java.lang.Object getValueForNewRow(org.eclipse.emf.ecore.EAttribute attribute)
Description copied from class:MultiAttributeSWTRenderer
Returns the attribute value which should be added as a new element.- Overrides:
getValueForNewRow
in classMultiAttributeSWTRenderer
- Parameters:
attribute
- theEAttribute
with the data type- Returns:
- the new value
-
postRemove
protected void postRemove(org.eclipse.jface.viewers.IStructuredSelection selection)
Description copied from class:MultiAttributeSWTRenderer
This is called after the selected elements were deleted so that the user can handle this removal.- Overrides:
postRemove
in classMultiAttributeSWTRenderer
- Parameters:
selection
- TheIStructuredSelection
of the TableViewer before deletion.
-
createUpDownButtons
protected void createUpDownButtons(org.eclipse.swt.widgets.Composite composite, org.eclipse.core.databinding.observable.list.IObservableList list)
Description copied from class:MultiAttributeSWTRenderer
Create the up and down buttons.- Overrides:
createUpDownButtons
in classMultiAttributeSWTRenderer
- Parameters:
composite
- TheComposite
to create the buttons onlist
- TheIObservableList
of the currentMultiAttributeSWTRenderer
-
-