use of org.olat.core.gui.components.table.TableEvent in project OpenOLAT by OpenOLAT.
the class OpenMeetingsAdminRoomsController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == tableCtr) {
if (event instanceof TableEvent) {
TableEvent e = (TableEvent) event;
int row = e.getRowId();
OpenMeetingsRoom room = (OpenMeetingsRoom) tableCtr.getTableDataModel().getObject(row);
if ("delete".equals(e.getActionId())) {
confirmDelete(ureq, room);
} else if ("infos".equals(e.getActionId())) {
openInfoBox(ureq, room);
} else if ("resource".equals(e.getActionId())) {
openResource(ureq, room);
}
}
} else if (source == dialogCtr) {
if (DialogBoxUIFactory.isOkEvent(event)) {
OpenMeetingsRoom room = (OpenMeetingsRoom) dialogCtr.getUserObject();
doDelete(room);
}
} else if (source == cmc) {
removeAsListenerAndDispose(infoController);
removeAsListenerAndDispose(cmc);
} else if (source == infoController) {
cmc.deactivate();
removeAsListenerAndDispose(infoController);
removeAsListenerAndDispose(cmc);
reloadModel();
}
}
use of org.olat.core.gui.components.table.TableEvent in project OpenOLAT by OpenOLAT.
the class BusinessGroupEditResourceController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == repoSearchCtr) {
if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
// repository search controller done
RepositoryEntry re = repoSearchCtr.getSelectedEntry();
removeAsListenerAndDispose(repoSearchCtr);
cmc.deactivate();
if (re != null) {
doAddRepositoryEntry(Collections.singletonList(re));
fireEvent(ureq, Event.CHANGED_EVENT);
}
} else if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRIES_SELECTED) {
// repository search controller done
List<RepositoryEntry> res = repoSearchCtr.getSelectedEntries();
removeAsListenerAndDispose(repoSearchCtr);
cmc.deactivate();
if (res != null && !res.isEmpty()) {
doAddRepositoryEntry(res);
fireEvent(ureq, Event.CHANGED_EVENT);
}
}
} else if (source == resourcesCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
RepositoryEntry re = repoTableModel.getObject(te.getRowId());
if (actionid.equals(RepositoryTableModel.TABLE_ACTION_REMOVE_LINK)) {
// present dialog box if resource should be removed
String text = getTranslator().translate("resource.remove", new String[] { group.getName(), re.getDisplayname() });
confirmRemoveResource = activateYesNoDialog(ureq, null, text, this.confirmRemoveResource);
confirmRemoveResource.setUserObject(re);
} else if (RepositoryTableModel.TABLE_ACTION_INFOS.equals(actionid)) {
int row = resourcesCtr.getIndexOfSortedObject(re);
doOpenInfos(ureq, re, row);
}
}
} else if (source == confirmRemoveResource) {
if (DialogBoxUIFactory.isYesEvent(event)) {
// yes case
RepositoryEntry re = (RepositoryEntry) confirmRemoveResource.getUserObject();
doRemoveResource(re);
fireEvent(ureq, Event.CHANGED_EVENT);
}
}
}
use of org.olat.core.gui.components.table.TableEvent in project OpenOLAT by OpenOLAT.
the class GenericArchiveController method event.
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == nodeListCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
if (actionid.equals(CMD_SELECT_NODE)) {
AssessmentNodeData nodeData = nodeTableModel.getObject(te.getRowId());
doSelectNode(ureq, nodeData);
}
}
} else if (source == chooseGroupCtrl) {
cmc.deactivate();
CourseNode courseNode = chooseGroupCtrl.getCourseNode();
BusinessGroup group = chooseGroupCtrl.getSelectedGroup();
cleanUpPopups();
if (Event.DONE_EVENT == event) {
archiveNode(ureq, courseNode, group);
}
} else if (source == cmc) {
cleanUpPopups();
}
}
use of org.olat.core.gui.components.table.TableEvent in project OpenOLAT by OpenOLAT.
the class EfficiencyStatementsPortletRunController method event.
/**
* @see org.olat.core.gui.control.ControllerEventListener#dispatchEvent(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
public void event(UserRequest ureq, Controller source, Event event) {
super.event(ureq, source, event);
if (source == tableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
if (actionid.equals(CMD_LAUNCH)) {
int rowid = te.getRowId();
final UserEfficiencyStatementLight statement = efficiencyStatementsListModel.getEfficiencyStatementAt(rowid);
// will not be disposed on course run dispose, popus up as new browserwindow
ControllerCreator ctrlCreator = new ControllerCreator() {
public Controller createController(UserRequest lureq, WindowControl lwControl) {
CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(lwControl, lureq, statement.getArchivedResourceKey());
return new LayoutMain3ColsController(lureq, getWindowControl(), efficiencyCtrl);
}
};
// wrap the content controller into a full header layout
ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
// open in new browser window
PopupBrowserWindow pbw = getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
pbw.open(ureq);
//
}
}
}
}
use of org.olat.core.gui.components.table.TableEvent in project openolat by klemens.
the class PropTableDataModel method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
public void event(UserRequest ureq, Controller source, Event event) {
if (source == tableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
if (actionid.equals("choose")) {
int rowid = te.getRowId();
foundProp = tdm.getObject(rowid);
// Tell parentController that a subject has been found
fireEvent(ureq, new PropFoundEvent(foundProp));
} else // fxdiff FXOLAT-149
if (actionid.equals("delete")) {
int rowid = te.getRowId();
foundProp = tdm.getObject(rowid);
String fullName = CoreSpringFactory.getImpl(UserManager.class).getUserDisplayName(displayedIdentity);
activateYesNoDialog(ureq, translate("propdelete.yesno.title"), translate("propdelete.yesno.text", new String[] { foundProp.getName(), fullName }), null);
}
}
} else // fxdiff FXOLAT-149
if (DialogBoxUIFactory.isYesEvent(event) && foundProp != null) {
PropertyManager.getInstance().deleteProperty(foundProp);
tdm.getObjects().remove(foundProp);
tableCtr.modelChanged();
foundProp = null;
}
}
Aggregations