1 package fr.ifremer.tutti.ui.swing.content.actions;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import fr.ifremer.tutti.ui.swing.TuttiScreen;
26 import fr.ifremer.tutti.ui.swing.content.MainUIHandler;
27
28 import javax.swing.SwingUtilities;
29
30 import static org.nuiton.i18n.I18n.t;
31
32
33
34
35
36
37
38 public class OpenTemporaryReferentialScreenAction extends AbstractChangeScreenAction {
39
40 public OpenTemporaryReferentialScreenAction(MainUIHandler handler) {
41 super(handler, true, TuttiScreen.IMPORT_TEMPORARY_REFERENTIAL);
42 }
43
44 @Override
45 public boolean prepareAction() throws Exception {
46 boolean result = super.prepareAction();
47 if (result) {
48 result = askAdminPassword(
49 t("tutti.manageTemporaryReferential.passwordDialog.message"),
50 t("tutti.manageTemporaryReferential.passwordDialog.title"),
51 t("tutti.manageTemporaryReferential.passwordDialog.error.message"),
52 t("tutti.manageTemporaryReferential.passwordDialog.error.title")
53 );
54 }
55 return result;
56 }
57
58 @Override
59 public void doAction() throws Exception {
60 super.doAction();
61 loadReferantials(true);
62 SwingUtilities.invokeLater(() -> getContext().getMainUI().getBody().revalidate());
63
64 }
65 }