Coverage Report - org.jtheque.films.stats.StatsModule
 
Classes in this File Line Coverage Branch Coverage Complexity
StatsModule
0 %
0/6
N/A
1
 
 1  
 package org.jtheque.films.stats;
 2  
 
 3  
 /*
 4  
  * This file is part of JTheque.
 5  
  *
 6  
  * JTheque is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License.
 9  
  *
 10  
  * JTheque is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
  * GNU General Public License for more details.
 14  
  *
 15  
  * You should have received a copy of the GNU General Public License
 16  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 17  
  */
 18  
 
 19  
 import org.jtheque.core.managers.Managers;
 20  
 import org.jtheque.core.managers.feature.Feature;
 21  
 import org.jtheque.core.managers.feature.Feature.FeatureType;
 22  
 import org.jtheque.core.managers.feature.IFeatureManager;
 23  
 import org.jtheque.core.managers.feature.IFeatureManager.CoreFeature;
 24  
 import org.jtheque.core.managers.module.annotations.Module;
 25  
 import org.jtheque.core.managers.module.annotations.Plug;
 26  
 import org.jtheque.core.managers.module.annotations.UnPlug;
 27  
 
 28  
 /**
 29  
  * A JTheque Module to display stats of films, actors and realizers.
 30  
  *
 31  
  * @author Baptiste Wicht
 32  
  */
 33  
 @Module(id = "jtheque-stats-module", i18n = "classpath:org/jtheque/films/stats/i18n/stats", version = "1.4.2",
 34  
         core = "2.0.2", jarFile = "jtheque-stats-module-1.4.2.jar", dependencies = "jtheque-films-module",
 35  
         updateURL = "http://jtheque.developpez.com/public/versions/StatsModule.versions")
 36  0
 public final class StatsModule {
 37  
     /**
 38  
      * The base name for the images.
 39  
      */
 40  
     public static final String IMAGE_BASE_NAME = "org/jtheque/films/stats/images";
 41  
 
 42  
     /**
 43  
      * The feature for displaying the stats.
 44  
      */
 45  
     private Feature statsFeature;
 46  
 
 47  
     /**
 48  
      * Plug the module.
 49  
      */
 50  
     @Plug
 51  
     public void plug() {
 52  0
         IFeatureManager manager = Managers.getManager(IFeatureManager.class);
 53  
 
 54  0
         statsFeature = manager.addSubFeature(manager.getFeature(CoreFeature.ADVANCED),
 55  
                 "displayStatsAction", FeatureType.SEPARATED_ACTION, 2, StatsModule.IMAGE_BASE_NAME, "stats");
 56  0
     }
 57  
 
 58  
     /**
 59  
      * Unplug the module.
 60  
      */
 61  
     @UnPlug
 62  
     public void unplug() {
 63  0
         Managers.getManager(IFeatureManager.class).getFeature(CoreFeature.ADVANCED).removeSubFeature(statsFeature);
 64  0
     }
 65  
 }