use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent 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.form.flexible.impl.elements.table.FlexiTableSearchEvent in project openolat by klemens.
the class TaxonomyTreeTableController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (newLevelButton == source) {
doNewLevel(ureq);
} else if (deleteButton == source) {
doConfirmMultiDelete(ureq);
} else if (mergeButton == source) {
doMerge(ureq);
} else if (typeButton == source) {
doAssignType(ureq);
} else if (moveButton == source) {
doMove(ureq);
} else if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
if ("select".equals(cmd)) {
TaxonomyLevelRow row = model.getObject(se.getIndex());
doSelectTaxonomyLevel(ureq, row);
}
} else if (event instanceof FlexiTableSearchEvent) {
loadModel(true, true);
}
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("tools".equals(cmd)) {
TaxonomyLevelRow row = (TaxonomyLevelRow) link.getUserObject();
doOpenTools(ureq, row, link);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent in project openolat by klemens.
the class PaypalTransactionsController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == backLink) {
if (detailsController != null) {
flc.remove(detailsController.getInitialComponent());
removeAsListenerAndDispose(detailsController);
}
addSearchToHistory(ureq);
} else if (source == tableEl) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
PaypalTransaction row = dataModel.getObject(se.getIndex());
if (CMD_SELECT.equals(se.getCommand())) {
doSelectTransaction(ureq, row);
}
} else if (event instanceof FlexiTableSearchEvent) {
FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
doSearch(ureq, se.getSearch());
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent in project openolat by klemens.
the class AbstractBusinessGroupListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (createButton == source) {
doCreate(ureq, getWindowControl(), null);
} else if (deleteButton == source) {
confirmDelete(ureq, getSelectedItems());
} else if (duplicateButton == source) {
doCopy(ureq, getSelectedItems());
} else if (configButton == source) {
doConfiguration(ureq, getSelectedItems());
} else if (emailButton == source) {
doEmails(ureq, getSelectedItems());
} else if (usersButton == source) {
doUserManagement(ureq, getSelectedItems());
} else if (mergeButton == source) {
doMerge(ureq, getSelectedItems());
} else if (selectButton == source) {
doSelect(ureq, getSelectedItems());
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("mark".equals(cmd)) {
BusinessGroupRow row = (BusinessGroupRow) link.getUserObject();
boolean marked = toogleMark(row);
link.setIconLeftCSS(marked ? "o_icon o_icon_bookmark o_icon-lg" : "o_icon o_icon_bookmark_add o_icon-lg");
link.getComponent().setDirty(true);
} else if ("allresources".equals(cmd)) {
BusinessGroupShort bg = (BusinessGroupShort) link.getUserObject();
NewControllerFactory.getInstance().launch("[BusinessGroup:" + bg.getKey() + "][toolresources:0]", ureq, getWindowControl());
} else if ("resource".equals(cmd)) {
RepositoryEntryShort re = (RepositoryEntryShort) link.getUserObject();
NewControllerFactory.getInstance().launch("[RepositoryEntry:" + re.getKey() + "]", ureq, getWindowControl());
} else if (link.getUserObject() instanceof BusinessGroupRef) {
BusinessGroupRef item = (BusinessGroupRef) link.getUserObject();
Long businessGroupKey = item.getKey();
BusinessGroup businessGroup = businessGroupService.loadBusinessGroup(businessGroupKey);
if (businessGroup == null) {
groupTableModel.removeBusinessGroup(businessGroupKey);
tableEl.reset();
} else if (TABLE_ACTION_ACCESS.equals(cmd)) {
doAccess(ureq, businessGroup);
} else if (TABLE_ACTION_LEAVE.equals(cmd)) {
doConfirmLeaving(ureq, businessGroup);
}
}
} else if (source == tableEl) {
String cmd = event.getCommand();
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
if (se.getIndex() >= 0 && se.getIndex() < groupTableModel.getRowCount()) {
BusinessGroupRef item = groupTableModel.getObject(se.getIndex());
Long businessGroupKey = item.getKey();
BusinessGroup businessGroup = businessGroupService.loadBusinessGroup(businessGroupKey);
// prevent rs after a group is deleted by someone else
if (businessGroup == null) {
groupTableModel.removeBusinessGroup(businessGroupKey);
tableEl.reset();
} else if (TABLE_ACTION_LAUNCH.equals(cmd)) {
doLaunch(ureq, businessGroup);
} else if (TABLE_ACTION_DELETE.equals(cmd)) {
confirmDelete(ureq, Collections.singletonList(item));
} else if (TABLE_ACTION_LAUNCH.equals(cmd)) {
doLaunch(ureq, businessGroup);
} else if (TABLE_ACTION_EDIT.equals(cmd)) {
doEdit(ureq, businessGroup);
} else if (TABLE_ACTION_LEAVE.equals(cmd)) {
doConfirmLeaving(ureq, businessGroup);
} else if (TABLE_ACTION_ACCESS.equals(cmd)) {
doAccess(ureq, businessGroup);
} else if (TABLE_ACTION_SELECT.equals(cmd)) {
doSelect(ureq, businessGroup);
}
}
} else if (event instanceof FlexiTableSearchEvent) {
doSearch((FlexiTableSearchEvent) event);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent in project openolat by klemens.
the class AssessedIdentityListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
AssessedIdentityElementRow row = usersTableModel.getObject(se.getIndex());
if ("select".equals(cmd)) {
doSelect(ureq, row);
}
} else if (event instanceof FlexiTableSearchEvent) {
FlexiTableSearchEvent ftse = (FlexiTableSearchEvent) event;
updateModel(ftse.getSearch(), ftse.getFilters(), ftse.getExtendedFilters());
}
}
super.formInnerEvent(ureq, source, event);
}
Aggregations