1 | |
package org.jtheque.films.view.impl.actions.file; |
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.resource.IResourceManager; |
21 | |
import org.jtheque.core.managers.resource.ImageType; |
22 | |
import org.jtheque.core.managers.view.impl.actions.JThequeAction; |
23 | |
import org.jtheque.films.controllers.able.IExportController; |
24 | |
import org.jtheque.films.utils.Constants; |
25 | |
import org.jtheque.films.utils.Constants.Files.FileType; |
26 | |
import org.jtheque.utils.StringUtils; |
27 | |
|
28 | |
import javax.annotation.Resource; |
29 | |
import java.awt.event.ActionEvent; |
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
public final class AcExport extends JThequeAction { |
37 | |
private final FileType fileType; |
38 | |
|
39 | |
@Resource |
40 | |
private IExportController exportController; |
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
public AcExport(String key, String fileType, String icon) { |
50 | 0 | super(key); |
51 | |
|
52 | 0 | this.fileType = FileType.fromString(fileType); |
53 | |
|
54 | 0 | if (StringUtils.isNotEmpty(icon)) { |
55 | 0 | setIcon(Managers.getManager(IResourceManager.class).getIcon(Constants.IMAGE_BASE_NAME, icon, ImageType.PNG)); |
56 | |
} |
57 | 0 | } |
58 | |
|
59 | |
@Override |
60 | |
public void actionPerformed(ActionEvent arg0) { |
61 | 0 | exportController.openExportView(fileType); |
62 | 0 | } |
63 | |
} |