public class MultiReferenceSWTRenderer extends AbstractControlSWTRenderer<VControl>
Type | Property and Description |
---|---|
protected VTTableStyleProperty |
createDefaultTableStyle
Creates the default
VTTableStyleProperty . |
CUSTOM_VARIANT
Constructor and Description |
---|
MultiReferenceSWTRenderer(VControl vElement,
ViewModelContext viewContext,
ReportService reportService,
EMFFormsDatabinding emfFormsDatabinding,
EMFFormsLabelProvider emfFormsLabelProvider,
VTViewTemplateProvider vtViewTemplateProvider,
ImageRegistryService imageRegistryService)
Legacy constructor, initializing me without a localization service.
|
MultiReferenceSWTRenderer(VControl vElement,
ViewModelContext viewContext,
ReportService reportService,
EMFFormsDatabinding emfFormsDatabinding,
EMFFormsLabelProvider emfFormsLabelProvider,
VTViewTemplateProvider vtViewTemplateProvider,
ImageRegistryService imageRegistryService,
EMFFormsLocalizationService localizationService)
Complete constructor, supplying all dependencies.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyValidation()
Allows implementers to display the validation state of the control.
|
protected org.eclipse.emf.common.notify.AdapterFactory |
createAdapterFactory()
Creates a new
AdapterFactory . |
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 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.swt.widgets.Composite |
createControlComposite(org.eclipse.swt.widgets.Composite composite)
Creates the composite which will be the parent for the table.
|
protected VTTableStyleProperty |
createDefaultTableStyleProperty()
Creates the default
VTTableStyleProperty . |
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 org.eclipse.jface.viewers.IBaseLabelProvider |
createLabelProvider()
Creates a new
IBaseLabelProvider for the table viewer. |
protected org.eclipse.swt.widgets.Button |
createMoveDownButton(org.eclipse.swt.widgets.Composite parent,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Creates a button that enables reordering the references by the given
EStructuralFeature . |
protected org.eclipse.swt.widgets.Button |
createMoveUpButton(org.eclipse.swt.widgets.Composite parent,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Creates a button that enables reordering the references by the given
EStructuralFeature . |
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.
|
protected org.eclipse.emf.ecore.EStructuralFeature |
getEStructuralFeature()
Returns the observed
EStructuralFeature . |
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 String |
getReferenceDisplayName()
Obtains a user-presentable name for the reference that I edit, to be used for example
in button tool-tips.
|
protected int |
getTableHeightHint()
Returns the height for the table that will be created.
|
protected VTTableStyleProperty |
getTableStyleProperty()
Returns the
VTTableStyleProperty . |
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 void |
handleMoveDown(org.eclipse.jface.viewers.TableViewer tableViewer,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Method for moving down elements.
|
protected void |
handleMoveUp(org.eclipse.jface.viewers.TableViewer tableViewer,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Method for moving up elements.
|
protected org.eclipse.swt.widgets.Control |
renderControl(SWTGridCell cell,
org.eclipse.swt.widgets.Composite parent)
Renders the passed
VElement . |
protected org.eclipse.swt.widgets.Control |
renderMultiReferenceControl(SWTGridCell cell,
org.eclipse.swt.widgets.Composite parent)
Renders the MultiReference Control.
|
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.
|
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 'addExisting', 'addNew', 'delete', 'moveUp' and 'moveDown' buttons according to the bound input.
|
applyEnable, applyReadOnly, canHandleControlProcessor, createLabel, createValidationIcon, defaultHandleControlProcessor, defaultHandleControlProcessorForCell, getDataBindingContext, getEditingDomain, getEMFFormsDatabinding, getEMFFormsLabelProvider, getLabelStyleBits, getModelValue, getValidationBackgroundColor, getValidationForegroundColor, getValidationIcon, getVTViewTemplateProvider, hasLeftLabelAlignment, notifyChange, postInit, render
applyValidation, applyVisible, finalizeRendering, getControls, getDefaultFontName, init, preInit, setControlEnabled
checkRenderer, getReportService, getVElement, getViewModelContext
protected VTTableStyleProperty createDefaultTableStyleProperty
VTTableStyleProperty
.public MultiReferenceSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, ImageRegistryService imageRegistryService)
viewContext
.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
@Inject public MultiReferenceSWTRenderer(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 servicepublic SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
AbstractSWTRenderer
getGridDescription
in class AbstractSWTRenderer<VControl>
gridDescription
- the current SWTGridDescription
protected boolean showAddExistingButton()
protected boolean showAddNewButton()
protected boolean showDeleteButton()
protected boolean showMoveUpButton()
protected boolean showMoveDownButton()
protected org.eclipse.emf.ecore.EStructuralFeature getEStructuralFeature() throws DatabindingFailedException
EStructuralFeature
.EStructuralFeature
.DatabindingFailedException
- when databinding fails.protected VTTableStyleProperty createDefaultTableStyleProperty()
VTTableStyleProperty
.protected VTTableStyleProperty getTableStyleProperty()
VTTableStyleProperty
.VTTableStyleProperty
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
AbstractSWTRenderer
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 foundprotected org.eclipse.swt.widgets.Control renderMultiReferenceControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
RenderMode
is set to
RenderMode.DEFAULT
. Only renders the
MultiReference control without validation and buttons when renderMode is set to
RenderMode.COMPACT_VERTICALLY
.cell
- the SWTGridCell
.parent
- the Composite
.Control
NoRendererFoundException
- the NoRendererFoundException
.NoPropertyDescriptorFoundExeption
- the NoPropertyDescriptorFoundExeption
.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 org.eclipse.emf.common.notify.AdapterFactory createAdapterFactory()
AdapterFactory
.AdapterFactory
.protected org.eclipse.jface.viewers.IBaseLabelProvider createLabelProvider()
IBaseLabelProvider
for the table viewer.IBaseLabelProvider
.protected void dispose()
dispose
in class AbstractControlSWTRenderer<VControl>
AbstractControlSWTRenderer.dispose()
protected org.eclipse.swt.widgets.Button createMoveUpButton(org.eclipse.swt.widgets.Composite parent, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
EStructuralFeature
.parent
- The parent of the created Button
structuralFeature
- The EStructuralFeature
which's references are moved up.Button
protected org.eclipse.swt.widgets.Button createMoveDownButton(org.eclipse.swt.widgets.Composite parent, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
EStructuralFeature
.parent
- The parent of the created Button
structuralFeature
- The EStructuralFeature
which's references are moved down.Button
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 updateButtonEnabling()
protected org.eclipse.swt.widgets.Composite 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 String getReferenceDisplayName()
protected 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 handleMoveUp(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 handleMoveDown(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 © 2018. All rights reserved.