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);
}
}
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;
}
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;
}
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);
}
}
Aggregations