Package com._1c.g5.aef2.lwt
Class LwtRenderer
- java.lang.Object
-
- com._1c.g5.aef2.renderers.Renderer<ILightControl,LwtRenderingParameters>
-
- com._1c.g5.aef2.lwt.LwtRenderer
-
- All Implemented Interfaces:
IRenderer<LwtRenderingParameters>
- Direct Known Subclasses:
LwtStandardRenderer
public abstract class LwtRenderer extends Renderer<ILightControl,LwtRenderingParameters>
Base class for LWT renderers.
-
-
Constructor Summary
Constructors Constructor Description LwtRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <VM extends IControlViewModel>
ILightControlcreateLightControl(IView<LwtRenderingParameters,VM,ILightControl> view, VM viewModel, ILightComposite lightComposite, int index)
Creates a light control for the given view and view model.void
dispose()
Disposes this renderer.protected void
disposeLightControl(ILightControl lightControl)
Disposes the given light control.protected String
getTargetId()
Returns the target identifier of the renderer.void
initialize(LwtRenderingParameters parameters)
Initialized the renderer with the given parameters.void
relayout()
Triggers layout processing.void
render(Iterable<IViewModel> viewModels)
Renders the provided view models.protected boolean
viewCanBeReused(IView<?,?,?> view, IViewModel oldViewModel, IViewModel newViewModel)
Checks if the specified view associated with theoldViewModel
can be reused for the givennewViewModel
.-
Methods inherited from class com._1c.g5.aef2.renderers.Renderer
applyLayout, convertLayout, convertLayoutData, createView, findViewClass, getParameters, getTreeTransformation, loadMappings, setMapping, setTreeTransformation
-
-
-
-
Method Detail
-
initialize
public void initialize(LwtRenderingParameters parameters)
Description copied from class:Renderer
Initialized the renderer with the given parameters.To load view model to view mappings from the extension point, call
Renderer.loadMappings(String)
.- Specified by:
initialize
in interfaceIRenderer<LwtRenderingParameters>
- Overrides:
initialize
in classRenderer<ILightControl,LwtRenderingParameters>
- Parameters:
parameters
- the renderer parameters.
-
relayout
public void relayout()
Description copied from interface:IRenderer
Triggers layout processing.
-
render
public void render(Iterable<IViewModel> viewModels)
Description copied from interface:IRenderer
Renders the provided view models.- Parameters:
viewModels
- the view models to render.
-
dispose
public void dispose()
Description copied from interface:IRenderer
Disposes this renderer.
-
createLightControl
protected <VM extends IControlViewModel> ILightControl createLightControl(IView<LwtRenderingParameters,VM,ILightControl> view, VM viewModel, ILightComposite lightComposite, int index)
Creates a light control for the given view and view model.- Parameters:
view
- the view to create a light control for.viewModel
- the view model to create a light control from.lightComposite
- the light composite.index
- the created child index.- Returns:
- the newly created light control.
-
disposeLightControl
protected void disposeLightControl(ILightControl lightControl)
Disposes the given light control.- Parameters:
lightControl
- the light control to dispose.
-
getTargetId
protected String getTargetId()
Description copied from class:Renderer
Returns the target identifier of the renderer.This identifier will be used to obtain view model to view mappings from the extension point in
Renderer.loadMappings(String)
.Examples:
- swt
- lwt
- Specified by:
getTargetId
in classRenderer<ILightControl,LwtRenderingParameters>
- Returns:
- the target id
-
viewCanBeReused
protected boolean viewCanBeReused(IView<?,?,?> view, IViewModel oldViewModel, IViewModel newViewModel)
Checks if the specified view associated with theoldViewModel
can be reused for the givennewViewModel
.Default implementation always returns
false
.- Parameters:
view
- the view associated with theoldViewModel
, cannot benull
.oldViewModel
- the old view model, cannot benull
.newViewModel
- the new view model, cannot benull
.- Returns:
true
if the view can be reused for thenewViewModel
,false
- otherwise.
-
-