コード例 #1
0
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {

    addSolutionLink = uifactory.addFormLink("add.solution", formLayout, Link.BUTTON);
    addSolutionLink.setElementCssClass("o_sel_course_gta_add_solution");
    addSolutionLink.setIconLeftCSS("o_icon o_icon_upload");
    createSolutionLink = uifactory.addFormLink("create.solution", formLayout, Link.BUTTON);
    createSolutionLink.setElementCssClass("o_sel_course_gta_create_solution");
    createSolutionLink.setIconLeftCSS("o_icon o_icon_edit");

    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(
        new DefaultFlexiColumnModel(SolCols.title.i18nKey(), SolCols.title.ordinal()));
    columnsModel.addFlexiColumnModel(
        new DefaultFlexiColumnModel(SolCols.file.i18nKey(), SolCols.file.ordinal()));
    columnsModel.addFlexiColumnModel(
        new DefaultFlexiColumnModel(SolCols.author.i18nKey(), SolCols.author.ordinal()));
    columnsModel.addFlexiColumnModel(
        new StaticFlexiColumnModel(
            "table.header.edit",
            SolCols.edit.ordinal(),
            "edit",
            new BooleanCellRenderer(
                new StaticFlexiCellRenderer(translate("edit"), "edit"),
                new StaticFlexiCellRenderer(translate("replace"), "edit"))));
    columnsModel.addFlexiColumnModel(
        new StaticFlexiColumnModel("table.header.edit", translate("delete"), "delete"));

    solutionModel = new SolutionTableModel(columnsModel);
    solutionTable =
        uifactory.addTableElement(
            getWindowControl(), "table", solutionModel, getTranslator(), formLayout);
    solutionTable.setExportEnabled(true);
    updateModel();
  }
コード例 #2
0
ファイル: ResumeController.java プロジェクト: ulkeba/openolat
  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    askagainCheckbox =
        uifactory.addCheckboxesHorizontal(
            "askagain",
            null,
            formLayout,
            askagain_keys,
            new String[] {translate("askagain.label")});

    // Button layout
    FormLayoutContainer buttonLayout =
        FormLayoutContainer.createButtonLayout("button_layout", getTranslator());
    formLayout.add(buttonLayout);
    okButton = uifactory.addFormSubmitButton("submit", "resume.button", buttonLayout);
    okButton.setElementCssClass("o_sel_resume_yes");
    landingButton =
        uifactory.addFormLink("landing", "resume.button.landing", null, buttonLayout, Link.BUTTON);
    landingButton.setElementCssClass("o_sel_resume_landing");
    noButton =
        uifactory.addFormLink("cancel", "resume.button.cancel", null, buttonLayout, Link.BUTTON);
    noButton.setElementCssClass("o_sel_resume_cancel");
  }