use of org.olat.modules.portfolio.ui.model.MediaRow in project OpenOLAT by OpenOLAT.
the class MediaDataModel method filter.
@Override
public void filter(List<FlexiTableFilter> filters) {
String key = filters == null || filters.isEmpty() || filters.get(0) == null ? null : filters.get(0).getFilter();
if (StringHelper.containsNonWhitespace(key) && !"showall".equals(key)) {
List<MediaRow> filteredRows = new ArrayList<>();
for (MediaRow row : backups) {
if (key.equals(row.getType())) {
filteredRows.add(row);
}
}
super.setObjects(filteredRows);
} else {
super.setObjects(backups);
}
}
use of org.olat.modules.portfolio.ui.model.MediaRow in project OpenOLAT by OpenOLAT.
the class MediaCenterController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == tableEl) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
MediaRow row = model.getObject(se.getIndex());
if ("select".equals(cmd)) {
if (select) {
doSelect(ureq, row.getKey());
} else {
Activateable2 activateable = doOpenMedia(ureq, row.getKey());
if (activateable != null) {
activateable.activate(ureq, null, null);
}
}
}
} else if (event instanceof FlexiTableSearchEvent) {
loadModel();
}
} else if (newMediaCallout == source) {
doOpenNewMediaCallout(ureq, newMediaCallout);
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("select".equals(cmd)) {
MediaRow row = (MediaRow) link.getUserObject();
if (select) {
doSelect(ureq, row.getKey());
} else {
Activateable2 activateable = doOpenMedia(ureq, row.getKey());
if (activateable != null) {
activateable.activate(ureq, null, null);
}
}
} else if ("tag".equals(cmd)) {
doToggleCategory(link);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.portfolio.ui.model.MediaRow in project OpenOLAT by OpenOLAT.
the class MediaTypeCellRenderer method render.
@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator translator) {
if (cellValue instanceof MediaRow) {
MediaRow mRow = (MediaRow) cellValue;
MediaHandler handler = handlersMap.get(mRow.getType());
if (handler != null) {
target.append("<i class='o_icon o_icon-lg ").append(handler.getIconCssClass(mRow)).append("'> </i>");
}
}
}
use of org.olat.modules.portfolio.ui.model.MediaRow in project openolat by klemens.
the class MediaCenterController method getComponents.
@Override
public Iterable<Component> getComponents(int row, Object rowObject) {
MediaRow mediaRow = model.getObject(row);
List<Component> components = new ArrayList<>(2);
if (mediaRow.getOpenFormItem() != null) {
components.add(mediaRow.getOpenFormItem().getComponent());
}
return components;
}
use of org.olat.modules.portfolio.ui.model.MediaRow in project openolat by klemens.
the class MediaDataModel method filter.
@Override
public void filter(List<FlexiTableFilter> filters) {
String key = filters == null || filters.isEmpty() || filters.get(0) == null ? null : filters.get(0).getFilter();
if (StringHelper.containsNonWhitespace(key) && !"showall".equals(key)) {
List<MediaRow> filteredRows = new ArrayList<>();
for (MediaRow row : backups) {
if (key.equals(row.getType())) {
filteredRows.add(row);
}
}
super.setObjects(filteredRows);
} else {
super.setObjects(backups);
}
}
Aggregations