Class
caplin.presenter

PresentationModel

The PresentationModel is used to transform a set of domain models into a form that is tightly aligned with the view that will be used to display and edit those domain models. As a consequence, the view becomes free of all logic, and components can be tested through the presentation model rather than using brittle, click-based testing via the view.

Presentation models are built as a tree of caplin.presenter.node.PresentationNode instances, where the root node must extend PresentationModel, which in turn extends caplin.presenter.node.PresentationNode.

Constructor Summary

Attributes Name and Description
caplin.presenter.PresentationModel()

PresentationModel is an abstract base class that all presentation models must extend, and so is not constructed directly.

Method Summary

Attributes Name and Description
String getClassName()

Returns the presentation model class name.

caplin.component.frame.ComponentFrame getComponentFrame()

Presentation models can use this method to receive a reference to the frame containing the caplin.presenter.component.PresenterComponent that this model resides within.

void setComponentFrame(caplin.component.frame.ComponentFrame oComponentFrame)

Presentation models can use the caplin.presenter.PresentationModel#getComponentFrame to receive a reference to the frame containing the caplin.presenter.component.PresenterComponent that this model resides within.

Methods inherited from class caplin.presenter.node.PresentationNode:
getPath, nodes, properties, removeAllListeners, removeChildListeners

Constructor Detail

caplin.presenter.PresentationModel()

PresentationModel is an abstract base class that all presentation models must extend, and so is not constructed directly.

Method Detail

String getClassName()

Returns the presentation model class name.

Returns
Presentation model class name.

caplin.component.frame.ComponentFrame getComponentFrame()

Presentation models can use this method to receive a reference to the frame containing the caplin.presenter.component.PresenterComponent that this model resides within.

A reference to the presenter component itself can be retrieved by invoking caplin.component.frame.ComponentFrame#getComponent.

void setComponentFrame(caplin.component.frame.ComponentFrame oComponentFrame)

Presentation models can use the caplin.presenter.PresentationModel#getComponentFrame to receive a reference to the frame containing the caplin.presenter.component.PresenterComponent that this model resides within.

A reference to the presenter component itself can be retrieved by invoking caplin.component.frame.ComponentFrame#getComponent.

Parameters
caplin.component.frame.ComponentFrame oComponentFrame The frame within which the presenter component resides.