Package org.olat.core.gui.formelements

Examples of org.olat.core.gui.formelements.TitleElement


    // row id used from within function.js, don't remove this!
    sb.append("\" id=\"").append(JSELEMENTROWID).append(fe.getName() + f.getComponentName()).append("\">");
   
    // deal with special cases first
    if (fe instanceof TitleElement) {
      TitleElement te = (TitleElement) fe;
      sb.append("<h4>").append(translator.translate(te.getTitleKey())).append("</h4>");
     
    } else if (fe instanceof SpacerElement) {
      SpacerElement spe = (SpacerElement) fe;
      if (spe.isHr()) sb.append("<hr class=\"b_form_spacer\" />");
      if (spe.isBr()) sb.append("<div class=\"b_form_spacer\" />");
View Full Code Here


  /**
   * PreferencesForm definition
   */
  public void init() {
    addFormElement("heading1", new TitleElement("form.password.enter.new"));
    addFormElement(PASSWORD_NEW1, new PasswordElement("form.password.new1", 255));
    getPasswordElement(PASSWORD_NEW1).setMandatory(true);
    addFormElement(PASSWORD_NEW2, new PasswordElement("form.password.new2", 255));
    getPasswordElement(PASSWORD_NEW2).setMandatory(true);
    addSubmitKey("submit.speichernUndpwchange","submit.speichernUndpwchange");
View Full Code Here

   */
  public SearchAllCalendarsForm(String name, Translator translator) {
    super(name, translator);

    // title
    addFormElement("cal.search.title", new TitleElement("cal.search.title"));
   
    // subject (hide if in readonly mode and only free/busy flag)
    subject = new TextElement("cal.search.subject", 40);
    addFormElement("cal.search.subject", subject);
   
View Full Code Here

 
  public GuiDemoForm(String name, Translator translator, WindowControl wControl) {
    super(name, translator);
   
    // title
    title = new TitleElement("guidemo.form.title");
    addFormElement("title", title);
   
    // text
    text = new TextElement("guidemo.form.text", 50);
    text.setMandatory(true);
View Full Code Here

   * @param cancelbutton
   */
  public UsermanagerUserSearchForm(String name, Translator translator) {
    super(name, translator);
    // regular search fields
    addFormElement("title.user", new TitleElement("search.form.title.user"));
    login = new TextElement("search.form.login", 128);
    addFormElement("login", login);

    // search user fields
    UserManager um = UserManager.getInstance();
    userPropertyHandlers = um.getUserPropertyHandlersFor(formIdentifyer, true);
    String currentGroup = null;
    // Add all available user fields to this form
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
      if (userPropertyHandler == null) continue;
      FormElement ui = userPropertyHandler.getFormElement(getLocale(), null, formIdentifyer, true);
      String group = userPropertyHandler.getGroup();
      if (!group.equals(currentGroup)) {
        if (currentGroup != null) addFormElement("spacer_" + group, new SpacerElement());
        currentGroup = group;
      }
      addFormElement(userPropertyHandler.getName(), ui);
    }

    // role constraint
    addFormElement("space1", new SpacerElement(true, false));
    addFormElement("title.roles", new TitleElement("search.form.title.roles"));
    admin = new CheckBoxElement("search.form.constraint.admin");
    addFormElement("admin", admin);
    author = new CheckBoxElement("search.form.constraint.author");
    addFormElement("author", author);
    groupmanager = new CheckBoxElement("search.form.constraint.groupmanager");
    addFormElement("groupmanager", groupmanager);
    usermanager = new CheckBoxElement("search.form.constraint.usermanager");
    addFormElement("usermanager", usermanager);
    oresmanager = new CheckBoxElement("search.form.constraint.oresmanager");
    addFormElement("oresmanager", oresmanager);

    // authentication constraints
    addFormElement("space2", new SpacerElement(true, false));
    addFormElement("title.auth", new TitleElement("search.form.title.authentications"));
    // take all providers from the config file
    // convention is that a translation key "search.form.constraint.auth." +
    // providerName
    // must exist. the element is stored using the name "auth." + providerName
    Collection providers = LoginModule.getAuthenticationProviders();
    Iterator iter = providers.iterator();
    while (iter.hasNext()) {
      AuthenticationProvider provider = (AuthenticationProvider) iter.next();
      if (provider.isEnabled()) {
        String providerName = provider.getName();
        CheckBoxElement authElem = new CheckBoxElement("search.form.constraint.auth." + providerName);
        addFormElement("auth." + providerName, authElem);
      }
    }
    if(WebDAVManager.getInstance().isEnabled()) {
      CheckBoxElement authElem = new CheckBoxElement("search.form.constraint.auth." + WebDAVAuthManager.PROVIDER_WEBDAV);
      addFormElement("auth." + WebDAVAuthManager.PROVIDER_WEBDAV, authElem);
    }
   
    // add additional no authentication element
    noAuth = new CheckBoxElement("search.form.constraint.auth.none");
    addFormElement("noAuth", noAuth);
    // special case login denied
    addFormElement("status", createStatusSelectionElement());

    // creation date constraints
    addFormElement("space3", new SpacerElement(true, false));
    addFormElement("title.date", new TitleElement("search.form.title.date"));
    afterDate = new DateElement("search.form.afterDate", getLocale());
    addFormElement("afterDate", afterDate);
    beforeDate = new DateElement("search.form.beforeDate", getLocale());
    addFormElement("beforeDate", beforeDate);

View Full Code Here

  /**
   * PreferencesForm definition
   */
  public void init() {
    addFormElement("heading1", new TitleElement("form.please.enter.old"));
    addFormElement(PASSWORD_OLD, new PasswordElement("form.password.old", 20, 128));
    getPasswordElement(PASSWORD_OLD).setMandatory(true);
    addFormElement("spacer1", new SpacerElement(false, true));
    addFormElement("heading2", new TitleElement("form.please.enter.new"));
    addFormElement(PASSWORD_NEW1, new PasswordElement("form.password.new1", 20, 128));
    getPasswordElement(PASSWORD_NEW1).setMandatory(true);
    addFormElement(PASSWORD_NEW2, new PasswordElement("form.password.new2", 20, 128));
    getPasswordElement(PASSWORD_NEW2).setMandatory(true);
    addSubmitKey("save","save");
View Full Code Here

    String[] yesnoKeys = { "y", "n" };
    String[] yesnoValues = { translate("yes"), translate("no") };
   
    String configKeyType = (String)modConfig.get(IQEditController.CONFIG_KEY_TYPE);
   
    TitleElement testTitle = new TitleElement("qti.form.test.title");   
    if(configKeyType != null && AssessmentInstance.QMD_ENTRY_TYPE_SURVEY.equals(configKeyType)) {
      testTitle = new TitleElement("qti.form.questionnaire.title");
    } else if(configKeyType != null && AssessmentInstance.QMD_ENTRY_TYPE_SELF.equals(configKeyType)) {
      testTitle = new TitleElement("qti.form.selftest.title");
    }
    addFormElement("testTitle", testTitle);
    // enable menu
    Boolean bEnableMenu = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_ENABLEMENU);
    boolean confEnableMenu = (bEnableMenu != null) ? bEnableMenu.booleanValue() : true;
    enableMenu = new RadioButtonGroupElement(false, "qti.form.menuenable", yesnoKeys, yesnoValues);
    enableMenu.select(confEnableMenu ? "y" : "n", true);
    addFormElement("qti_enableMenu", enableMenu);

    // display menu
    Boolean bDisplayMenu = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_DISPLAYMENU);
    boolean confDisplayMenu = (bDisplayMenu != null) ? bDisplayMenu.booleanValue() : true;
    displayMenu = new RadioButtonGroupElement(false, "qti.form.menudisplay", yesnoKeys, yesnoValues);
    displayMenu.select(confDisplayMenu ? "y" : "n", true);
    addFormElement("qti_displayMenu", displayMenu);

    // render menu options depend on disabled menu link!
    String[] menuRenderOptKeys = new String[] {Boolean.FALSE.toString(), Boolean.TRUE.toString()};
    String[] menuRenderOptValues = new String[] {
        translate("qti.form.menurender.allquestions"),
        translate("qti.form.menurender.sectionsonly")
        };
    menuRenderOptions = new StaticSingleSelectionElement("qti.form.menurender",menuRenderOptKeys,menuRenderOptValues);
    Boolean renderSectionsOnly;
    if (modConfig.get(IQEditController.CONFIG_KEY_RENDERMENUOPTION) == null) {
      // migration
      modConfig.set(IQEditController.CONFIG_KEY_RENDERMENUOPTION, Boolean.FALSE);
      renderSectionsOnly = Boolean.FALSE;
    } else {
      renderSectionsOnly = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_RENDERMENUOPTION);
    }
    menuRenderOptions.select(renderSectionsOnly.toString(), true);
    addFormElement("qti_form_menurenderoption", menuRenderOptions);
   
    // sequence type
    String[] sequenceKeys = new String[] {AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM, AssessmentInstance.QMD_ENTRY_SEQUENCE_SECTION};
    String[] sequenceValues = new String[] {
        translate("qti.form.sequence.item"),
        translate("qti.form.sequence.section")};
    sequence = new StaticSingleSelectionElement("qti.form.sequence", sequenceKeys, sequenceValues);
    String confSequence = (String)modConfig.get(IQEditController.CONFIG_KEY_SEQUENCE);
    if (confSequence == null) confSequence = AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM;
    sequence.select(confSequence, true);
    addFormElement("qti_form_sequence", sequence);
       
    // question progress
    Boolean bEnableQuestionProgress = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_QUESTIONPROGRESS);
    boolean confEnableQuestionProgress = (bEnableQuestionProgress != null) ? bEnableQuestionProgress.booleanValue() : true;
    displayQuestionProgress = new RadioButtonGroupElement(false, "qti.form.questionprogress", yesnoKeys, yesnoValues);
    displayQuestionProgress.select(confEnableQuestionProgress ? "y" : "n", true);
    addFormElement("qti_enableQuestionProgress", displayQuestionProgress);

    VisibilityDependsOnSelectionRule displayMenuVisibilityRule = new VisibilityDependsOnSelectionRule(
        enableMenu, displayMenu, "n", true, "y", true);
    addVisibilityDependsOnSelectionRule(displayMenuVisibilityRule);
   
    VisibilityDependsOnSelectionRule displayMenuRenderOptionRule = new VisibilityDependsOnSelectionRule(
        enableMenu, menuRenderOptions, "y", true, Boolean.FALSE.toString(), true);
    addVisibilityDependsOnSelectionRule(displayMenuRenderOptionRule);
   
    VisibilityDependsOnSelectionRule displayQuestionVisibilityRule = new VisibilityDependsOnSelectionRule(
        enableMenu, displayQuestionProgress, "n", true, "n", true);
    addVisibilityDependsOnSelectionRule(displayQuestionVisibilityRule);
   
    // question title
    Boolean bDisplayQuestionTitle = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_QUESTIONTITLE);
    boolean confDisplayQuestionTitle = (bDisplayQuestionTitle != null) ? bDisplayQuestionTitle.booleanValue() : true;
    displayQuestionTitle = new RadioButtonGroupElement(false, "qti.form.questiontitle", yesnoKeys, yesnoValues);
    displayQuestionTitle.select(confDisplayQuestionTitle ? "y" : "n", true);
    addFormElement("qti_displayQuestionTitle", displayQuestionTitle);   
       
    // enable cancel
    Boolean bEnableCancel = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_ENABLECANCEL);
    boolean confEnableCancel = true;
    if (bEnableCancel != null) {
      // if defined use config value
      confEnableCancel = bEnableCancel.booleanValue();
    } else {
      // undefined... migrate according to old behaviour
      if (configKeyType != null && configKeyType.equals(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS))
        confEnableCancel = false;
    }
    enableCancel = new RadioButtonGroupElement(false, "qti.form.enablecancel", yesnoKeys, yesnoValues);
    enableCancel.select(confEnableCancel ? "y" : "n", true);
    addFormElement("qti_enableCancel", enableCancel);

    // enable suspend
    Boolean bEnableSuspend = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_ENABLESUSPEND);
    boolean confEnableSuspend = (bEnableSuspend != null) ? bEnableSuspend.booleanValue() : false;
    enableSuspend = new RadioButtonGroupElement(false, "qti.form.enablesuspend", yesnoKeys, yesnoValues);
    enableSuspend.select(confEnableSuspend ? "y" : "n", true);
    addFormElement("qti_enableSuspend", enableSuspend);
   
    // Only tests have a limitation on number of attempts
    if (configKeyType != null && configKeyType.equals(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS) ) {
      String[] attemptsKeys = new String[21];
        attemptsKeys[0] = "0"; // position 0 means no restriction
        for (int i = 1; i < 21; i++) {
                attemptsKeys[i] = (String.valueOf(i));
            }
      String[] attemptsValues = new String[21];
      attemptsValues[0] = translate("qti.form.attempts.noLimit");
        for (int i = 1; i < 21; i++) {
                attemptsValues[i] = (String.valueOf(i) + " x");
            }
      attempts = new StaticSingleSelectionElement("qti.form.attempts", attemptsKeys, attemptsValues);
      Integer confAttempts = (Integer) modConfig.get(IQEditController.CONFIG_KEY_ATTEMPTS);
      if (confAttempts == null) confAttempts = new Integer(0);
      attempts.select(confAttempts.toString(), true);
      addFormElement("qti_form_attempts", attempts);
    }
           
    // score progress
    if (configKeyType != null && !configKeyType.equals(AssessmentInstance.QMD_ENTRY_TYPE_SURVEY)) {
      //results options section
      TitleElement resultTitle = new TitleElement("qti.form.result.title");
      addFormElement("resultTitle", resultTitle);
     
      Boolean bEnableScoreProgress = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_SCOREPROGRESS);
      boolean confEnableScoreProgress = (bEnableScoreProgress != null) ? bEnableScoreProgress.booleanValue() : true;
      displayScoreProgress = new RadioButtonGroupElement(false, "qti.form.scoreprogress", yesnoKeys, yesnoValues);
