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 com.google.gwt.dom.client.*; import votorola.a.web.gwt.*; import votorola.g.hold.*; /** The GWT library module for the Crossforum Theatre stage. An instance of this class is * automatically constructed and invoked per module definition StageMod.gwt.xml. * It then calls global JavaScript function voGWTConfig.s_gwt_stage if it is * defined. Here is an example function definition suitable for use in the configuration * script {@linkplain GWTConfig gwt.js}:
  *
  *     voGWTConfig.s_gwt_stage = function()
  *     {
  *         s_gwt_stage_link_NominalDifferenceTargeter_setEnabled();
  *         s_gwt_stage_vote_CountNodeV_setDeselectionGuard( 'Lax' );
  *         s_gwt_stage_vote_DifferenceLight_setScene( 'Frank-FlippityNet' );
  *         // and so on
  *     };
* *

See the complete list of configuration * callbacks. Usage instructions are provided for each.

*/ public final @GWTConfig class StageMod implements EntryPointS { /** Answers whether this module's {@linkplain GWTConfigCallback configurable classes} are * currently being forced to initialize in preparation for configuration. This is * for asserting in boilerplate code that is liable to be incorrectly copied. If you * see the corresponding assertion error, then simply add the offending class to * {@linkplain #onModuleLoad() onModuleLoad}'s forced initialization. */ public static boolean isForcedInit() { return isForcedInit; } private static boolean isForcedInit; // - E n t r y - P o i n t ------------------------------------------------------------ public void onModuleLoad() { final Spool configurationSpool = new Spool1(); isForcedInit = true; try // force class init prior to callback from config script gwt.js { votorola.s.gwt.stage.link.NominalDifferenceTargeter.forceInitClass(); votorola.s.gwt.stage.vote.NodeV.forceInitClass( configurationSpool ); votorola.s.gwt.stage.vote.DifferenceLight.forceInitClass(); } finally { isForcedInit = false; } configureJS(); if( PollwikiG.getScriptLocation() == null ) // default: { String serverName = Document.get().getDomain(); if( serverName == null ) serverName = "localhost"; PollwikiG.setScriptLocation( "http://" + serverName + "/mediawiki" ); } if( PollwikiG.getLocation() == null ) // default: { PollwikiG.setLocation( PollwikiG.getScriptLocation() + "/index.php" ); } configurationSpool.unwind(); new Stage(); EntryPointS.U.schedule( StageMod.this ); } // - S c h e d u l e r . S c h e d u l e d - C o m m a n d ---------------------------- public void execute() { Stage.i().init0(); } //// P r i v a t e /////////////////////////////////////////////////////////////////////// private static native void configureJS() /*-{ var f; try{ f = $wnd.voGWTConfig.s_gwt_stage; } catch( e ) {} // in case parents undefined if( f ) f(); }-*/; }