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 com.google.common.base.Preconditions;
26 import fr.ifremer.tutti.service.ValidationService;
27 import fr.ifremer.tutti.ui.swing.TuttiScreen;
28 import fr.ifremer.tutti.ui.swing.content.MainUIHandler;
29 import org.apache.commons.logging.Log;
30 import org.apache.commons.logging.LogFactory;
31
32
33
34
35
36
37
38 public class EditSelectedCruiseAction extends AbstractChangeScreenAction {
39
40
41 private static final Log log =
42 LogFactory.getLog(EditSelectedCruiseAction.class);
43
44 public EditSelectedCruiseAction(MainUIHandler handler) {
45 super(handler, true, TuttiScreen.EDIT_CRUISE);
46 }
47
48 @Override
49 public void doAction() throws Exception {
50
51 Preconditions.checkState(getContext().isCruiseFilled());
52 if (log.isInfoEnabled()) {
53 log.info("Edit cruise: " + getContext().getCruiseId());
54 }
55 getContext().setValidationContext(ValidationService.VALIDATION_CONTEXT_EDIT);
56
57 loadReferantials(true);
58 super.doAction();
59
60 }
61 }