Interface
caplin.layout

LayoutService

The LayoutService provides access to the user's {caplin.layout.Layout}s.

This service can be accessed from the caplin.core.AliasRegistry, using the alias 'caplin.layout-service'. There is no default implementation for this service.

This interface uses Emitter allowing services implementing this interface to trigger events.

Constructor Summary

Attributes Name and Description
caplin.layout.LayoutService()

Field Summary

Attributes Name and Description
<static> caplin.layout.LayoutService.EVENT_NAMES

A map of events that services implementing this interface will trigger.

Method Summary

Attributes Name and Description
void close( layout)

Closes the given layout, removing it from the view and from the list of open layouts.

Array getAvailable()

Returns an array of all layouts that the user has available to them.

Array getOpen()

Returns an array of all layouts that the user currently has open.

caplin.layout.Layout getSelected()

Returns the currently selected layout.

void open( layout)

Opens the given layout, adding it to the view and the list of open layouts.

void save(caplin.layout.Layout layout)

Saves the given layout.

void select( layout)

Selects the given layout.

Constructor Detail

caplin.layout.LayoutService()

Field Detail

<static> caplin.layout.LayoutService.EVENT_NAMES

A map of events that services implementing this interface will trigger.

Method Detail

void close( layout)

Closes the given layout, removing it from the view and from the list of open layouts. Usually this will trigger a select on a different layout, if this layout was the currently selected layout. layout>Layoutod will raise a caplin.layout.LayoutService.EVENT_NAMES.CLOSED event with the closed layout as the only argument.

Parameters
layout

Array getAvailable()

Returns an array of all layouts that the user has available to them.

Returns
{Array} The user's available layouts.

Array getOpen()

Returns an array of all layouts that the user currently has open.

Returns
{Array} The user's currently open layouts.

caplin.layout.Layout getSelected()

Returns the currently selected layout.

Returns
{caplin.layout.Layout} The currently selected layout.

void open( layout)

Opens the given layout, adding it to the view and the list of open layouts. This will usually make it the selected layout. layout>Layoutod will raise a caplin.layout.LayoutService.EVENT_NAMES.OPENED event with the opened layout as the only argument.

Parameters
layout

void save(caplin.layout.Layout layout)

Saves the given layout.

Parameters
caplin.layout.Layout layout The layout to be saved.

void select( layout)

Selects the given layout. This will typically bring it to the front, and allow context sensitive actions to be performed on it. layout>Layoutod will raise a caplin.layout.LayoutService.EVENT_NAMES.SELECTED event with the selected layout as the only argument.

Parameters
layout