Search in sources :

Example 81 with Preferences

use of org.olat.core.util.prefs.Preferences in project openolat by klemens.

the class CheckListRunController method saveOpenPanel.

private void saveOpenPanel(UserRequest ureq, String panelId, boolean newValue) {
    Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
    if (guiPrefs != null) {
        guiPrefs.putAndSave(CheckListRunController.class, getOpenPanelId(panelId), Boolean.valueOf(newValue));
    }
    flc.getFormItemComponent().contextPut("in-" + panelId, Boolean.valueOf(newValue));
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 82 with Preferences

use of org.olat.core.util.prefs.Preferences in project openolat by klemens.

the class IQRunController method isPanelOpen.

private boolean isPanelOpen(UserRequest ureq, String panelId, boolean def) {
    Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
    Boolean showConfig = (Boolean) guiPrefs.get(IQRunController.class, getOpenPanelId(panelId));
    return showConfig == null ? def : showConfig.booleanValue();
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 83 with Preferences

use of org.olat.core.util.prefs.Preferences in project openolat by klemens.

the class QTI21AssessmentRunController method isPanelOpen.

private boolean isPanelOpen(UserRequest ureq, String panelId, boolean def) {
    Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
    Boolean showConfig = (Boolean) guiPrefs.get(QTI21AssessmentRunController.class, getOpenPanelId(panelId));
    return showConfig == null ? def : showConfig.booleanValue();
}
Also used : Preferences(org.olat.core.util.prefs.Preferences) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean)

Example 84 with Preferences

use of org.olat.core.util.prefs.Preferences in project openolat by klemens.

the class MSCourseNodeRunController method isPanelOpen.

private boolean isPanelOpen(UserRequest ureq, String panelId, boolean def) {
    Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
    Boolean showConfig = (Boolean) guiPrefs.get(MSCourseNodeRunController.class, getOpenPanelId(panelId));
    return showConfig == null ? def : showConfig.booleanValue();
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 85 with Preferences

use of org.olat.core.util.prefs.Preferences in project openolat by klemens.

the class ToggleBoxController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == toggleButton) {
        Preferences prefs = ureq.getUserSession().getGuiPreferences();
        toggleStatus = new Boolean(!toggleStatus.booleanValue());
        prefs.putAndSave(this.getClass(), key, toggleStatus);
        updateUI();
    } else if (source == hideButton) {
        Preferences prefs = ureq.getUserSession().getGuiPreferences();
        toggleStatus = Boolean.FALSE;
        prefs.putAndSave(this.getClass(), key, toggleStatus);
        updateUI();
    } else if (source == mainVC) {
        if ("hide".equals(event.getCommand())) {
            Preferences prefs = ureq.getUserSession().getGuiPreferences();
            toggleStatus = Boolean.FALSE;
            prefs.putAndSave(this.getClass(), key, toggleStatus);
            updateUI();
        }
    }
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Aggregations

Preferences (org.olat.core.util.prefs.Preferences)92 ArrayList (java.util.ArrayList)12 I18nModule (org.olat.core.util.i18n.I18nModule)8 WindowManager (org.olat.core.gui.WindowManager)6 ContextEntry (org.olat.core.id.context.ContextEntry)6 UserSession (org.olat.core.util.UserSession)6 HashSet (java.util.HashSet)4 Locale (java.util.Locale)4 Map (java.util.Map)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 UserTool (org.olat.admin.user.tools.UserTool)4 UserToolExtension (org.olat.admin.user.tools.UserToolExtension)4 Component (org.olat.core.gui.components.Component)4 FlexiTableSort (org.olat.core.gui.components.form.flexible.elements.FlexiTableSort)4 ProgressBar (org.olat.core.gui.components.progressbar.ProgressBar)4 HistoryPoint (org.olat.core.id.context.HistoryPoint)4 I18nItem (org.olat.core.util.i18n.I18nItem)4 LocationHistory (org.olat.modules.lecture.model.LocationHistory)4 Date (java.util.Date)2 List (java.util.List)2