1 | |
package org.jtheque.films.view.impl.actions.film; |
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.view.able.IViewManager; |
22 | |
import org.jtheque.core.managers.view.impl.actions.JThequeAction; |
23 | |
import org.jtheque.films.controllers.able.IExportController; |
24 | |
import org.jtheque.films.controllers.able.IFilmController; |
25 | |
import org.jtheque.utils.StringUtils; |
26 | |
import org.jtheque.utils.io.SimpleFilter; |
27 | |
|
28 | |
import javax.annotation.Resource; |
29 | |
import java.awt.event.ActionEvent; |
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
public final class AcExportFilm extends JThequeAction { |
37 | 0 | private final SimpleFilter jTFFilter = new SimpleFilter("Files JTF(*.jtf)", ".jtf"); |
38 | |
|
39 | |
@Resource |
40 | |
private IFilmController filmController; |
41 | |
|
42 | |
@Resource |
43 | |
private IExportController exportController; |
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
public AcExportFilm() { |
49 | 0 | super("film.view.actions.export"); |
50 | |
|
51 | 0 | Managers.getManager(IBeansManager.class).inject(this); |
52 | 0 | } |
53 | |
|
54 | |
@Override |
55 | |
public void actionPerformed(ActionEvent actionevent) { |
56 | 0 | String filePath = Managers.getManager(IViewManager.class).chooseFile(jTFFilter); |
57 | |
|
58 | 0 | if (StringUtils.isNotEmpty(filePath)) { |
59 | 0 | exportController.exportFilm(filePath, filmController.getViewModel().getCurrentFilm()); |
60 | |
} |
61 | 0 | } |
62 | |
} |