public class MultiSegmentChildDmrsSWTRenderer extends MultiReferenceSWTRenderer
CUSTOM_VARIANT
Constructor and Description |
---|
MultiSegmentChildDmrsSWTRenderer(VControl vElement,
ViewModelContext viewContext,
ReportService reportService,
EMFFormsDatabinding emfFormsDatabinding,
EMFFormsLabelProvider emfFormsLabelProvider,
VTViewTemplateProvider vtViewTemplateProvider,
ImageRegistryService imageRegistryService,
EMFFormsLocalizationService localizationService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.swt.widgets.Composite |
createButtonComposite(org.eclipse.swt.widgets.Composite parent)
Adds a composite with the buttons 'AddExisting', 'AddNew' and 'Delete' to the given
Composite if
necessary. |
protected org.eclipse.jface.viewers.ILabelProvider |
createLabelProvider()
Creates a new
ILabelProvider for the table viewer. |
protected void |
dispose()
Disposes all resources used by the renderer.
|
protected Optional<org.eclipse.emf.ecore.EObject> |
getContainer()
Returns the
EObject that contains the elements rendered in this multi reference. |
protected org.eclipse.emf.ecore.EReference |
getEStructuralFeature()
Returns the observed
EStructuralFeature . |
protected org.eclipse.core.databinding.observable.list.IObservableList<?> |
getReferencedElementsList()
Returns an
IObservableList that tracks all child dmrs of the table defined by this renderer's parent
VTableControl . |
protected void |
handleAddNew(org.eclipse.jface.viewers.TableViewer tableViewer,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Method for adding a new element.
|
protected void |
postInit()
Use this method to initialize objects which are needed during rendering.
|
protected org.eclipse.swt.widgets.Control |
renderControl(SWTGridCell cell,
org.eclipse.swt.widgets.Composite parent)
Renders the passed
VElement . |
protected boolean |
showAddExistingButton()
Returns true if the 'AddExisting' button is shown, false otherwise.
|
protected boolean |
showAddNewButton()
Returns true if the 'AddNew' button is shown, false otherwise.
|
protected boolean |
showDeleteButton()
Returns true if the 'Delete' button is shown, false otherwise.
|
protected boolean |
showMoveDownButton()
Returns true if the 'MoveDown' button is shown, false otherwise.
|
protected boolean |
showMoveUpButton()
Returns true if the 'MoveUp' button is shown, false otherwise.
|
protected void |
updateButtonEnabling()
Updates the enablement of 'addExisting', 'addNew', 'delete', 'moveUp' and 'moveDown' buttons according to the
bound input.
|
protected void |
updateButtonVisibility()
Updates the visibility of 'addExisting', 'addNew', 'delete', 'moveUp' and 'moveDown' buttons according to the
bound input.
|
applyEnable, applyReadOnly, applyValidation, compare, createAdapterFactory, createAddExistingButton, createAddNewButton, createControlComposite, createDefaultTableStyleProperty, createDeleteButton, createErrorLabel, createMoveDownButton, createMoveUpButton, createTitleComposite, getAdapterFactory, getDefaultReferenceStyle, getGridDescription, getImage, getLabelProvider, getReferenceDisplayName, getReferenceService, getTableHeightHint, getTableStyleProperty, getTableViewer, handleAddExisting, handleDelete, handleDoubleClick, handleMoveDown, handleMoveUp, ignoreEnableOnReadOnly, renderMultiReferenceControl, rootDomainModelChanged, updateButtons, updateTableViewerInputList
applyUnchangeableFeature, canHandleControlProcessor, createLabel, createValidationIcon, defaultHandleControlProcessor, defaultHandleControlProcessorForCell, getDataBindingContext, getEditingDomain, getEMFFormsDatabinding, getEMFFormsLabelProvider, getLabelStyleBits, getModelValue, getValidationBackgroundColor, getValidationForegroundColor, getValidationIcon, getVTViewTemplateProvider, hasLeftLabelAlignment, isUnchangeableFeature, notifyChange, render
applyValidation, applyVisible, canReveal, finalizeRendering, getControls, getDefaultFontName, init, isRenderingFinished, preInit, scrollToReveal, scrollToReveal, setControlEnabled
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
@Inject public MultiSegmentChildDmrsSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, ImageRegistryService imageRegistryService, EMFFormsLocalizationService localizationService)
vElement
- the view model element to be renderedviewContext
- the view contextemfFormsDatabinding
- The EMFFormsDatabinding
emfFormsLabelProvider
- The EMFFormsLabelProvider
reportService
- The ReportService
vtViewTemplateProvider
- The VTViewTemplateProvider
imageRegistryService
- The ImageRegistryService
localizationService
- the localization serviceprotected void postInit()
AbstractSWTRenderer
postInit
in class AbstractControlSWTRenderer<VControl>
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
AbstractSWTRenderer
VElement
.renderControl
in class MultiReferenceSWTRenderer
cell
- the GridCell
of the control to renderparent
- the Composite
to render onControl
NoRendererFoundException
- this is thrown when a renderer cannot be foundNoPropertyDescriptorFoundExeption
- this is thrown when no property descriptor can be foundprotected org.eclipse.swt.widgets.Composite createButtonComposite(org.eclipse.swt.widgets.Composite parent) throws DatabindingFailedException
MultiReferenceSWTRenderer
Composite
if
necessary.createButtonComposite
in class MultiReferenceSWTRenderer
parent
- The parent of the created Composite
DatabindingFailedException
- thrown if the databinding could not be executed successfullyprotected void updateButtonEnabling()
MultiReferenceSWTRenderer
updateButtonEnabling
in class MultiReferenceSWTRenderer
protected void updateButtonVisibility()
MultiReferenceSWTRenderer
updateButtonVisibility
in class MultiReferenceSWTRenderer
protected Optional<org.eclipse.emf.ecore.EObject> getContainer()
MultiReferenceSWTRenderer
EObject
that contains the elements rendered in this multi reference.getContainer
in class MultiReferenceSWTRenderer
EObject
containing the elements rendered in this multi reference or nothing if the container
couldn't be computed.protected org.eclipse.emf.ecore.EReference getEStructuralFeature()
MultiReferenceSWTRenderer
EStructuralFeature
.getEStructuralFeature
in class MultiReferenceSWTRenderer
EStructuralFeature
.protected boolean showAddExistingButton()
MultiReferenceSWTRenderer
showAddExistingButton
in class MultiReferenceSWTRenderer
protected boolean showAddNewButton()
MultiReferenceSWTRenderer
showAddNewButton
in class MultiReferenceSWTRenderer
protected boolean showDeleteButton()
MultiReferenceSWTRenderer
showDeleteButton
in class MultiReferenceSWTRenderer
protected boolean showMoveUpButton()
MultiReferenceSWTRenderer
showMoveUpButton
in class MultiReferenceSWTRenderer
protected boolean showMoveDownButton()
MultiReferenceSWTRenderer
showMoveDownButton
in class MultiReferenceSWTRenderer
protected void handleAddNew(org.eclipse.jface.viewers.TableViewer tableViewer, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
MultiReferenceSWTRenderer
handleAddNew
in class MultiReferenceSWTRenderer
tableViewer
- the TableViewer
eObject
- The EObject
to add tostructuralFeature
- The corresponding EStructuralFeature
protected org.eclipse.core.databinding.observable.list.IObservableList<?> getReferencedElementsList() throws DatabindingFailedException
IObservableList
that tracks all child dmrs of the table defined by this renderer's parent
VTableControl
. The child dmrs are stored in the last segment of the VTableControl's
segment. This segment is a multi segment.
IMPORTANT: Can only be used after the field tableControl
has been set
getReferencedElementsList
in class MultiReferenceSWTRenderer
IObservableList
of the referenced elementsDatabindingFailedException
- If computing the list failed due to failed databindingMultiReferenceSWTRenderer.getReferencedElementsList()
protected void dispose()
MultiReferenceSWTRenderer
dispose
in class MultiReferenceSWTRenderer
AbstractControlSWTRenderer.dispose()
protected org.eclipse.jface.viewers.ILabelProvider createLabelProvider()
MultiReferenceSWTRenderer
ILabelProvider
for the table viewer.createLabelProvider
in class MultiReferenceSWTRenderer
ILabelProvider
.Copyright © 2019. All rights reserved.