use of org.olat.core.gui.components.rating.RatingFormEvent in project OpenOLAT by OpenOLAT.
the class RepositoryEntryListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source instanceof RatingWithAverageFormItem && event instanceof RatingFormEvent) {
RatingFormEvent ratingEvent = (RatingFormEvent) event;
RatingWithAverageFormItem ratingItem = (RatingWithAverageFormItem) source;
RepositoryEntryRow row = (RepositoryEntryRow) ratingItem.getUserObject();
doRating(row, ratingEvent.getRating());
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("mark".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
boolean marked = doMark(ureq, row);
link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg");
link.setTitle(translate(marked ? "details.bookmark.remove" : "details.bookmark"));
link.getComponent().setDirty(true);
row.setMarked(marked);
} else if ("start".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
doOpen(ureq, row, null);
} else if ("details".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
doOpenDetails(ureq, row);
} else if ("select".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
if (row.isMember()) {
doOpen(ureq, row, null);
} else {
doOpenDetails(ureq, row);
}
} else if ("comments".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
doOpenComments(ureq, row);
}
} else if (source == tableEl) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
RepositoryEntryRow row = model.getObject(se.getIndex());
if ("select".equals(cmd)) {
if (row.isMember()) {
doOpen(ureq, row, null);
} else {
doOpenDetails(ureq, row);
}
}
} else if (event instanceof FlexiTableSearchEvent) {
RepositoryEntryListState state = new RepositoryEntryListState();
state.setTableState(tableEl.getStateEntry());
addToHistory(ureq, state);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.rating.RatingFormEvent in project openolat by klemens.
the class RepositoryEntryDetailsController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("category".equals(cmd)) {
Long categoryKey = (Long) link.getUserObject();
doOpenCategory(ureq, categoryKey);
} else if ("mark".equals(cmd)) {
boolean marked = doMark();
markLink.setI18nKey(marked ? "details.bookmark.remove" : "details.bookmark");
markLink.setIconLeftCSS(marked ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE);
} else if ("comments".equals(cmd)) {
doOpenComments(ureq);
} else if ("start".equals(cmd)) {
doStart(ureq);
} else if ("group".equals(cmd)) {
Long groupKey = (Long) link.getUserObject();
doOpenGroup(ureq, groupKey);
} else if ("owner".equals(cmd)) {
Long ownerKey = (Long) link.getUserObject();
doOpenVisitCard(ureq, ownerKey);
} else if ("leave".equals(cmd)) {
doConfirmLeave(ureq);
} else if ("ref".equals(cmd)) {
doOpenReference(ureq, (Long) link.getUserObject());
}
} else if (ratingEl == source && event instanceof RatingFormEvent) {
RatingFormEvent ratingEvent = (RatingFormEvent) event;
doRating(ratingEvent.getRating());
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.rating.RatingFormEvent in project openolat by klemens.
the class RepositoryEntryListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source instanceof RatingWithAverageFormItem && event instanceof RatingFormEvent) {
RatingFormEvent ratingEvent = (RatingFormEvent) event;
RatingWithAverageFormItem ratingItem = (RatingWithAverageFormItem) source;
RepositoryEntryRow row = (RepositoryEntryRow) ratingItem.getUserObject();
doRating(row, ratingEvent.getRating());
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("mark".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
boolean marked = doMark(ureq, row);
link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg");
link.setTitle(translate(marked ? "details.bookmark.remove" : "details.bookmark"));
link.getComponent().setDirty(true);
row.setMarked(marked);
} else if ("start".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
doOpen(ureq, row, null);
} else if ("details".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
doOpenDetails(ureq, row);
} else if ("select".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
if (row.isMember()) {
doOpen(ureq, row, null);
} else {
doOpenDetails(ureq, row);
}
} else if ("comments".equals(cmd)) {
RepositoryEntryRow row = (RepositoryEntryRow) link.getUserObject();
doOpenComments(ureq, row);
}
} else if (source == tableEl) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
RepositoryEntryRow row = model.getObject(se.getIndex());
if ("select".equals(cmd)) {
if (row.isMember()) {
doOpen(ureq, row, null);
} else {
doOpenDetails(ureq, row);
}
}
} else if (event instanceof FlexiTableSearchEvent) {
RepositoryEntryListState state = new RepositoryEntryListState();
state.setTableState(tableEl.getStateEntry());
addToHistory(ureq, state);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.rating.RatingFormEvent in project OpenOLAT by OpenOLAT.
the class RepositoryEntryDetailsController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("category".equals(cmd)) {
Long categoryKey = (Long) link.getUserObject();
doOpenCategory(ureq, categoryKey);
} else if ("mark".equals(cmd)) {
boolean marked = doMark();
markLink.setI18nKey(marked ? "details.bookmark.remove" : "details.bookmark");
markLink.setIconLeftCSS(marked ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE);
} else if ("comments".equals(cmd)) {
doOpenComments(ureq);
} else if ("start".equals(cmd)) {
doStart(ureq);
} else if ("group".equals(cmd)) {
Long groupKey = (Long) link.getUserObject();
doOpenGroup(ureq, groupKey);
} else if ("owner".equals(cmd)) {
Long ownerKey = (Long) link.getUserObject();
doOpenVisitCard(ureq, ownerKey);
} else if ("leave".equals(cmd)) {
doConfirmLeave(ureq);
} else if ("ref".equals(cmd)) {
doOpenReference(ureq, (Long) link.getUserObject());
}
} else if (ratingEl == source && event instanceof RatingFormEvent) {
RatingFormEvent ratingEvent = (RatingFormEvent) event;
doRating(ratingEvent.getRating());
}
super.formInnerEvent(ureq, source, event);
}
Aggregations