Search in sources :

Example 1 with OrderedRepositoryHandler

use of org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler in project openolat by klemens.

the class AuthorListController method initTools.

protected void initTools() {
    if (!withSearch && hasAuthorRight) {
        importLink = LinkFactory.createLink("cmd.import.ressource", getTranslator(), this);
        importLink.setDomReplacementWrapperRequired(false);
        importLink.setIconLeftCSS("o_icon o_icon_import");
        importLink.setElementCssClass("o_sel_author_import");
        stackPanel.addTool(importLink, Align.left);
        List<OrderedRepositoryHandler> handlers = repositoryHandlerFactory.getOrderRepositoryHandlers();
        createDropdown = new Dropdown("cmd.create.ressource", "cmd.create.ressource", false, getTranslator());
        createDropdown.setElementCssClass("o_sel_author_create");
        createDropdown.setIconCSS("o_icon o_icon_add");
        int lastGroup = 0;
        for (OrderedRepositoryHandler orderedHandler : handlers) {
            RepositoryHandler handler = orderedHandler.getHandler();
            if (handler != null && handler.isCreate()) {
                // for each 10-group, create a separator
                int group = orderedHandler.getOrder() / 10;
                if (group > lastGroup) {
                    createDropdown.addComponent(new Spacer("spacer" + orderedHandler.getOrder()));
                    lastGroup = group;
                }
                addCreateLink(handler, createDropdown);
            }
        }
        stackPanel.addTool(createDropdown, Align.left);
    }
}
Also used : Spacer(org.olat.core.gui.components.dropdown.Dropdown.Spacer) Dropdown(org.olat.core.gui.components.dropdown.Dropdown) OrderedRepositoryHandler(org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler) RepositoryHandler(org.olat.repository.handlers.RepositoryHandler) OrderedRepositoryHandler(org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler)

Example 2 with OrderedRepositoryHandler

use of org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler in project openolat by klemens.

the class AuthorListController method getFilters.

private List<FlexiTableFilter> getFilters() {
    List<OrderedRepositoryHandler> supportedHandlers = repositoryHandlerFactory.getOrderRepositoryHandlers();
    List<FlexiTableFilter> resources = new ArrayList<>(supportedHandlers.size() + 1);
    int lastGroup = 0;
    for (OrderedRepositoryHandler handler : supportedHandlers) {
        // for each 10-group, crate a separator
        int group = handler.getOrder() / 10;
        if (group > lastGroup) {
            resources.add(FlexiTableFilter.SPACER);
            lastGroup = group;
        }
        String type = handler.getHandler().getSupportedType();
        String inconLeftCss = RepositoyUIFactory.getIconCssClass(type);
        resources.add(new FlexiTableFilter(translate(type), type, inconLeftCss));
    }
    return resources;
}
Also used : FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) ArrayList(java.util.ArrayList) OrderedRepositoryHandler(org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler)

Example 3 with OrderedRepositoryHandler

use of org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler in project OpenOLAT by OpenOLAT.

the class AuthorListController method getFilters.

private List<FlexiTableFilter> getFilters() {
    List<OrderedRepositoryHandler> supportedHandlers = repositoryHandlerFactory.getOrderRepositoryHandlers();
    List<FlexiTableFilter> resources = new ArrayList<>(supportedHandlers.size() + 1);
    int lastGroup = 0;
    for (OrderedRepositoryHandler handler : supportedHandlers) {
        // for each 10-group, crate a separator
        int group = handler.getOrder() / 10;
        if (group > lastGroup) {
            resources.add(FlexiTableFilter.SPACER);
            lastGroup = group;
        }
        String type = handler.getHandler().getSupportedType();
        String inconLeftCss = RepositoyUIFactory.getIconCssClass(type);
        resources.add(new FlexiTableFilter(translate(type), type, inconLeftCss));
    }
    return resources;
}
Also used : FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) ArrayList(java.util.ArrayList) OrderedRepositoryHandler(org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler)

Example 4 with OrderedRepositoryHandler

use of org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler in project OpenOLAT by OpenOLAT.

the class AuthorListController method initTools.

protected void initTools() {
    if (!withSearch && hasAuthorRight) {
        importLink = LinkFactory.createLink("cmd.import.ressource", getTranslator(), this);
        importLink.setDomReplacementWrapperRequired(false);
        importLink.setIconLeftCSS("o_icon o_icon_import");
        importLink.setElementCssClass("o_sel_author_import");
        stackPanel.addTool(importLink, Align.left);
        List<OrderedRepositoryHandler> handlers = repositoryHandlerFactory.getOrderRepositoryHandlers();
        createDropdown = new Dropdown("cmd.create.ressource", "cmd.create.ressource", false, getTranslator());
        createDropdown.setElementCssClass("o_sel_author_create");
        createDropdown.setIconCSS("o_icon o_icon_add");
        int lastGroup = 0;
        for (OrderedRepositoryHandler orderedHandler : handlers) {
            RepositoryHandler handler = orderedHandler.getHandler();
            if (handler != null && handler.isCreate()) {
                // for each 10-group, create a separator
                int group = orderedHandler.getOrder() / 10;
                if (group > lastGroup) {
                    createDropdown.addComponent(new Spacer("spacer" + orderedHandler.getOrder()));
                    lastGroup = group;
                }
                addCreateLink(handler, createDropdown);
            }
        }
        stackPanel.addTool(createDropdown, Align.left);
    }
}
Also used : Spacer(org.olat.core.gui.components.dropdown.Dropdown.Spacer) Dropdown(org.olat.core.gui.components.dropdown.Dropdown) OrderedRepositoryHandler(org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler) RepositoryHandler(org.olat.repository.handlers.RepositoryHandler) OrderedRepositoryHandler(org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler)

Aggregations

OrderedRepositoryHandler (org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler)4 ArrayList (java.util.ArrayList)2 Dropdown (org.olat.core.gui.components.dropdown.Dropdown)2 Spacer (org.olat.core.gui.components.dropdown.Dropdown.Spacer)2 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)2 RepositoryHandler (org.olat.repository.handlers.RepositoryHandler)2