Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AcOpenVideoFile |
|
| 1.0;1 |
1 | package org.jtheque.films.view.impl.actions.video; | |
2 | ||
3 | import org.jtheque.core.managers.Managers; | |
4 | import org.jtheque.core.managers.beans.IBeansManager; | |
5 | import org.jtheque.core.managers.view.impl.actions.JThequeAction; | |
6 | import org.jtheque.films.services.impl.utils.VideoFile; | |
7 | import org.jtheque.films.view.able.IVideoView; | |
8 | import org.jtheque.utils.DesktopUtils; | |
9 | ||
10 | import java.awt.event.ActionEvent; | |
11 | import java.io.File; | |
12 | ||
13 | /* | |
14 | * This file is part of JTheque. | |
15 | * | |
16 | * JTheque is free software: you can redistribute it and/or modify | |
17 | * it under the terms of the GNU General Public License as published by | |
18 | * the Free Software Foundation, either version 3 of the License. | |
19 | * | |
20 | * JTheque is distributed in the hope that it will be useful, | |
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 | * GNU General Public License for more details. | |
24 | * | |
25 | * You should have received a copy of the GNU General Public License | |
26 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
27 | */ | |
28 | ||
29 | /** | |
30 | * An action to open a video file. | |
31 | * | |
32 | * @author Baptiste Wicht | |
33 | */ | |
34 | public final class AcOpenVideoFile extends JThequeAction { | |
35 | /** | |
36 | * Construct a new AcOpenVideoFile. | |
37 | */ | |
38 | public AcOpenVideoFile() { | |
39 | 0 | super("video.view.actions.open"); |
40 | 0 | } |
41 | ||
42 | @Override | |
43 | public void actionPerformed(ActionEvent e) { | |
44 | 0 | VideoFile file = Managers.getManager(IBeansManager.class).<IVideoView>getBean("videoView").getSelectedFile(); |
45 | ||
46 | 0 | DesktopUtils.open(new File(file.getFilm().getFilePath())); |
47 | 0 | } |
48 | } |