Caplin Trader 5.1.0

Class: module:ct-layout/testing/LayoutServiceStub

module:ct-layout/testing/LayoutServiceStub()

new module:ct-layout/testing/LayoutServiceStub()

A stub implementation of the module:ct-layout/LayoutService that can be used as a replacement for the real implementation in workbenches and tests.

This class shouldn't be instantiated directly. It is available trough the service registry under the caplin.layout-service alias when you are running the "dev" scenario (workbench and tests).

Implements:

Members

(static) EVENT_NAMES

A map of "requested" events that will get triggered when user code interacts with the caplin.layout-service service.

Contains the following events:

REQUESTED.OPEN

Triggered when module:ct-layout/LayoutService#open is called.

PARAMETERS
module:ct-layout/Layout layout The layout to be opened.
REQUESTED.OPEN_NEW
Triggered when module:ct-layout/LayoutService#openNew is called.
PARAMETERS
module:ct-layout/LayoutTemplate template The layout template to be opened.
REQUESTED.SELECT
Triggered when module:ct-layout/LayoutService#select is called.
PARAMETERS
module:ct-layout/Layout layout The layout to be selected.
REQUESTED.CLOSE
Triggered when module:ct-layout/LayoutService#close is called.
PARAMETERS
module:ct-layout/Layout layout The layout to be closed.
REQUESTED.SAVE
Triggered when module:ct-layout/LayoutService#save is called.
PARAMETERS
module:ct-layout/Layout layout The layout to be saved.
REQUESTED.SAVE_AS
Triggered when module:ct-layout/LayoutService#saveAs is called.
PARAMETERS
module:ct-layout/Layout layout The layout to be saved.
String name The name to be given to the new layout.
REQUESTED.DISPOSE
Triggered when module:ct-layout/LayoutService#dispose is called.
PARAMETERS
module:ct-layout/Layout layout The layout to be disposed.

Methods

clone()

Triggers a REQUESTED.CLONE event.

Implements:
See:

close()

Triggers a REQUESTED.CLOSE event.

Implements:
See:

createLayout(nameopt, isClosableopt) → {module:ct-layout/testing.LayoutStub}

Parameters:
Name Type Attributes Description
name String <optional>

Name of the new layout.

isClosable Boolean <optional>

Can the newly created layout be closed or not.

Returns:
Type
module:ct-layout/testing.LayoutStub

createLayoutTemplate(nameopt) → {module:ct-layout/testing/LayoutTemplateStub}

Parameters:
Name Type Attributes Description
name String <optional>

Name of the new template.

Returns:
Type
module:ct-layout/testing/LayoutTemplateStub

dispose()

Triggers a REQUESTED.DISPOSE event.

Implements:
See:

doClone()

Perform the actual clone of the layout.

See:

doClose()

Perform the actual closing of the layout.

See:

doDispose()

Perform the actual deleting of the layout.

See:

doOpen()

Perform the actual opening of the layout.

See:

doOpenNew()

Perform the actual openening of a new layout.

See:

doSave()

Perform the actual save of the layout.

See:

doSaveAs()

Perform the actual save as of the layout.

See:

doSelect()

Perform the actual selection of the layout.

See:

getAvailable()

Implements:
See:

getOpen()

Implements:
See:

getSelected()

Implements:
See:

getTemplates()

Implements:
See:

open()

Triggers a REQUESTED.OPEN event.

Implements:
See:

openNew()

Triggers a REQUESTED.OPEN_NEW event. If no template is passed, the first template in the service's list of templates will be used as a default.

Implements:
See:

save()

Triggers a REQUESTED.SAVE event.

Implements:
See:

saveAs()

Triggers a REQUESTED.SAVE_AS event.

Implements:
See:

select()

Triggers a REQUESTED.SELECT event.

Implements:
See:

startEventProxy()

Starts the event proxy which automatically responds to any "-requested" events and calls the corresponding "do" method on the stub layout service.

stopEventProxy()

Stops the event proxy.