Package org.inspirenxe.strata.api.event.cause


package org.inspirenxe.strata.api.event.cause
Causes: who or what led to an event.

Every event has a Cause, a chain of the objects a change passed through and a context of keyed values. The most asked value is the origin: the user at this screen, another person through the server, a data binding, or plain code. Event.origin() reads it without making the whole cause, and Event.cause() makes the cause only when a handler asks for it.

Causes come from a CauseStack of open frames. Hosts open one for each input they dispatch, a control acting on another pushes itself, such as a radio group deselecting a button, and code that applies a change for someone else opens its own. On an engine with a cause stack of its own, the adapter can back Strata's stack with the engine's.