use of org.olat.core.gui.components.dropdown.Dropdown in project openolat by klemens.
the class TableOfContentController method initTools.
@Override
public void initTools() {
if (secCallback.canEditMetadataBinder()) {
editBinderMetadataLink = LinkFactory.createToolLink("edit.binder.metadata", translate("edit.binder.metadata"), this);
editBinderMetadataLink.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
stackPanel.addTool(editBinderMetadataLink, Align.left);
}
if (secCallback.canMoveToTrashBinder(binder)) {
moveToTrashBinderLink = LinkFactory.createToolLink("delete.binder", translate("delete.binder"), this);
moveToTrashBinderLink.setIconLeftCSS("o_icon o_icon-lg o_icon_delete_item");
stackPanel.addTool(moveToTrashBinderLink, Align.left);
}
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.canDeleteBinder(binder)) {
deleteBinderLink = LinkFactory.createToolLink("delete.binder", translate("delete.binder"), this);
deleteBinderLink.setIconLeftCSS("o_icon o_icon-lg o_icon_delete_item");
stackPanel.addTool(deleteBinderLink, Align.left);
restoreBinderLink = LinkFactory.createToolLink("restore.binder", translate("restore.binder"), this);
restoreBinderLink.setIconLeftCSS("o_icon o_icon-lg o_icon_restore");
stackPanel.addTool(restoreBinderLink, Align.left);
}
if (secCallback.canAddSection()) {
newSectionTool = LinkFactory.createToolLink("new.section", translate("create.new.section"), this);
newSectionTool.setIconLeftCSS("o_icon o_icon-lg o_icon_new_portfolio");
newSectionTool.setElementCssClass("o_sel_pf_new_section");
stackPanel.addTool(newSectionTool, 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(sectionList != null && sectionList.size() > 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(sectionList != null && sectionList.size() > 0);
stackPanel.addTool(newAssignmentLink, Align.right);
}
}
use of org.olat.core.gui.components.dropdown.Dropdown in project openolat by klemens.
the class CourseRuntimeController method initGeneralTools.
private void initGeneralTools(ICourse course) {
boolean assessmentLock = isAssessmentLock();
CourseConfig cc = course.getCourseConfig();
if (!assessmentLock && showInfos) {
detailsLink = LinkFactory.createToolLink("courseconfig", translate("command.courseconfig"), this, "o_icon_details");
toolbarPanel.addTool(detailsLink);
}
boolean calendarIsEnabled = !assessmentLock && !isGuestOnly && calendarModule.isEnabled() && calendarModule.isEnableCourseToolCalendar() && reSecurity.canLaunch();
if (calendarIsEnabled && getUserCourseEnvironment() != null) {
calendarLink = LinkFactory.createToolLink("calendar", translate("command.calendar"), this, "o_icon_calendar");
calendarLink.setPopup(new LinkPopupSettings(950, 750, "cal"));
calendarLink.setVisible(cc.isCalendarEnabled());
toolbarPanel.addTool(calendarLink);
}
if (!assessmentLock) {
glossary = new Dropdown("glossary", "command.glossary", false, getTranslator());
glossary.setIconCSS("o_icon o_FileResource-GLOSSARY_icon");
glossary.setVisible(cc.hasGlossary());
openGlossaryLink = LinkFactory.createToolLink("command.glossary.open", translate("command.glossary.open"), this);
openGlossaryLink.setPopup(new LinkPopupSettings(950, 750, "gloss"));
glossary.addComponent(openGlossaryLink);
enableGlossaryLink = LinkFactory.createToolLink("command.glossary.on.off", translate("command.glossary.on.alt"), this);
glossary.addComponent(enableGlossaryLink);
toolbarPanel.addTool(glossary);
}
if (!assessmentLock && isLecturesLinkEnabled()) {
lecturesLink = LinkFactory.createToolLink("command.lectures", translate("command.lectures"), this, "o_icon_lecture");
toolbarPanel.addTool(lecturesLink);
}
// add group chat to toolbox
boolean chatIsEnabled = !assessmentLock && !isGuestOnly && imModule.isEnabled() && imModule.isCourseEnabled() && reSecurity.canLaunch();
if (chatIsEnabled && getUserCourseEnvironment() != null && !getUserCourseEnvironment().isCourseReadOnly()) {
chatLink = LinkFactory.createToolLink("chat", translate("command.coursechat"), this, "o_icon_chat");
chatLink.setVisible(imModule.isCourseEnabled() && cc.isChatEnabled());
toolbarPanel.addTool(chatLink);
}
// add course search to toolbox
boolean isSearchEnabled = !assessmentLock && searchModule.isSearchAllowed(roles);
if (isSearchEnabled) {
searchLink = LinkFactory.createToolLink("coursesearch", translate("command.coursesearch"), this, "o_icon_search");
searchLink.setVisible(cc.isCourseSearchEnabled());
toolbarPanel.addTool(searchLink);
}
}
use of org.olat.core.gui.components.dropdown.Dropdown in project openolat by klemens.
the class QTIEditorMainController method populateToolC.
private void populateToolC() {
// tools
Dropdown exportTools = new Dropdown("exportTools", "tools.export.header", false, getTranslator());
exportTools.setIconCSS("o_icon o_icon_export");
stackedPanel.addTool(exportTools, Align.left);
exportTools.addComponent(previewLink);
exportPoolLink = LinkFactory.createToolLink(CMD_TOOLS_EXPORT_QPOOL, translate("tools.export.qpool"), this, "o_mi_qpool_export");
exportPoolLink.setIconLeftCSS("o_icon o_icon_download");
exportTools.addComponent(exportPoolLink);
exportDocLink = LinkFactory.createToolLink(CMD_TOOLS_EXPORT_DOCX, translate("tools.export.docx"), this, "o_mi_docx_export");
exportDocLink.setIconLeftCSS("o_icon o_icon_download");
exportTools.addComponent(exportDocLink);
convertQTI21Link = LinkFactory.createToolLink(CMD_TOOLS_CONVERT_TO_QTI21, translate("tools.convert.qti21"), this, "o_FileResource-IMSQTI21_icon");
convertQTI21Link.setIconLeftCSS("o_icon o_FileResource-IMSQTI21_icon");
exportTools.addComponent(convertQTI21Link);
// add
Dropdown addItemTools = new Dropdown("editTools", "tools.add.header", false, getTranslator());
addItemTools.setIconCSS("o_icon o_icon-fw o_icon_add");
stackedPanel.addTool(addItemTools, Align.left);
addSectionLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_SECTION, translate("tools.add.section"), this, "o_mi_qtisection");
addItemTools.addComponent(addSectionLink);
addSCLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_SINGLECHOICE, translate("tools.add.singlechoice"), this, "o_mi_qtisc");
addItemTools.addComponent(addSCLink);
addMCLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_MULTIPLECHOICE, translate("tools.add.multiplechoice"), this, "o_mi_qtimc");
addItemTools.addComponent(addMCLink);
if (!qtiPackage.getQTIDocument().isSurvey()) {
addKPrimLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_KPRIM, translate("tools.add.kprim"), this, "o_mi_qtikprim");
addItemTools.addComponent(addKPrimLink);
}
addFIBLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_FIB, translate("tools.add.cloze"), this, "o_mi_qtifib");
addItemTools.addComponent(addFIBLink);
addEssayLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_FREETEXT, translate("tools.add.freetext"), this, "o_mi_qtiessay");
addItemTools.addComponent(addEssayLink);
addItemTools.addComponent(new Spacer(""));
addPoolLink = LinkFactory.createToolLink(CMD_TOOLS_ADD_QPOOL, translate("tools.import.qpool"), this, "o_mi_qpool_import");
addItemTools.addComponent(addPoolLink);
importTableLink = LinkFactory.createToolLink(CMD_TOOLS_IMPORT_TABLE, translate("tools.import.table"), this, "o_mi_table_import");
importTableLink.setIconLeftCSS("o_icon o_icon_table o_icon-fw");
addItemTools.addComponent(importTableLink);
// delete / move / copy
Dropdown customizeTools = new Dropdown("customizeTools", "tools.change.header", false, getTranslator());
customizeTools.setIconCSS("o_icon o_icon_customize");
stackedPanel.addTool(customizeTools, Align.left);
deleteLink = LinkFactory.createToolLink(CMD_TOOLS_CHANGE_DELETE, translate("tools.change.delete"), this);
deleteLink.setIconLeftCSS("o_icon o_icon_delete_item");
customizeTools.addComponent(deleteLink);
moveLink = LinkFactory.createToolLink(CMD_TOOLS_CHANGE_MOVE, translate("tools.change.move"), this);
moveLink.setIconLeftCSS("o_icon o_icon_move");
customizeTools.addComponent(moveLink);
copyLink = LinkFactory.createToolLink(CMD_TOOLS_CHANGE_COPY, translate("tools.change.copy"), this);
copyLink.setIconLeftCSS("o_icon o_icon_copy");
customizeTools.addComponent(copyLink);
previewLink = LinkFactory.createToolLink(CMD_TOOLS_PREVIEW, translate("tools.tools.preview"), this);
previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview");
stackedPanel.addTool(previewLink, Align.right);
closeLink = LinkFactory.createToolLink(CMD_TOOLS_CLOSE_EDITOR, translate("tools.tools.closeeditor"), this, "o_toolbox_close");
closeLink.setIconLeftCSS("o_icon o_icon_publish");
stackedPanel.addTool(closeLink, Align.right);
}
Aggregations