1 | |
package org.jtheque.films.view.impl.actions.lendings; |
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.view.impl.actions.JThequeAction; |
21 | |
import org.jtheque.core.managers.view.IViewManager; |
22 | |
import org.jtheque.films.controllers.able.ILendingsController; |
23 | |
import org.jtheque.films.view.able.ILendingsView; |
24 | |
|
25 | |
import javax.annotation.Resource; |
26 | |
|
27 | |
import java.awt.event.ActionEvent; |
28 | |
import java.util.List; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
public final class AcRetourCurrentFilm extends JThequeAction { |
36 | |
private static final long serialVersionUID = 1235248610981426905L; |
37 | |
|
38 | |
@Resource |
39 | |
private ILendingsController lendingsController; |
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
public AcRetourCurrentFilm() { |
45 | 0 | super("lendings.view.actions.return"); |
46 | 0 | } |
47 | |
|
48 | |
@Override |
49 | |
public void actionPerformed(ActionEvent e) { |
50 | 0 | ILendingsView view = (ILendingsView) lendingsController.getView(); |
51 | |
|
52 | 0 | List<Integer> ids = view.getSelectedLendingsID(); |
53 | |
|
54 | 0 | if (ids.isEmpty()) { |
55 | 0 | Managers.getManager(IViewManager.class).displayI18nText("lendings.dialogs.selectLending"); |
56 | |
} else { |
57 | 0 | for (int id : ids) { |
58 | 0 | lendingsController.deleteLending(id); |
59 | |
} |
60 | |
} |
61 | 0 | } |
62 | |
} |