Search in sources :

Example 1 with Dropdown

use of org.olat.core.gui.components.dropdown.Dropdown in project OpenOLAT by OpenOLAT.

the class BinderPageListController method initTools.

@Override
public void initTools() {
    if (secCallback.canExportBinder()) {
        Dropdown exportTools = new Dropdown("export.binder", "export.binder", false, getTranslator());
        exportTools.setElementCssClass("o_sel_pf_export_tools");
        exportTools.setIconCSS("o_icon o_icon_download");
        stackPanel.addTool(exportTools, Align.left);
        exportBinderAsCpLink = LinkFactory.createToolLink("export.binder.cp", translate("export.binder.cp"), this);
        exportBinderAsCpLink.setIconLeftCSS("o_icon o_icon_download");
        exportTools.addComponent(exportBinderAsCpLink);
        printLink = LinkFactory.createToolLink("export.binder.onepage", translate("export.binder.onepage"), this);
        printLink.setIconLeftCSS("o_icon o_icon_print");
        printLink.setPopup(new LinkPopupSettings(950, 750, "binder"));
        exportTools.addComponent(printLink);
    }
    if (secCallback.canAddSection()) {
        newSectionLink = LinkFactory.createToolLink("new.section", translate("create.new.section"), this);
        newSectionLink.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
        newSectionLink.setElementCssClass("o_sel_pf_new_section");
        stackPanel.addTool(newSectionLink, Align.right);
    }
    if (secCallback.canAddPage(null)) {
        newEntryLink = LinkFactory.createToolLink("new.page", translate("create.new.page"), this);
        newEntryLink.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
        newEntryLink.setElementCssClass("o_sel_pf_new_entry");
        newEntryLink.setVisible(model.getRowCount() > 0);
        stackPanel.addTool(newEntryLink, Align.right);
    }
    if (secCallback.canNewAssignment()) {
        newAssignmentLink = LinkFactory.createToolLink("new.assignment", translate("create.new.assignment"), this);
        newAssignmentLink.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
        newAssignmentLink.setElementCssClass("o_sel_pf_new_assignment");
        newAssignmentLink.setVisible(model.getRowCount() > 0);
        stackPanel.addTool(newAssignmentLink, Align.right);
    }
}
Also used : LinkPopupSettings(org.olat.core.gui.components.link.LinkPopupSettings) Dropdown(org.olat.core.gui.components.dropdown.Dropdown)

Example 2 with Dropdown

use of org.olat.core.gui.components.dropdown.Dropdown in project OpenOLAT by OpenOLAT.

the class PublishController method initTools.

@Override
public void initTools() {
    if (secCallback.canEditAccessRights(binder)) {
        accessDropdown = new Dropdown("access.rights", "access.rights", false, getTranslator());
        accessDropdown.setIconCSS("o_icon o_icon-fw o_icon_new_portfolio");
        accessDropdown.setElementCssClass("o_sel_pf_access");
        accessDropdown.setOrientation(DropdownOrientation.right);
        addAccessRightsLink = LinkFactory.createToolLink("add.member", translate("add.member"), this);
        addAccessRightsLink.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
        addAccessRightsLink.setElementCssClass("o_sel_pf_access_member");
        accessDropdown.addComponent(addAccessRightsLink);
        if (loginModule.isInvitationEnabled()) {
            addInvitationLink = LinkFactory.createToolLink("add.invitation", translate("add.invitation"), this);
            addInvitationLink.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
            addInvitationLink.setElementCssClass("o_sel_pf_access_invitation");
            accessDropdown.addComponent(addInvitationLink);
        }
        stackPanel.addTool(accessDropdown, Align.right);
    }
}
Also used : Dropdown(org.olat.core.gui.components.dropdown.Dropdown)

Example 3 with Dropdown

use of org.olat.core.gui.components.dropdown.Dropdown in project OpenOLAT by OpenOLAT.

the class QuestionItemDetailsController method buildStatusDrowdown.

