blob: 9bb84a4913d4b049ea88759d54a52298bcb2c794 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
package org.openslx.dozmod.gui.wizard.page;
import java.util.List;
import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.dozmod.gui.wizard.Wizard;
import org.openslx.dozmod.gui.wizard.layout.LectureLocationSelectionPageLayout;
import org.openslx.dozmod.state.LectureWizardState;
import org.openslx.dozmod.thrift.Session;
public class LectureLocationSelectionPage extends LectureLocationSelectionPageLayout {
/**
* Version for serialization.
*/
private static final long serialVersionUID = 4438572389120087933L;
private LectureWizardState state = null;
public LectureLocationSelectionPage(Wizard wizard, LectureWizardState state) {
super(wizard);
setPageComplete(true);
this.state = state;
}
@Override
protected boolean wantNextOrFinish() {
return updateState();
}
private boolean updateState() {
List<Integer> locations = ctlLocationSelector.getSelectedLocationsAsIds();
boolean locationExclusive = ctlLocationSelector.getOnlyInSelection();
if (locations != null && locations.size() > Session.getSatelliteConfig().maxLocationsPerLecture) {
setErrorMessage(I18n.PAGE.getString("LectureLocationSelection.WizardPage.errorMessage.tooManyLocations"));
ctlLocationSelector.setSelectedLocationsAsIds(locations);
return false;
}
state.locations = locations;
state.onlyInSelectedLocations = locationExclusive;
setErrorMessage(null);
return true;
}
}
|