VELEMENT
- the actual type of the VElement
to be drawnpublic abstract class AbstractSWTRenderer<VELEMENT extends VElement> extends AbstractRenderer<VELEMENT>
If you don't callgetGridDescription(SWTGridDescription)
for each SWTGridCellrender(SWTGridCell, Composite)
finalizeRendering(Composite)
finalizeRendering(Composite)
after the rendering, the automatic disposing of the renderer
will not work, as well as the initial validation check.Modifier and Type | Field and Description |
---|---|
protected static String |
CUSTOM_VARIANT
Variant constant for indicating RAP controls.
|
Constructor and Description |
---|
AbstractSWTRenderer(VELEMENT vElement,
ViewModelContext viewContext,
ReportService reportService)
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 void |
applyValidation(VDiagnostic oldDiagnostic,
VDiagnostic newDiagnostic)
Called before the
applyValidation() . |
protected void |
applyVisible()
Allows implementers to check and set the visibility on the whole result row.
|
protected void |
dispose()
Disposes all resources used by the renderer.
|
void |
finalizeRendering(org.eclipse.swt.widgets.Composite parent)
Called by the framework to initialize listener.
|
protected Map<SWTGridCell,org.eclipse.swt.widgets.Control> |
getControls()
Returns a copy of the
GridCell to Control map. |
protected String |
getDefaultFontName(org.eclipse.swt.widgets.Control control) |
abstract SWTGridDescription |
getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.
|
protected boolean |
ignoreEnableOnReadOnly()
Returns
true when read only will always force control to be disabled. |
void |
init()
Initializes the
AbstractSWTRenderer . |
protected void |
postInit()
Use this method to initialize objects which are needed during rendering.
|
protected void |
preInit()
Use this method to initialize objects which are needed already before rendering.
|
org.eclipse.swt.widgets.Control |
render(SWTGridCell cell,
org.eclipse.swt.widgets.Composite parent)
Renders the passed
VElement . |
protected abstract org.eclipse.swt.widgets.Control |
renderControl(SWTGridCell cell,
org.eclipse.swt.widgets.Composite parent)
Renders the passed
VElement . |
protected void |
setControlEnabled(SWTGridCell gridCell,
org.eclipse.swt.widgets.Control control,
boolean enabled)
Wraps the call to enable/disable a control.
|
checkRenderer, getReportService, getVElement, getViewModelContext
protected static final String CUSTOM_VARIANT
public AbstractSWTRenderer(VELEMENT vElement, ViewModelContext viewContext, ReportService reportService)
vElement
- the view element to be renderedviewContext
- The view model contextreportService
- the ReportService to usepublic abstract SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
gridDescription
- the current SWTGridDescription
public final void init()
AbstractSWTRenderer
.protected final Map<SWTGridCell,org.eclipse.swt.widgets.Control> getControls()
GridCell
to Control
map.protected void preInit()
protected void postInit()
protected void dispose()
dispose
in class AbstractRenderer<VELEMENT extends VElement>
public org.eclipse.swt.widgets.Control render(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
VElement
.cell
- the SWTGridCell
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 foundpublic void finalizeRendering(org.eclipse.swt.widgets.Composite parent)
parent
- the parent used during renderprotected boolean ignoreEnableOnReadOnly()
true
when read only will always force control to be disabled.true
when read only will always force control to be disabled.protected abstract org.eclipse.swt.widgets.Control renderControl(SWTGridCell cell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
VElement
.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 void applyReadOnly()
protected void applyEnable()
protected void setControlEnabled(SWTGridCell gridCell, org.eclipse.swt.widgets.Control control, boolean enabled)
gridCell
- the SWTGridCell
to enable/disablecontrol
- the Control
to enable/disableenabled
- true if control should be enabled, false otherwiseprotected void applyVisible()
protected void applyValidation()
protected void applyValidation(VDiagnostic oldDiagnostic, VDiagnostic newDiagnostic)
applyValidation()
. This method allows to create a diff between the old diagnostic and
the new diagnostic and thus improve the performance of the overlay apply by triggering it only on the relevant
elements.oldDiagnostic
- The previous VDiagnostic
newDiagnostic
- The current VDiagnostic
protected String getDefaultFontName(org.eclipse.swt.widgets.Control control)
control
- The control to derive the default font name fromCopyright © 2019. All rights reserved.