package votorola.s.gwt.stage; // Copyright 2012, Michael Allan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE.
import votorola.a.web.gwt.GWTConfig;
/** An initializer of theatre state. Initializers must ordinarily {@linkplain
* Stage#addInitializer(TheatreInitializer) register with the stage}. The {@linkplain
* votorola.a.web.gwt.GWTConfig gwt.js} configuration script is implicitly registered, as
* some of the configuration
* methods exposed to it are restricted to initializers. Each registered initializer
* (plus gwt.js
) receives a call to either A
* initFrom
and then initFromComplete
, or B
* initTo
and then initToComplete
, but never both A and B.
*
* @see Persistence of state in a single page
*/
public @GWTConfig interface TheatreInitializer
{
// - T h e a t r e - I n i t i a l i z e r --------------------------------------------
/** Here the prop or other component initializes its own properties by reference to a
* previously initialized stage. This method is called on page load after the state
* of the stage has been restored via single-page
* persistence. Writing to the stage is permitted here, though ordinarily only
* page authors will do this and only in cases where a stage property needs to be
* re-initialized owing to a change in the environment, such as a structual change to
* the page.
*
*
The equivalent JavaScript callback is the global function
* voGWTConfig.s_gwt_stage_Stage_initFrom
. It may be defined in the
* {@linkplain votorola.a.web.gwt.GWTConfig gwt.js} configuration script, for
* example.
initFrom
was called for all props and that immediate
* initialization of the stage is complete and the associated events have fired.
* Referrer resolution may yet follow depending on the value of
* rPending
. This method is called only when the state is initialized
* by restoration, i.e. in those cases where initFrom
is called.
*
* The equivalent JavaScript callback is the global function
* voGWTConfig.s_gwt_stage_Stage_initFromComplete
. It may be defined in
* the {@linkplain votorola.a.web.gwt.GWTConfig gwt.js} configuration script, for
* example.
The equivalent JavaScript callback is the global function
* voGWTConfig.s_gwt_stage_Stage_initTo
. It may be defined in the
* {@linkplain votorola.a.web.gwt.GWTConfig gwt.js} configuration script, for
* example.
r
parameter. The prop will also provide a means of selecting other
* differences and of re-selecting the original one, such that the user need never
* navigate back and re-transit the link for this purpose.
*
* A prop ought generally to avoid transferring a given property from a referrer * when it already has a non-default value on the destination, whether set by the * scene or by another prop. By the same token, an initializer that sets a default * value for a property, such as {@linkplain Stage#setDefaultActorName(String) actor * name}, will typically null the ordinary value to ensure that the default is * immediately exhibited. It is recommended however that defaults be set earlier, * e.g. during module initialization.
* *The equivalent JavaScript callback is the global function
* voGWTConfig.s_gwt_stage_Stage_initTo
. It may be defined in the
* {@linkplain votorola.a.web.gwt.GWTConfig gwt.js} configuration script, for
* example.
initTo
was called for all props and that immediate
* initialization of the stage is complete and the associated events have fired.
* Referrer resolution may yet follow depending on the value of
* rPending
. This method is called only when the state is initialized
* from scratch, i.e. in those cases where initTo
is called.
*
* The equivalent JavaScript callback is the global function
* voGWTConfig.s_gwt_stage_Stage_initToComplete
. It may be defined in
* the {@linkplain votorola.a.web.gwt.GWTConfig gwt.js} configuration script, for
* example.
rPending
was asserted in one of the
* previous initialization calls. Resolution is never deferred longer than {@value
* votorola.s.gwt.stage.ReferrerRelayer#MAX_REFERRER_RESOLUTION_MS} milliseconds.
*
* The equivalent JavaScript callback is the global function
* voGWTConfig.s_gwt_stage_Stage_initUltimately
. It may be defined in
* the {@linkplain votorola.a.web.gwt.GWTConfig gwt.js} configuration script, for
* example.