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.language.ILanguageManager; |
22 | |
import org.jtheque.core.managers.view.able.IViewManager; |
23 | |
import org.jtheque.core.managers.view.impl.actions.JThequeAction; |
24 | |
import org.jtheque.films.controllers.able.IFilmController; |
25 | |
|
26 | |
import java.awt.event.ActionEvent; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
public final class AcDelete extends JThequeAction { |
34 | |
|
35 | |
|
36 | |
|
37 | |
public AcDelete() { |
38 | 0 | super("generic.view.actions.delete"); |
39 | 0 | } |
40 | |
|
41 | |
@Override |
42 | |
public void actionPerformed(ActionEvent e) { |
43 | 0 | final boolean yes = Managers.getManager(IViewManager.class).askUserForConfirmation( |
44 | |
Managers.getManager(ILanguageManager.class).getMessage("film.dialogs.confirmDelete", |
45 | |
Managers.getManager(IBeansManager.class).<IFilmController>getBean("filmController").getViewModel().getCurrentFilm().getDisplayableText()), |
46 | |
Managers.getManager(ILanguageManager.class).getMessage("film.dialogs.confirmDelete.title")); |
47 | |
|
48 | 0 | if (yes) { |
49 | 0 | Managers.getManager(IBeansManager.class).<IFilmController>getBean("filmController").deleteCurrentFilm(); |
50 | |
} |
51 | 0 | } |
52 | |
} |