public class MultiReferenceSWTRenderer extends AbstractControlSWTRenderer<VControl>
CUSTOM_VARIANT
Constructor and Description |
---|
MultiReferenceSWTRenderer(VControl vElement,
ViewModelContext viewContext,
ReportService reportService,
EMFFormsDatabinding emfFormsDatabinding,
EMFFormsLabelProvider emfFormsLabelProvider,
VTViewTemplateProvider vtViewTemplateProvider,
ImageRegistryService imageRegistryService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyValidation()
Allows implementers to display the validation state of the control.
|
protected org.eclipse.swt.widgets.Button |
createAddExistingButton(org.eclipse.swt.widgets.Composite parent,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Creates a button that enables the addition of existing references to the given
EStructuralFeature . |
protected org.eclipse.swt.widgets.Button |
createAddNewButton(org.eclipse.swt.widgets.Composite parent,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Creates a button that enables the addition of newly created references to the given
EStructuralFeature . |
protected void |
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.swt.widgets.Composite |
createControlComposite(org.eclipse.swt.widgets.Composite composite)
Creates the composite which will be the parent for the table.
|
protected org.eclipse.swt.widgets.Button |
createDeleteButton(org.eclipse.swt.widgets.Composite parent,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Creates a button that enables the removal of existing references from the given
EStructuralFeature . |
protected org.eclipse.swt.widgets.Control |
createErrorLabel(org.eclipse.swt.widgets.Composite parent,
Exception ex)
Creates an error label for the given
Exception . |
protected void |
createTitleComposite(org.eclipse.swt.widgets.Composite parent)
Creates a composite with a label, a validation icon and a button composite.
|
protected void |
dispose()
Disposes all resources used by the renderer.
|
SWTGridDescription |
getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.
|
protected org.eclipse.swt.graphics.Image |
getImage(String path)
Returns an
Image from the image registry. |
protected int |
getTableHeightHint()
Returns the height for the table that will be created.
|
protected org.eclipse.jface.viewers.TableViewer |
getTableViewer()
Gives access to the tableViewer used to display the attributes.
|
protected void |
handleAddExisting(org.eclipse.jface.viewers.TableViewer tableViewer,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Method for adding an existing element.
|
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 |
handleDelete(org.eclipse.jface.viewers.TableViewer tableViewer,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Method for deleting elements.
|
protected void |
handleDoubleClick(org.eclipse.emf.ecore.EObject selectedObject)
Method for handling a double click.
|
protected org.eclipse.swt.widgets.Control |
renderControl(SWTGridCell cell,
org.eclipse.swt.widgets.Composite parent)
Renders the passed
VElement . |
protected void |
rootDomainModelChanged()
This method is called in
AbstractControlSWTRenderer.notifyChange() when the root domain model of the view model context changes. |
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.
|
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, setControlEnabled
checkRenderer, getReportService, getVElement, getViewModelContext
@Inject public MultiReferenceSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, ImageRegistryService imageRegistryService)
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
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
getGridDescription
in class AbstractSWTRenderer<VControl>
gridDescription
- the current SWTGridDescription
AbstractSWTRenderer.getGridDescription(org.eclipse.emfforms.spi.swt.core.layout.SWTGridDescription)
protected boolean showAddExistingButton()
protected boolean showAddNewButton()
protected boolean showDeleteButton()
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
VElement
.renderControl
in class AbstractSWTRenderer<VControl>
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 foundorg.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer#renderControl(org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell,
org.eclipse.emf.ecp.view.spi.swt.Composite)
protected org.eclipse.swt.widgets.Composite createControlComposite(org.eclipse.swt.widgets.Composite composite)
composite
- the parent compositeprotected int getTableHeightHint()
protected org.eclipse.jface.viewers.TableViewer getTableViewer()
protected org.eclipse.swt.widgets.Control createErrorLabel(org.eclipse.swt.widgets.Composite parent, Exception ex)
Exception
.parent
- The parent of the Label
ex
- The Exception
causing the errorLabel
protected void dispose()
dispose
in class AbstractControlSWTRenderer<VControl>
AbstractControlSWTRenderer.dispose()
protected org.eclipse.swt.widgets.Button createAddExistingButton(org.eclipse.swt.widgets.Composite parent, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
EStructuralFeature
.parent
- The parent of the created Button
structuralFeature
- The EStructuralFeature
to which references are addedButton
protected org.eclipse.swt.widgets.Button createAddNewButton(org.eclipse.swt.widgets.Composite parent, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
EStructuralFeature
.parent
- The parent of the created Button
structuralFeature
- The EStructuralFeature
to which references are addedButton
protected org.eclipse.swt.widgets.Button createDeleteButton(org.eclipse.swt.widgets.Composite parent, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
EStructuralFeature
.parent
- The parent of the newly created Button
structuralFeature
- The EStructuralFeature
from which references are removedButton
protected void createButtonComposite(org.eclipse.swt.widgets.Composite parent) throws DatabindingFailedException
Composite
if
necessary.parent
- The parent of the created Composite
DatabindingFailedException
- thrown if the databinding could not be executed successfullyprotected void createTitleComposite(org.eclipse.swt.widgets.Composite parent) throws DatabindingFailedException
parent
- The parent of the created Composite
DatabindingFailedException
- thrown if the databinding could not be executed successfullyprotected org.eclipse.swt.graphics.Image getImage(String path)
Image
from the image registry.path
- the path to the imageprotected void handleDoubleClick(org.eclipse.emf.ecore.EObject selectedObject)
selectedObject
- the selected EObject
protected void handleAddExisting(org.eclipse.jface.viewers.TableViewer tableViewer, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
tableViewer
- the TableViewer
eObject
- The EObject
to add tostructuralFeature
- The corresponding EStructuralFeature
protected void handleAddNew(org.eclipse.jface.viewers.TableViewer tableViewer, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
tableViewer
- the TableViewer
eObject
- The EObject
to add tostructuralFeature
- The corresponding EStructuralFeature
protected void handleDelete(org.eclipse.jface.viewers.TableViewer tableViewer, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
tableViewer
- the TableViewer
eObject
- The EObject
to delete fromstructuralFeature
- The corresponding EStructuralFeature
protected void rootDomainModelChanged() throws DatabindingFailedException
AbstractControlSWTRenderer.notifyChange()
when the root domain model of the view model context changes.rootDomainModelChanged
in class AbstractControlSWTRenderer<VControl>
DatabindingFailedException
- If the databinding failedAbstractControlSWTRenderer.rootDomainModelChanged()
protected void applyValidation()
AbstractSWTRenderer
applyValidation
in class AbstractSWTRenderer<VControl>
Copyright © 2016. All rights reserved.