Class
caplin.workbench.ui

WorkbenchDataEditor

A WorkbenchDataEditor allows for manipulation of the subscriber data (for example, pricing) via a caplin.services.messaging.Subscription. Generally for workbenches, this is achieved via a caplin.services.testing.SubscriptionStub, for example:
	var oDataSubscriber = new caplin.services.testing.SubscriptionStub("GBPUSD");
	var oMessageService =
	{
		createSubscriber: function(sSubject)
		{
			return oDataSubscriber;
		}
	};
caplin.core.ServiceRegistry.registerService("caplin.message-service", oMessageService);

var oPriceDataEditor = new caplin.workbench.ui.WorkbenchDataEditor(oDataSubscriber, 2000);
oPriceDataEditor.addFieldsByExample({"Bid":"1.1111", "Ask":"1.1112"});
The WorkbenchDataEditor also supports randomly generated updates of data, which is useful for testing price updates.

Constructor Summary

Attributes Name and Description
caplin.workbench.ui.WorkbenchDataEditor(caplin.services.messaging.Subscription oDataSubscriber, int nAutoGenerateIntervalMillis)

Method Summary

Attributes Name and Description
void addDataGenerator(caplin.workbench.model.DataGenerator oDataGenerator)

Adds a data generator that will be used to generate updates for this class.

Methods inherited from class caplin.workbench.ui.QuickForm:
getPresentationModel

Constructor Detail

caplin.workbench.ui.WorkbenchDataEditor(caplin.services.messaging.Subscription oDataSubscriber, int nAutoGenerateIntervalMillis)

Parameters
caplin.services.messaging.Subscription oDataSubscriber The data subscriber to add.
int nAutoGenerateIntervalMillis The interval which will be used to generate data updates.

Method Detail

void addDataGenerator(caplin.workbench.model.DataGenerator oDataGenerator)

Adds a data generator that will be used to generate updates for this class. Note that the generate method will be called at a rate of nAutoGenerateIntervalMillis (as specified in the constructor).

Parameters
caplin.workbench.model.DataGenerator oDataGenerator The generator to add.