View Full Code Here

    if (mapWithConfigs.get(QTIExportFIBItemFormatConfig.class) != null) this.hasFIB = true;
    if (mapWithConfigs.get(QTIExportEssayItemFormatConfig.class) != null) this.hasEssay = true;
   
    // Single Choice
    if(hasSCQ){
      scqTitleEl = new TitleElement("form.scqtitle");
      addFormElement(SCQ_TITLE, scqTitleEl);
     
      scqItemCols = new CheckBoxElement("form.itemcols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportSCQItemFormatConfig.class)).hasResponseCols());
      scqPosCol = new CheckBoxElement("form.poscol", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportSCQItemFormatConfig.class)).hasPositionsOfResponsesCol());
      scqPointCol = new CheckBoxElement("form.pointcol", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportSCQItemFormatConfig.class)).hasPointCol());
      scqTimeCols = new CheckBoxElement("form.timecols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportSCQItemFormatConfig.class)).hasTimeCols());
     
      addFormElement(SCQ_ITEMCOLS, scqItemCols);
      addFormElement(SCQ_POSCOL, scqPosCol);
      addFormElement(SCQ_POINTCOL, scqPointCol);
      addFormElement(SCQ_TIMECOLS, scqTimeCols);
    }
    // Multiple Choice
    if(hasMCQ){
      mcqTitleEl = new TitleElement("form.mcqtitle");
      addFormElement(MCQ_TITLE, mcqTitleEl);
     
      mcqItemCols = new CheckBoxElement("form.itemcols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportMCQItemFormatConfig.class)).hasResponseCols());
      mcqPosCol = new CheckBoxElement("form.poscol", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportMCQItemFormatConfig.class)).hasPositionsOfResponsesCol());
      mcqPointCol = new CheckBoxElement("form.pointcol", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportMCQItemFormatConfig.class)).hasPointCol());
      mcqTimeCols = new CheckBoxElement("form.timecols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportMCQItemFormatConfig.class)).hasTimeCols());
     
      addFormElement(MCQ_ITEMCOLS, mcqItemCols);
      addFormElement(MCQ_POSCOL, mcqPosCol);
      addFormElement(MCQ_POINTCOL, mcqPointCol);
      addFormElement(MCQ_TIMECOLS, mcqTimeCols);
    }
    // KPRIM
    if(hasKRIM){
      kprimTitleEl = new TitleElement("form.kprimtitle");
      addFormElement(KPRIM_TITLE, kprimTitleEl);
     
      kprimItemCols = new CheckBoxElement("form.itemcols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportKPRIMItemFormatConfig.class)).hasResponseCols());
      kprimPosCol = new CheckBoxElement("form.poscol", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportKPRIMItemFormatConfig.class)).hasPositionsOfResponsesCol());
      kprimPointCol = new CheckBoxElement("form.pointcol", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportKPRIMItemFormatConfig.class)).hasPointCol());
      kprimTimeCols = new CheckBoxElement("form.timecols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportKPRIMItemFormatConfig.class)).hasTimeCols());
     
      addFormElement(KPRIM_ITEMCOLS, kprimItemCols);
      addFormElement(KPRIM_POSCOL, kprimPosCol);
      addFormElement(KPRIM_POINTCOL, kprimPointCol);
      addFormElement(KPRIM_TIMECOLS, kprimTimeCols);
    }
    // Fill in the Blank
    if(hasFIB){
      fibTitleEl = new TitleElement("form.fibtitle");
      addFormElement(FIB_TITLE, fibTitleEl);
     
      fibItemCols = new CheckBoxElement("form.itemcols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportFIBItemFormatConfig.class)).hasResponseCols());
      fibPointCol = new CheckBoxElement("form.pointcol", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportFIBItemFormatConfig.class)).hasPointCol());
      fibTimeCols = new CheckBoxElement("form.timecols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportFIBItemFormatConfig.class)).hasTimeCols());
     
      addFormElement(FIB_ITEMCOLS, fibItemCols);
      addFormElement(FIB_POINTCOL, fibPointCol);
      addFormElement(FIB_TIMECOLS, fibTimeCols);
    }
    // Essay
    if(hasEssay){
      essayTitleEl = new TitleElement("form.essaytitle");
      addFormElement(ESSAY_TITLE, essayTitleEl);
     
      essayItemCols = new CheckBoxElement("form.itemcols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportEssayItemFormatConfig.class)).hasResponseCols());
      essayTimeCols = new CheckBoxElement("form.timecols", ((QTIExportItemFormatConfig) mapWithConfigs.get(QTIExportEssayItemFormatConfig.class)).hasTimeCols());
     
View Full Code Here

TOP

Related Classes of org.olat.core.gui.formelements.TitleElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.