public class MultiAttributeSWTRenderer extends AbstractControlSWTRenderer<VControl>
CUSTOM_VARIANT
Constructor and Description |
---|
MultiAttributeSWTRenderer(VControl vElement,
ViewModelContext viewContext,
ReportService reportService,
EMFFormsDatabinding emfFormsDatabinding,
EMFFormsLabelProvider emfFormsLabelProvider,
VTViewTemplateProvider vtViewTemplateProvider,
ImageRegistryService imageRegistryService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyEnable()
Allows implementers to set a control to enabled.
|
protected void |
applyReadOnly()
Marks a controls as readonly.
|
protected void |
applyValidation()
Allows implementers to display the validation state of the control.
|
protected org.eclipse.swt.widgets.Composite |
createButtonComposite(org.eclipse.swt.widgets.Composite parent,
org.eclipse.core.databinding.observable.list.IObservableList list)
Create the button composite.
|
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.Control |
createErrorLabel(org.eclipse.swt.widgets.Composite parent,
Exception ex)
Creates an error label for the given
Exception . |
protected org.eclipse.swt.widgets.Composite |
createTitleComposite(org.eclipse.swt.widgets.Composite parent)
Creates the Title Composite containing validation and buttons.
|
protected void |
createUpDownButtons(org.eclipse.swt.widgets.Composite composite,
org.eclipse.core.databinding.observable.list.IObservableList list)
Create the up and down buttons.
|
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 VTTableStyleProperty |
getTableStyleProperty()
Returns the
VTTableStyleProperty . |
protected org.eclipse.jface.viewers.TableViewer |
getTableViewer()
Gives access to the tableViewer used to display the attributes.
|
protected Object |
getValueForNewRow(org.eclipse.emf.ecore.EAttribute attribute)
Returns the attribute value which should be added as a new element.
|
protected boolean |
ignoreEnableOnReadOnly()
Returns
true when read only will always force control to be disabled. |
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.
|
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 |
renderMultiAttributeControl(SWTGridCell cell,
org.eclipse.swt.widgets.Composite parent)
Renders the MultiAttribute Control.
|
protected void |
rootDomainModelChanged()
This method is called in
AbstractControlSWTRenderer.notifyChange() when the root domain model of the view model context changes. |
protected void |
updateButtonEnabling()
Updates the enablement of 'addExisting', 'addNew', 'delete', 'moveUp' and 'moveDown' buttons according to the
bound input.
|
protected void |
updateButtons()
Updates button visibility and enablement.
|
protected void |
updateButtonVisibility()
Updates the visibility of 'Add', 'Remove', 'Up', 'Down' buttons according to the bound input.
|
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, init, isRenderingFinished, preInit, scrollToReveal, scrollToReveal, setControlEnabled
checkRenderer, getRenderer, getReportService, getVElement, getViewModelContext, register
@Inject public MultiAttributeSWTRenderer(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
protected VTTableStyleProperty createDefaultTableStyleProperty()
VTTableStyleProperty
.VTTableStyleProperty
protected VTTableStyleProperty getTableStyleProperty()
VTTableStyleProperty
.VTTableStyleProperty
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
AbstractSWTRenderer
getGridDescription
in class AbstractSWTRenderer<VControl>
gridDescription
- the current SWTGridDescription
protected int getTableHeightHint()
protected org.eclipse.jface.viewers.TableViewer getTableViewer()
protected org.eclipse.swt.widgets.Composite createControlComposite(org.eclipse.swt.widgets.Composite composite)
composite
- the parent compositeprotected org.eclipse.swt.graphics.Image getImage(String path)
Image
from the image registry.path
- the path to the imageprotected void applyReadOnly()
AbstractControlSWTRenderer
applyReadOnly
in class AbstractControlSWTRenderer<VControl>
AbstractSWTRenderer.applyReadOnly()
protected boolean ignoreEnableOnReadOnly()
AbstractSWTRenderer
true
when read only will always force control to be disabled.ignoreEnableOnReadOnly
in class AbstractSWTRenderer<VControl>
true
when read only will always force control to be disabled.protected void updateButtons()
protected void updateButtonVisibility()
protected void updateButtonEnabling()
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoPropertyDescriptorFoundExeption, NoRendererFoundException
AbstractSWTRenderer
VElement
.renderControl
in class AbstractSWTRenderer<VControl>
cell
- the GridCell
of the control to renderparent
- the Composite
to render onControl
NoPropertyDescriptorFoundExeption
- this is thrown when no property descriptor can be foundNoRendererFoundException
- this is thrown when a renderer cannot be foundprotected org.eclipse.swt.widgets.Control renderMultiAttributeControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
RenderMode
is set to
RenderMode.DEFAULT
. Only renders the
MultiReferfence 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 createTitleComposite(org.eclipse.swt.widgets.Composite parent)
parent
- the parent Composite
.Composite
.protected org.eclipse.swt.widgets.Composite createButtonComposite(org.eclipse.swt.widgets.Composite parent, org.eclipse.core.databinding.observable.list.IObservableList list)
parent
- the Composite
parent.list
- the IObservableList
.Composite
.protected void initButtons(org.eclipse.core.databinding.observable.list.IObservableList list)
list
- the IObservableList
.protected void createUpDownButtons(org.eclipse.swt.widgets.Composite composite, org.eclipse.core.databinding.observable.list.IObservableList list)
composite
- The Composite
to create the buttons onlist
- The IObservableList
of the current MultiAttributeSWTRenderer
protected Object getValueForNewRow(org.eclipse.emf.ecore.EAttribute attribute)
attribute
- the EAttribute
with the data typeprotected void applyValidation()
AbstractSWTRenderer
applyValidation
in class AbstractSWTRenderer<VControl>
protected void applyEnable()
applyEnable
in class AbstractControlSWTRenderer<VControl>
AbstractControlSWTRenderer.applyEnable()
public void dispose()
dispose
in class AbstractControlSWTRenderer<VControl>
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 postRemove(org.eclipse.jface.viewers.IStructuredSelection selection)
selection
- The IStructuredSelection
of the TableViewer before deletion.Copyright © 2019. All rights reserved.