1 | |
package org.jtheque.films.stats.view.impl.actions; |
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.beans.IBeansManager; |
21 | |
import org.jtheque.core.managers.resource.IResourceManager; |
22 | |
import org.jtheque.core.managers.resource.ImageType; |
23 | |
import org.jtheque.core.managers.view.able.IViewManager; |
24 | |
import org.jtheque.core.managers.view.impl.actions.JThequeAction; |
25 | |
import org.jtheque.films.stats.controller.able.IStatsController; |
26 | |
import org.jtheque.films.stats.services.able.IStatsService; |
27 | |
import org.jtheque.films.stats.view.able.IStatsView; |
28 | |
import org.jtheque.films.utils.Constants; |
29 | |
|
30 | |
import javax.annotation.Resource; |
31 | |
import java.awt.event.ActionEvent; |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
public final class AcRefreshStats extends JThequeAction { |
39 | |
|
40 | |
|
41 | |
|
42 | |
public AcRefreshStats() { |
43 | 0 | super("stats.actions.refresh"); |
44 | |
|
45 | 0 | setIcon(Managers.getManager(IResourceManager.class).getIcon(Constants.IMAGE_BASE_NAME, "refresh", ImageType.PNG)); |
46 | 0 | } |
47 | |
|
48 | |
@Override |
49 | |
public void actionPerformed(ActionEvent event) { |
50 | 0 | IStatsView view = Managers.getManager(IBeansManager.class).<IStatsController>getBean("statsController").getView(); |
51 | |
|
52 | 0 | Managers.getManager(IBeansManager.class).<IStatsService>getBean("statsService").refreshStats(); |
53 | 0 | String[] titles = Managers.getManager(IBeansManager.class).<IStatsService>getBean("statsService").getTitles(); |
54 | |
|
55 | 0 | view.getHeaderRealizers().setDescription(titles[0]); |
56 | 0 | view.getHeaderActors().setDescription(titles[1]); |
57 | 0 | view.getHeaderFilms().setDescription(titles[2]); |
58 | |
|
59 | 0 | Managers.getManager(IViewManager.class).refresh(view.getTab()); |
60 | 0 | } |
61 | |
} |