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 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
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 | |
|
60 | |
|
61 | |
|
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 | |
} |