package votorola.s.gwt.wic; // Copyright 2012-2013, 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.core.client.JavaScriptObject; import votorola.a.web.gwt.*; import votorola.g.web.gwt.*; import votorola.s.gwt.stage.*; /** The GWT entry module for embedding the Crossforum Theatre {@linkplain * votorola.s.gwt.stage.Stage stage} in Wicket count pages. An instance of this class is * automatically constructed and invoked per module definition CountIn.gwt.xml. */ public final class CountIn implements EntryPointS { // - E n t r y - P o i n t ------------------------------------------------------------ public final void onModuleLoad() { StageIn.insertStageV(); EntryPointS.U.schedule( CountIn.this ); EntryPointS.U.execute(); // because all modules are now loaded Stage.i().addInitializer( new TheatreInitializerC() // auto-removed { public @Override void initFrom( final Stage stage, boolean _rPending ) { if( stage.getDefaultPollName() != null ) stage.setPollName( null ); // ensure it's at default despite any glitch that persists the wrong // name, because stage is not independent of scene in count pages. // Would do same for actor, but actor default not set for reasons given // in votorola.s.wic.count.WP_Votespace } public @Override void initComplete( final Stage stage, boolean _rPending ) { final String pageJClass; { final JavaScriptObject voc = WindowX.js()._get( "voc" ); pageJClass = voc == null? null: voc._getString( "pageJClass" ); // per a.web.wic.VPageHTML } if( "votorola.s.wic.count.WP_Poll".equals(pageJClass) ) { new ActorLinker( stage ); new PollPager( stage ); } else { assert "votorola.s.wic.count.WP_Votespace".equals(pageJClass) || "votorola.s.wic.count.WP_Rank".equals(pageJClass); // changing these? change also in s.gwt.stage.VoteTrack new PositionPager( stage ); } } }); } // - 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() { StageV.i().initEmbeddedDisplay(); } }