Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
VideoListModel |
|
| 1.0;1 |
1 | package org.jtheque.films.view.impl.models.list; | |
2 | ||
3 | /* | |
4 | * This file is part of JTheque. | |
5 | * | |
6 | * JTheque is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License. | |
9 | * | |
10 | * JTheque is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | import org.jtheque.core.managers.Managers; | |
20 | import org.jtheque.core.managers.beans.IBeansManager; | |
21 | import org.jtheque.core.managers.view.impl.components.model.SimpleListModel; | |
22 | import org.jtheque.films.services.able.IFilmsService; | |
23 | import org.jtheque.films.services.impl.utils.VideoFile; | |
24 | ||
25 | import javax.annotation.Resource; | |
26 | ||
27 | /** | |
28 | * A List model to display the modules. | |
29 | * | |
30 | * @author Baptiste Wicht | |
31 | */ | |
32 | public final class VideoListModel extends SimpleListModel<VideoFile> { | |
33 | @Resource | |
34 | private IFilmsService filmsService; | |
35 | ||
36 | /** | |
37 | * Construct a new ModuleListModel. | |
38 | */ | |
39 | public VideoListModel() { | |
40 | 0 | super(); |
41 | ||
42 | 0 | Managers.getManager(IBeansManager.class).inject(this); |
43 | ||
44 | 0 | setElements(filmsService.getVideoFiles()); |
45 | 0 | } |
46 | ||
47 | /** | |
48 | * Refresh the model. | |
49 | */ | |
50 | public void refresh() { | |
51 | 0 | setElements(filmsService.getVideoFiles()); |
52 | 0 | } |
53 | } |