Caplin Trader 5.1.0

Interface: module:ct-layout/Layout

module:ct-layout/Layout

A layout is an area of an application's GUI which a user can customise by adding, removing and/or moving module:ct-component/Components.

This interface allows you to view its properties, and insert components into it.

This interface uses emitr allowing classes implementing this interface to trigger events.

Members

(static) EVENT_NAMES :Object

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

Type:
  • Object

(static) EVENT_NAMES.PROPERTY_CHANGED :String

Triggered when a layouts property changes.

Type:
  • String

Methods

getName() → {String}

Returns the name of the layout. This is a display name only, and should not be used for identification.

Returns:

The name of the layout.

Type
String

getProperty(propertyName) → {String}

Returns the value of the layout's property.

Parameters:
Name Type Description
propertyName String

The name of the property to retrieve.

Returns:
Type
String

insertComponent(component, name)

Inserts the given component into the layout.

Parameters:
Name Type Description
component module:ct-component/Component

The component to be added to the layout.

name String

The display name for the component.

isClosable() → {Boolean}

Returns true if this layout can be closed, false otherwise.

Returns:
Type
Boolean

isSaved() → {Boolean}

Returns true if this layout is saved, false otherwise.

Returns:
Type
Boolean

isWritable(component, name)

Returns true if this layout can be saved, false otherwise. Attempting to call module:ct-layout/LayoutService#save with a layout that isn't writable will result in an error being thrown. To save a layout that isn't writable, use module:ct-layout/LayoutService#saveAs instead.

Parameters:
Name Type Description
component module:ct-component/Component

The component to be added to the layout.

name String

The display name for the component.

setName(name)

Updates the name of the layout.

Parameters:
Name Type Description
name String

The new name of the layout.