package org.openslx.dozmod.gui.wizard.page; import java.util.List; import org.openslx.bwlp.thrift.iface.NetRule; import org.openslx.dozmod.gui.wizard.Wizard; import org.openslx.dozmod.gui.wizard.layout.LectureOptionsPageLayout; import org.openslx.dozmod.state.LectureWizardState; import org.openslx.dozmod.thrift.Session; @SuppressWarnings("serial") public class LectureOptionsPage extends LectureOptionsPageLayout { private LectureWizardState state = null; private List currentNetrules; private String currentRunscript = new String(""); /** * Page for lecture options */ public LectureOptionsPage(final Wizard wizard, LectureWizardState state) { super(wizard); this.state = state; this.currentNetrules = state.netRules; this.currentRunscript = state.runScriptText; setPageComplete(true); if (!Session.isLectureRestrictionsSupported()) { chkIsExam.setEnabled(false); chkInternetEnabled.setEnabled(false); chkUsbEnabled.setEnabled(false); } } @Override protected boolean wantNextOrFinish() { return updateState(); } /** * Set the selected options in state */ private boolean updateState() { state.isExam = chkIsExam.isSelected(); state.autoUpdate = chkAutoUpdate.isSelected(); state.internetAccess = chkInternetEnabled.isSelected(); state.isEnabled = chkIsActive.isSelected(); state.usbAllowed = chkUsbEnabled.isSelected(); state.netRules = currentNetrules; state.runScriptText = currentRunscript; setDescription("Klicken Sie auf 'Weiter' für Berechtigungen oder 'Fertigstellen'."); return true; } }