Caplin Trader 5.1.0

Interface: module:ct-component/InstrumentReceiver

module:ct-component/InstrumentReceiver

The InstrumentReceiver interface is primarily implemented by components that wish to participate in drag&drop operations. By implementing this one interface however, trader applications that wish to employ other mechanisms for instrument addition, can do this in a generalized way that will work with all components.

Methods

canReceive()

Whether a receiver is currently accepting new objects.

canReceiveMultipleObjects()

Whether the receiver is able to handle multiple objects.

canReceiveObjects(objects)

Use this to determine if the objects being dropped can be received.

Parameters:
Name Type Description
objects Array

The list of object names about to passed to this receiver

See:

getLastReceiveFailureMessage()

This method is abstract and must be implemented by subclasses.

This method is used when module:ct-component/InstrumentReceiver#canReceiveObjects returns false and an error message is required to explain why the objects were not accepted.

getSuccessMessage()

This method is abstract and must be implemented by subclasses.

This method is used when module:ct-component/InstrumentReceiver#canReceiveObjects returns true and a success message is required to explain when the objects are accepted.

receiveObjects(objects, indexopt)

The callback method that is invoked when an object is dropped onto the implementing object.

Parameters:
Name Type Attributes Description
objects Array

The list of object names being passed to this receiver

index number <optional>

The index to insert the new objects at. If not included, objects should be appended to the end.