Interface
caplin.element

Renderer

A Renderer transforms machine readable data to a screen caplin.control.Control, and captures user gestures which are then communicated back to one or more caplin.element.RendererEventListeners. This interface allows caplin.element.Handlers to interact with the Renderer.

Constructor Summary

Attributes Name and Description
caplin.element.Renderer()

Method Summary

Attributes Name and Description
void addRendererEventListener(caplin.element.RendererEventListener oRendererEventListener)

Adds a caplin.element.RendererEventListener to which the Renderer will communicates user-gestures.

void clear()

Clears the renderer value and all associated state, including the displayed value.

void clearState()

Clears the renderer state without clearing the displayed value.

void disable()

Disables the renderer control.

void enable()

Enables the renderer control.

void focus()

Moves the focus to this renderer.

Map getFieldValues()

Returns the fields relating to the currently displayed value.

Variant getFormattedValue()

Returns the formatted downstream value.

String getName()

Returns the renderer name.

String getNamespace()

Returns the renderer namespace.

Variant getParsedValue()

Returns the parsed upstream value.

Variant getUnformattedValue()

Returns the unformatted downstream value.

Variant getUnparsedValue()

Returns the unparsed upstream value.

Variant getValue()

Gets the renderer value.

boolean isEnabled()

Determines whether the control is enabled.

void raiseEvent(String sType, Map mRendererEvent)

Raises a renderer event.

void removeRendererEventListener(caplin.element.RendererEventListener oRendererEventListener)

Removes a caplin.element.RendererEventListener to which the Renderer will communicate user-gestures.

void select()

Moves the focus and highlights this renderer.

void setValue(Variant vRendererValue)

Sets the renderer value.

String toString()

Returns a human-readable string representation of the renderer, which is useful for debugging.

void updateFields(Map mFieldValues)

Updates the renderer with the supplied fields.

void updateFieldValues(Map mFieldValues)

Updates the field values.

Constructor Detail

caplin.element.Renderer()

Method Detail

void addRendererEventListener(caplin.element.RendererEventListener oRendererEventListener)

Adds a caplin.element.RendererEventListener to which the Renderer will communicates user-gestures.

Parameters
caplin.element.RendererEventListener oRendererEventListener The renderer event listener.

void clear()

Clears the renderer value and all associated state, including the displayed value. The renderer will remain bound to the DOM.

void clearState()

Clears the renderer state without clearing the displayed value. This is a performant version of clear for when you are going to update the displayed value immediately after clearing.

void disable()

Disables the renderer control. Does nothing if the control has no concept of enabled/disabled.

void enable()

Enables the renderer control. Does nothing if the control has no concept of enabled/disabled.

void focus()

Moves the focus to this renderer. Does nothing if the control has no concept of focus.

Map getFieldValues()

Returns the fields relating to the currently displayed value.

Returns
The field values.

Variant getFormattedValue()

Returns the formatted downstream value.

Returns
The formatted downstream value.

String getName()

Returns the renderer name. This is set by the framework that instantiates the Renderer (e.g. the grid) and represents the field context (e.g. "Bid Price").

Returns
The renderer's name.

String getNamespace()

Returns the renderer namespace. This is set by the framework that instantiates the Renderer (e.g. the grid) and represents the record context (e.g. "/FX/GBPUSD").

Returns
The renderer's namespace.

Variant getParsedValue()

Returns the parsed upstream value.

Returns
The parsed upstream value.

Variant getUnformattedValue()

Returns the unformatted downstream value.

Returns
The unformatted downstream value.

Variant getUnparsedValue()

Returns the unparsed upstream value.

Returns
The unparsed upstream value.

Variant getValue()

Gets the renderer value.

Returns
vRendererValue The renderer value.

boolean isEnabled()

Determines whether the control is enabled.

Returns
true if the control is enabled.

void raiseEvent(String sType, Map mRendererEvent)

Raises a renderer event.

Parameters
String sType The renderer event type.
Map mRendererEvent The renderer event to raise.

void removeRendererEventListener(caplin.element.RendererEventListener oRendererEventListener)

Removes a caplin.element.RendererEventListener to which the Renderer will communicate user-gestures.

Parameters
caplin.element.RendererEventListener oRendererEventListener The renderer event listener.

void select()

Moves the focus and highlights this renderer. Does nothing if the control has no concept of focus.

void setValue(Variant vRendererValue)

Sets the renderer value.

Parameters
Variant vRendererValue The renderer value.

String toString()

Returns a human-readable string representation of the renderer, which is useful for debugging.

Returns
The string representation

void updateFields(Map mFieldValues)

Updates the renderer with the supplied fields. The field values will be reflected in the control on the next call to {caplin.element.Renderer#refresh}. The Renderer might depend on these fields either because it has been bound to them in the constructor, or if the XML renderer definition refers to these fields using the ${} notation. Additional field values can be supplied and they will have no effect on the displayed value, but they will be returned by {caplin.element.Renderer#getFieldValues}. This can exploited to hold additional information about the value (such as price ID or timestamp).

Parameters
Map mFieldValues the new field values.

void updateFieldValues(Map mFieldValues)

Updates the field values.

Parameters
Map mFieldValues The field values.