Class MultiReferenceSWTRenderer
- 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.emf.ecp.view.internal.control.multireference.MultiReferenceSWTRenderer
-
- All Implemented Interfaces:
RootDomainModelChangeListener
- Direct Known Subclasses:
LinkOnlyMultiReferenceRenderer
,MultiSegmentChildDmrsSWTRenderer
public class MultiReferenceSWTRenderer extends AbstractControlSWTRenderer<VControl>
Renderer for MultiReferenceControl.- Author:
- Eugen Neufeld
-
-
Field Summary
-
Fields inherited from class org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer
CUSTOM_VARIANT
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 int
compare(int direction, java.lang.Object object1, java.lang.Object object2)
Sorts two objects based on their labels and the given sorting direction.protected org.eclipse.emf.common.notify.AdapterFactory
createAdapterFactory()
Creates a newAdapterFactory
.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 givenEStructuralFeature
.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 givenEStructuralFeature
.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 givenComposite
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 defaultVTTableStyleProperty
.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 givenEStructuralFeature
.protected org.eclipse.swt.widgets.Control
createErrorLabel(org.eclipse.swt.widgets.Composite parent, java.lang.Exception ex)
Creates an error label for the givenException
.protected org.eclipse.jface.viewers.ILabelProvider
createLabelProvider()
Creates a newILabelProvider
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 givenEStructuralFeature
.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 givenEStructuralFeature
.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.common.notify.AdapterFactory
getAdapterFactory()
Returns theAdapterFactory
used by this renderer.protected java.util.Optional<org.eclipse.emf.ecore.EObject>
getContainer()
Returns theEObject
that contains the elements rendered in this multi reference.protected VTReferenceStyleProperty
getDefaultReferenceStyle()
Creates and returns a default version of aVTReferenceStyleProperty
.protected org.eclipse.emf.ecore.EStructuralFeature
getEStructuralFeature()
Returns the observedEStructuralFeature
.SWTGridDescription
getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.protected org.eclipse.swt.graphics.Image
getImage(java.lang.String path)
Returns anImage
from the image registry.protected org.eclipse.jface.viewers.ILabelProvider
getLabelProvider()
Returns theILabelProvider
used by this renderer.protected org.eclipse.core.databinding.observable.list.IObservableList<?>
getReferencedElementsList()
Computes and returns the observable list of the referenced elements shown by this renderer.protected java.lang.String
getReferenceDisplayName()
Obtains a user-presentable name for the reference that I edit, to be used for example in button tool-tips.protected ReferenceService
getReferenceService()
Override to customize linking and creation of EObjects in this renderer's EReference.protected int
getTableHeightHint()
Returns the height for the table that will be created.protected VTTableStyleProperty
getTableStyleProperty()
Returns theVTTableStyleProperty
.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 boolean
ignoreEnableOnReadOnly()
Returnstrue
when read only will always force control to be disabled.protected org.eclipse.swt.widgets.Control
renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent)
Renders the passedVElement
.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 inAbstractControlSWTRenderer.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 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 'addExisting', 'addNew', 'delete', 'moveUp' and 'moveDown' buttons according to the bound input.protected org.eclipse.core.databinding.observable.list.IObservableList<?>
updateTableViewerInputList()
Updates the table viewer's input observable list.-
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, finalizeRendering, 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
-
MultiReferenceSWTRenderer
public MultiReferenceSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, ImageRegistryService imageRegistryService)
Legacy constructor, initializing me without a localization service. When needed, I will attempt to get it from theviewContext
.- Parameters:
vElement
- the view model element to be renderedviewContext
- the view contextemfFormsDatabinding
- TheEMFFormsDatabinding
emfFormsLabelProvider
- TheEMFFormsLabelProvider
reportService
- TheReportService
vtViewTemplateProvider
- TheVTViewTemplateProvider
imageRegistryService
- TheImageRegistryService
-
MultiReferenceSWTRenderer
@Inject public MultiReferenceSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, ImageRegistryService imageRegistryService, EMFFormsLocalizationService localizationService)
Complete constructor, supplying all dependencies.- Parameters:
vElement
- the view model element to be renderedviewContext
- the view contextemfFormsDatabinding
- TheEMFFormsDatabinding
emfFormsLabelProvider
- TheEMFFormsLabelProvider
reportService
- TheReportService
vtViewTemplateProvider
- TheVTViewTemplateProvider
imageRegistryService
- TheImageRegistryService
localizationService
- the localization service- Since:
- 1.16
-
-
Method Detail
-
getGridDescription
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
Description copied from class:AbstractSWTRenderer
Returns the GridDescription for this Renderer.- Specified by:
getGridDescription
in classAbstractSWTRenderer<VControl>
- Parameters:
gridDescription
- the currentSWTGridDescription
- Returns:
- the number of controls per row
-
updateTableViewerInputList
protected final org.eclipse.core.databinding.observable.list.IObservableList<?> updateTableViewerInputList() throws DatabindingFailedException
Updates the table viewer's input observable list. Call this method in sub classes if you detect a change to the domain model which requires the re-resolvement of the input list.Note: This method only updates the input list but does not trigger button enablement etc.
- Returns:
- returns the new input list; might be empty but never
null
- Throws:
DatabindingFailedException
- if the new list cannot be resolved
-
showAddExistingButton
protected boolean showAddExistingButton()
Returns true if the 'AddExisting' button is shown, false otherwise.- Returns:
- true if the 'AddExisting' button is shown, false otherwise
-
showAddNewButton
protected boolean showAddNewButton()
Returns true if the 'AddNew' button is shown, false otherwise.- Returns:
- true if the 'AddNew' button is shown, false otherwise
-
getDefaultReferenceStyle
protected VTReferenceStyleProperty getDefaultReferenceStyle()
Creates and returns a default version of aVTReferenceStyleProperty
.- Returns:
- The default
VTReferenceStyleProperty
-
showDeleteButton
protected boolean showDeleteButton()
Returns true if the 'Delete' button is shown, false otherwise.- Returns:
- true if the 'Delete' button is shown, false otherwise
-
showMoveUpButton
protected boolean showMoveUpButton()
Returns true if the 'MoveUp' button is shown, false otherwise. Returning true will disable any sorting behavior.- Returns:
- true if the 'MoveUp' button is shown, false otherwise
-
showMoveDownButton
protected boolean showMoveDownButton()
Returns true if the 'MoveDown' button is shown, false otherwise. Returning true will disable any sorting behavior.- Returns:
- true if the 'MoveDown' button is shown, false otherwise
-
getEStructuralFeature
protected org.eclipse.emf.ecore.EStructuralFeature getEStructuralFeature() throws DatabindingFailedException
Returns the observedEStructuralFeature
.- Returns:
- the observed
EStructuralFeature
. - Throws:
DatabindingFailedException
- when databinding fails.
-
getContainer
protected java.util.Optional<org.eclipse.emf.ecore.EObject> getContainer()
Returns theEObject
that contains the elements rendered in this multi reference.- Returns:
- The
EObject
containing the elements rendered in this multi reference or nothing if the container couldn't be computed.
-
createDefaultTableStyleProperty
protected VTTableStyleProperty createDefaultTableStyleProperty()
Creates the defaultVTTableStyleProperty
.- Returns:
- the default
VTTableStyleProperty
- Since:
- 1.14
-
getTableStyleProperty
protected VTTableStyleProperty getTableStyleProperty()
Returns theVTTableStyleProperty
.- Returns:
- the
VTTableStyleProperty
- Since:
- 1.14
-
renderControl
protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
Description copied from class:AbstractSWTRenderer
Renders the passedVElement
.- Specified by:
renderControl
in classAbstractSWTRenderer<VControl>
- Parameters:
cell
- theGridCell
of the control to renderparent
- theComposite
to render on- Returns:
- the rendered
Control
- Throws:
NoRendererFoundException
- this is thrown when a renderer cannot be foundNoPropertyDescriptorFoundExeption
- this is thrown when no property descriptor can be found
-
renderMultiReferenceControl
protected org.eclipse.swt.widgets.Control renderMultiReferenceControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
Renders the MultiReference Control. Renders the MultiReference control including validation and buttons whenRenderMode
is set toRenderMode.DEFAULT
. Only renders the MultiReference control without validation and buttons when renderMode is set toRenderMode.COMPACT_VERTICALLY
.- Parameters:
cell
- theSWTGridCell
.parent
- theComposite
.- Returns:
- the rendered
Control
- Throws:
NoRendererFoundException
- theNoRendererFoundException
.NoPropertyDescriptorFoundExeption
- theNoPropertyDescriptorFoundExeption
.- Since:
- 1.14
-
createControlComposite
protected org.eclipse.swt.widgets.Composite createControlComposite(org.eclipse.swt.widgets.Composite composite)
Creates the composite which will be the parent for the table.- Parameters:
composite
- the parent composite- Returns:
- the table composite
-
getTableHeightHint
protected int getTableHeightHint()
Returns the height for the table that will be created.- Returns:
- the height hint
-
getTableViewer
protected org.eclipse.jface.viewers.TableViewer getTableViewer()
Gives access to the tableViewer used to display the attributes.- Returns:
- the viewer
-
createErrorLabel
protected org.eclipse.swt.widgets.Control createErrorLabel(org.eclipse.swt.widgets.Composite parent, java.lang.Exception ex)
Creates an error label for the givenException
.- Parameters:
parent
- The parent of theLabel
ex
- TheException
causing the error- Returns:
- The error
Label
-
createAdapterFactory
protected org.eclipse.emf.common.notify.AdapterFactory createAdapterFactory()
Creates a newAdapterFactory
.- Returns:
- the newly created
AdapterFactory
.
-
getAdapterFactory
protected final org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory()
Returns theAdapterFactory
used by this renderer. To customize the usedAdapterFactory
overridecreateAdapterFactory()
.- Returns:
- The
AdapterFactory
used by this renderer - See Also:
createAdapterFactory()
-
createLabelProvider
protected org.eclipse.jface.viewers.ILabelProvider createLabelProvider()
Creates a newILabelProvider
for the table viewer.- Returns:
- the newly created
ILabelProvider
.
-
dispose
protected void dispose()
Disposes all resources used by the renderer. Don't forget to call super.dispose if overwriting this method.- Overrides:
dispose
in classAbstractControlSWTRenderer<VControl>
- See Also:
AbstractControlSWTRenderer.dispose()
-
createMoveUpButton
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 givenEStructuralFeature
.- Parameters:
parent
- The parent of the createdButton
structuralFeature
- TheEStructuralFeature
which's references are moved up.- Returns:
- The newly created
Button
-
createMoveDownButton
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 givenEStructuralFeature
.- Parameters:
parent
- The parent of the createdButton
structuralFeature
- TheEStructuralFeature
which's references are moved down.- Returns:
- The newly created
Button
-
createAddExistingButton
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 givenEStructuralFeature
.- Parameters:
parent
- The parent of the createdButton
structuralFeature
- TheEStructuralFeature
to which references are added- Returns:
- The newly created
Button
-
createAddNewButton
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 givenEStructuralFeature
.- Parameters:
parent
- The parent of the createdButton
structuralFeature
- TheEStructuralFeature
to which references are added- Returns:
- The newly created
Button
-
createDeleteButton
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 givenEStructuralFeature
.- Parameters:
parent
- The parent of the newly createdButton
structuralFeature
- TheEStructuralFeature
from which references are removed- Returns:
- The newly created
Button
-
updateButtons
protected void updateButtons()
Updates button visibility and enablement.
-
updateButtonEnabling
protected void updateButtonEnabling()
Updates the enablement of 'addExisting', 'addNew', 'delete', 'moveUp' and 'moveDown' buttons according to the bound input.
-
updateButtonVisibility
protected void updateButtonVisibility()
Updates the visibility of 'addExisting', 'addNew', 'delete', 'moveUp' and 'moveDown' buttons according to the bound input.
-
createButtonComposite
protected org.eclipse.swt.widgets.Composite createButtonComposite(org.eclipse.swt.widgets.Composite parent) throws DatabindingFailedException
Adds a composite with the buttons 'AddExisting', 'AddNew' and 'Delete' to the givenComposite
if necessary.- Parameters:
parent
- The parent of the createdComposite
- Returns:
- the created Composite
- Throws:
DatabindingFailedException
- thrown if the databinding could not be executed successfully
-
createTitleComposite
protected void createTitleComposite(org.eclipse.swt.widgets.Composite parent) throws DatabindingFailedException
Creates a composite with a label, a validation icon and a button composite.- Parameters:
parent
- The parent of the createdComposite
- Throws:
DatabindingFailedException
- thrown if the databinding could not be executed successfully
-
getImage
protected org.eclipse.swt.graphics.Image getImage(java.lang.String path)
Returns anImage
from the image registry.- Parameters:
path
- the path to the image- Returns:
- the image
-
getReferenceDisplayName
protected java.lang.String getReferenceDisplayName()
Obtains a user-presentable name for the reference that I edit, to be used for example in button tool-tips.- Returns:
- the reference display name
- Since:
- 1.16
-
handleDoubleClick
protected void handleDoubleClick(org.eclipse.emf.ecore.EObject selectedObject)
Method for handling a double click.- Parameters:
selectedObject
- the selectedEObject
-
handleAddExisting
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.- Parameters:
tableViewer
- theTableViewer
eObject
- TheEObject
to add tostructuralFeature
- The correspondingEStructuralFeature
-
handleAddNew
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.- Parameters:
tableViewer
- theTableViewer
eObject
- TheEObject
to add tostructuralFeature
- The correspondingEStructuralFeature
-
getReferenceService
protected ReferenceService getReferenceService()
Override to customize linking and creation of EObjects in this renderer's EReference.- Returns:
- The
ReferenceService
used to link and create new EObjects in this renderer's reference.
-
handleDelete
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.- Parameters:
tableViewer
- theTableViewer
eObject
- TheEObject
to delete fromstructuralFeature
- The correspondingEStructuralFeature
-
handleMoveUp
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.- Parameters:
tableViewer
- theTableViewer
eObject
- TheEObject
to delete fromstructuralFeature
- The correspondingEStructuralFeature
-
handleMoveDown
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.- Parameters:
tableViewer
- theTableViewer
eObject
- TheEObject
to delete fromstructuralFeature
- The correspondingEStructuralFeature
-
rootDomainModelChanged
protected void rootDomainModelChanged() throws DatabindingFailedException
Description copied from class:AbstractControlSWTRenderer
This method is called inAbstractControlSWTRenderer.notifyChange()
when the root domain model of the view model context changes.- Overrides:
rootDomainModelChanged
in classAbstractControlSWTRenderer<VControl>
- Throws:
DatabindingFailedException
- If the databinding failed
-
getReferencedElementsList
protected org.eclipse.core.databinding.observable.list.IObservableList<?> getReferencedElementsList() throws DatabindingFailedException
Computes and returns the observable list of the referenced elements shown by this renderer.- Returns:
- The
IObservableList
of the referenced elements - Throws:
DatabindingFailedException
- If computing the list failed due to failed databinding
-
ignoreEnableOnReadOnly
protected boolean ignoreEnableOnReadOnly()
Description copied from class:AbstractSWTRenderer
Returnstrue
when read only will always force control to be disabled.- Overrides:
ignoreEnableOnReadOnly
in classAbstractSWTRenderer<VControl>
- Returns:
true
when read only will always force control to be disabled.
-
applyEnable
protected void applyEnable()
Description copied from class:AbstractControlSWTRenderer
Allows implementers to set a control to enabled.- Overrides:
applyEnable
in classAbstractControlSWTRenderer<VControl>
- See Also:
AbstractSWTRenderer.applyEnable()
-
applyReadOnly
protected void applyReadOnly()
Description copied from class:AbstractControlSWTRenderer
Marks a controls as readonly.- Overrides:
applyReadOnly
in classAbstractControlSWTRenderer<VControl>
- See Also:
AbstractSWTRenderer.applyReadOnly()
-
applyValidation
protected void applyValidation()
Description copied from class:AbstractSWTRenderer
Allows implementers to display the validation state of the control. The default implementation does nothing.- Overrides:
applyValidation
in classAbstractSWTRenderer<VControl>
-
compare
protected int compare(int direction, java.lang.Object object1, java.lang.Object object2)
Sorts two objects based on their labels and the given sorting direction.
Override this method to provide a custom sorting algorithm for the objects shown in this control's table.
- Parameters:
direction
- The sorting direction: 0 == NONE, 1 == UP, 2 == DOWNobject1
- The first object of the comparisonobject2
- The second object of the comparison- Returns:
- 0 if both objects are equal, -1 if object1 will appear higher in the table, 1 if object2 will appear higher in the table
-
getLabelProvider
protected org.eclipse.jface.viewers.ILabelProvider getLabelProvider()
Returns theILabelProvider
used by this renderer.- Returns:
- the
ILabelProvider
-
-