| 1 | |
package org.jtheque.films.stats; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 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 | |
|
| 30 | |
|
| 31 | |
|
| 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 | |
|
| 39 | |
|
| 40 | |
public static final String IMAGE_BASE_NAME = "org/jtheque/films/stats/images"; |
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
private Feature statsFeature; |
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 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 | |
|
| 60 | |
|
| 61 | |
@UnPlug |
| 62 | |
public void unplug() { |
| 63 | 0 | Managers.getManager(IFeatureManager.class).getFeature(CoreFeature.ADVANCED).removeSubFeature(statsFeature); |
| 64 | 0 | } |
| 65 | |
} |