Skip to content

MaterialDesignJsVeiwRenderer / view.core.renderers.viewRenderers / AbstractViewRenderer

AbstractViewRenderer

abstract class AbstractViewRenderer<V> :ViewRenderer<V>

This class is the base class for all view renderers.

It renders common view properties i.e. the properties of the View class. The view is rendered by building a DOM node representing the view.

The procedure for building the DOM element goes as follows:

  1. An instance of the appropriate HTMLElement is passed to the renderer. Note that the DOM element passed may already be built, in this case the renderer is supposed to apply only that view properties that have changed. See reRendering for more details.
  2. This class applies common view attributes to the DOM element.
  3. The subclassing builder applies the attributes of a specific view type.
  4. The resultant HTMLElement is returned.

Parameters

view - The view to render

element - A HTMLElement that will represent the view.

reRendering - If true, this parameter indicates that the element passed was already built. This happens when a view is already rendered and one of its properties changes later. In this case the renderer should only update the element and not rebuild it from scratch.

Constructors

<init>
AbstractViewRenderer(view:V, element: <ERROR CLASS>, reRendering:Boolean= false)
This class is the base class for all view renderers.

Properties

css
val css:ElementCss

element
val element: <ERROR CLASS>
A HTMLElement that will represent the view.

reRendering
val reRendering:Boolean
If true, this parameter indicates that the element passed was already built. This happens when a view is already rendered and one of its properties changes later. In this case the renderer should only update the element and not rebuild it from scratch.

view
val view:V
The view to render

Functions

buildElement
abstract fun buildElement():Unit

renderView
open fun renderView(): <ERROR CLASS>
Builds a DOM element corresponding to the view.

Inheritors

ButtonRenderer
open class ButtonRenderer :AbstractViewRenderer<<ERROR CLASS>>

ImageViewRenderer
open class ImageViewRenderer :AbstractViewRenderer<<ERROR CLASS>>

LayoutRenderer
abstract class LayoutRenderer<L> :AbstractViewRenderer<L>
This is the base class for renderers that render layout views.

TextViewRenderer
open class TextViewRenderer :AbstractViewRenderer<<ERROR CLASS>>