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 ValidateSelectedCruiseAction extends AbstractChangeScreenAction {
39
40
41 private static final Log log =
42 LogFactory.getLog(ValidateSelectedCruiseAction.class);
43
44 public ValidateSelectedCruiseAction(MainUIHandler handler) {
45 super(handler, true, TuttiScreen.VALIDATE_CRUISE);
46 }
47
48 @Override
49 public void doAction() throws Exception {
50 Preconditions.checkState(getContext().isProgramFilled());
51 Preconditions.checkState(getContext().isCruiseFilled());
52 getContext().setValidationContext(ValidationService.VALIDATION_CONTEXT_VALIDATE);
53 if (log.isInfoEnabled()) {
54 log.info("Validate operations of cruise: " + getContext().getCruiseId());
55 }
56 super.doAction();
57 }
58 }