1 | |
package org.jtheque.core.managers.view.impl.actions.module; |
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.module.IModuleManager; |
21 | |
import org.jtheque.core.managers.module.beans.ModuleContainer; |
22 | |
import org.jtheque.core.managers.view.able.IViewManager; |
23 | |
import org.jtheque.core.managers.view.able.update.IModuleView; |
24 | |
import org.jtheque.core.managers.view.impl.actions.JThequeAction; |
25 | |
import org.jtheque.core.utils.CoreUtils; |
26 | |
|
27 | |
import java.awt.event.ActionEvent; |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
public final class UninstallModuleAction extends JThequeAction { |
35 | |
|
36 | |
|
37 | |
|
38 | |
public UninstallModuleAction() { |
39 | 0 | super("modules.actions.uninstall"); |
40 | 0 | } |
41 | |
|
42 | |
@Override |
43 | |
public void actionPerformed(ActionEvent e) { |
44 | 0 | IModuleView moduleView = CoreUtils.getBean("moduleView"); |
45 | |
|
46 | 0 | ModuleContainer module = moduleView.getSelectedModule(); |
47 | |
|
48 | 0 | boolean confirm = Managers.getManager(IViewManager.class).askI18nUserForConfirmation( |
49 | |
"dialogs.confirm.uninstall", |
50 | |
"dialogs.confirm.uninstall.title"); |
51 | |
|
52 | 0 | if (confirm) { |
53 | 0 | Managers.getManager(IModuleManager.class).uninstallModule(module); |
54 | |
|
55 | 0 | moduleView.refreshList(); |
56 | |
} |
57 | 0 | } |
58 | |
} |