Coverage Report - org.jtheque.core.managers.lifecycle.phases.FirstPhase
 
Classes in this File Line Coverage Branch Coverage Complexity
FirstPhase
0 %
0/13
0 %
0/2
1.5
FirstPhase$1
N/A
N/A
1.5
FirstPhase$DisplayCollectionViewTask
0 %
0/4
N/A
1.5
 
 1  
 package org.jtheque.core.managers.lifecycle.phases;
 2  
 
 3  
 import org.jtheque.core.managers.Managers;
 4  
 import org.jtheque.core.managers.event.EventLevel;
 5  
 import org.jtheque.core.managers.event.EventLog;
 6  
 import org.jtheque.core.managers.event.IEventManager;
 7  
 import org.jtheque.core.managers.language.ILanguageManager;
 8  
 import org.jtheque.core.managers.language.Internationalizable;
 9  
 import org.jtheque.core.managers.module.IModuleManager;
 10  
 import org.jtheque.core.managers.view.able.IViewManager;
 11  
 import org.jtheque.core.managers.view.edt.SimpleTask;
 12  
 
 13  
 /*
 14  
  * This file is part of JTheque.
 15  
  *
 16  
  * JTheque is free software: you can redistribute it and/or modify
 17  
  * it under the terms of the GNU General Public License as published by
 18  
  * the Free Software Foundation, either version 3 of the License.
 19  
  *
 20  
  * JTheque is distributed in the hope that it will be useful,
 21  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 22  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 23  
  * GNU General Public License for more details.
 24  
  *
 25  
  * You should have received a copy of the GNU General Public License
 26  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 27  
  */
 28  
 
 29  
 /**
 30  
  * The first phase of the JTheque life cycle.
 31  
  *
 32  
  * @author Baptiste Wicht
 33  
  */
 34  0
 public final class FirstPhase implements LifeCyclePhase {
 35  
     @Override
 36  
     public void run() {
 37  0
         Managers.preInitManagers();
 38  
 
 39  0
         Managers.getManager(ILanguageManager.class).addInternationalizable((Internationalizable) Managers.getCore().getLifeCycleManager());
 40  
 
 41  0
         Managers.getManager(IViewManager.class).getSplashManager().displaySplashScreen();
 42  
 
 43  0
         Managers.getManager(IEventManager.class).addEventLog("JTheque Core", new EventLog(EventLevel.INFO, "User", "events.start"));
 44  
 
 45  0
         Managers.getManager(IModuleManager.class).prePlugModules();
 46  
 
 47  0
         Managers.initManagers();
 48  
 
 49  0
         Managers.getManager(IModuleManager.class).plugModules();
 50  
 
 51  0
         if (Managers.getManager(IModuleManager.class).isCollectionModule()) {
 52  0
             Managers.getManager(IViewManager.class).execute(new DisplayCollectionViewTask());
 53  
         } else {
 54  0
             Managers.getCore().getLifeCycleManager().launchNextPhase();
 55  
         }
 56  0
     }
 57  
 
 58  
     /**
 59  
      * A task to display the collection view in the EDT.
 60  
      *
 61  
      * @author Baptiste Wicht
 62  
      */
 63  0
     private static final class DisplayCollectionViewTask extends SimpleTask {
 64  
         @Override
 65  
         public void run() {
 66  0
             Managers.getManager(IViewManager.class).getSplashManager().closeSplashScreen();
 67  0
             Managers.getManager(IViewManager.class).displayCollectionView();
 68  0
         }
 69  
     }
 70  
 }