package org.openslx.dozmod.gui.wizard.page; import java.util.List; import org.apache.log4j.Logger; 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; @SuppressWarnings("serial") public class LectureLocationSelectionPage extends LectureLocationSelectionPageLayout { private final static Logger LOGGER = Logger.getLogger(LectureLocationSelectionPage.class); 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 locations = ctlLocationSelector.getSelectedLocationsAsIds(); boolean locationExclusive = ctlLocationSelector.getOnlyInSelection(); if (locations != null && locations.size() > Session.getSatelliteConfig().maxLocationsPerLecture) { setErrorMessage("Zu viele Räume/Orte ausgewählt"); ctlLocationSelector.setSelectedLocationsAsIds(locations); return false; } state.locations = locations; state.onlyInSelectedLocations = locationExclusive; setErrorMessage(null); return true; } }