private Dropdown buildStatusDrowdown() {
    QuestionStatus actualStatus = metadatasCtrl.getItem().getQuestionStatus();
    Dropdown statusDropdown = new Dropdown("process.states", "lifecycle.status." + actualStatus.name(), false, getTranslator());
    statusDropdown.setElementCssClass("o_qpool_tools_status o_qpool_status_" + actualStatus.name());
    statusDropdown.setIconCSS("o_icon o_icon-fw o_icon_qitem_" + actualStatus.name());
    statusDropdown.setOrientation(DropdownOrientation.normal);
    statusDraftLink = LinkFactory.createToolLink("lifecycle.status.draft", translate("lifecycle.status.draft"), this);
    statusDraftLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_draft");
    statusDraftLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_draft");
    statusDraftLink.setVisible(qItemSecurityCallback.canSetDraft() && !QuestionStatus.draft.equals(actualStatus));
    statusDropdown.addComponent(statusDraftLink);
    statusRevisedLink = LinkFactory.createToolLink("lifecycle.status.revised", translate("lifecycle.status.revised"), this);
    statusRevisedLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_revised");
    statusRevisedLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_revised");
    statusRevisedLink.setVisible(qItemSecurityCallback.canSetRevised() && !QuestionStatus.revised.equals(actualStatus));
    statusDropdown.addComponent(statusRevisedLink);
    statusReviewLink = LinkFactory.createToolLink("lifecycle.status.review", translate("lifecycle.status.review"), this);
    statusReviewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_review");
    statusReviewLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_review");
    statusReviewLink.setVisible(qItemSecurityCallback.canSetReview() && !QuestionStatus.review.equals(actualStatus));
    statusDropdown.addComponent(statusReviewLink);
    statusFinalLink = LinkFactory.createToolLink("lifecycle.status.finalVersion", translate("lifecycle.status.finalVersion"), this);
    statusFinalLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_finalVersion");
    statusFinalLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_finalVersion");
    statusFinalLink.setVisible(qItemSecurityCallback.canSetFinal() && !QuestionStatus.finalVersion.equals(actualStatus));
    statusDropdown.addComponent(statusFinalLink);
    statusEndOfLifeLink = LinkFactory.createToolLink("lifecycle.status.endOfLife", translate("lifecycle.status.endOfLife"), this);
    statusEndOfLifeLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_endOfLife");
    statusEndOfLifeLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_endOfLife");
    statusEndOfLifeLink.setVisible(qItemSecurityCallback.canSetEndOfLife() && !QuestionStatus.endOfLife.equals(actualStatus));
    statusDropdown.addComponent(statusEndOfLifeLink);
    return statusDropdown;
}
Also used : QuestionStatus(org.olat.modules.qpool.QuestionStatus) Dropdown(org.olat.core.gui.components.dropdown.Dropdown)

Example 4 with Dropdown

use of org.olat.core.gui.components.dropdown.Dropdown in project OpenOLAT by OpenOLAT.

the class QuestionItemDetailsController method initShareTools.

private void initShareTools() {
    Dropdown sharesDropdown = new Dropdown("share.item", "share.item", false, getTranslator());
    sharesDropdown.setIconCSS("o_icon o_icon-fw o_icon_qitem_share");
    sharesDropdown.setOrientation(DropdownOrientation.normal);
    stackPanel.addTool(sharesDropdown, Align.left);
    exportItemLink = LinkFactory.createToolLink("export.item", translate("export.item"), this);
    exportItemLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_export");
    sharesDropdown.addComponent(exportItemLink);
    if (qPoolSecurityCallback.canUsePools()) {
        sharePoolItemLink = LinkFactory.createToolLink("share.pool", translate("share.pool"), this);
        sharePoolItemLink.setIconLeftCSS("o_icon o_icon-fw o_icon_pool_pool");
        sharesDropdown.addComponent(sharePoolItemLink);
    }
    if (qPoolSecurityCallback.canUseGroups()) {
        shareGroupItemLink = LinkFactory.createToolLink("share.group", translate("share.group"), this);
        shareGroupItemLink.setIconLeftCSS("o_icon o_icon-fw o_icon_pool_share");
        sharesDropdown.addComponent(shareGroupItemLink);
    }
}
Also used : Dropdown(org.olat.core.gui.components.dropdown.Dropdown)

Example 5 with Dropdown

use of org.olat.core.gui.components.dropdown.Dropdown in project OpenOLAT by OpenOLAT.

the class QuestionItemDetailsController method initCommandTools.

private void initCommandTools() {
    Dropdown commandDropdown = new Dropdown("commands", "commands", false, getTranslator());
    commandDropdown.setIconCSS("o_icon o_icon-fw o_icon_qitem_commands");
    commandDropdown.setOrientation(DropdownOrientation.normal);
    stackPanel.addTool(commandDropdown, Align.left);
    copyItemLink = LinkFactory.createToolLink("copy", translate("copy"), this);
    copyItemLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_copy");
    commandDropdown.addComponent(copyItemLink);
    if (QTIConstants.QTI_12_FORMAT.equals(metadatasCtrl.getItem().getFormat())) {
        convertItemLink = LinkFactory.createToolLink("convert", translate("convert.item"), this);
        convertItemLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_convert");
        commandDropdown.addComponent(convertItemLink);
    }
    if (qItemSecurityCallback.canDelete()) {
        deleteLink = LinkFactory.createToolLink("delete.item", translate("delete.item"), this);
        deleteLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_delete");
        commandDropdown.addComponent(deleteLink);
    }
}
Also used : Dropdown(org.olat.core.gui.components.dropdown.Dropdown)

Aggregations

Dropdown (org.olat.core.gui.components.dropdown.Dropdown)28 LinkPopupSettings (org.olat.core.gui.components.link.LinkPopupSettings)10 Spacer (org.olat.core.gui.components.dropdown.Dropdown.Spacer)6 Link (org.olat.core.gui.components.link.Link)6 CourseConfig (org.olat.course.config.CourseConfig)4 ArrayList (java.util.ArrayList)2 Component (org.olat.core.gui.components.Component)2 Tool (org.olat.core.gui.components.stack.TooledStackedPanel.Tool)2 BusinessGroup (org.olat.group.BusinessGroup)2 Assignment (org.olat.modules.portfolio.Assignment)2 QuestionStatus (org.olat.modules.qpool.QuestionStatus)2 RepositoryHandler (org.olat.repository.handlers.RepositoryHandler)2 OrderedRepositoryHandler (org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler)2