use of org.olat.core.gui.components.table.TableEvent in project OpenOLAT by OpenOLAT.
the class GroupsPortletRunController 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)) {
PortletEntry<BusinessGroupEntry> entry = groupListModel.getObject(te.getRowId());
String businessPath = "[BusinessGroup:" + entry.getKey() + "]";
NewControllerFactory.getInstance().launch(businessPath, ureq, getWindowControl());
}
}
}
}
use of org.olat.core.gui.components.table.TableEvent in project OpenOLAT by OpenOLAT.
the class BGConfigResourcesStepController method event.
@Override
protected 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 && !repoTableModel.getObjects().contains(re)) {
// check if already in model
repoTableModel.addObject(re);
resourcesCtr.modelChanged();
flc.setDirty(true);
}
} 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()) {
// check if already in model
List<RepositoryEntry> entries = new ArrayList<RepositoryEntry>(res.size());
for (RepositoryEntry re : res) {
if (!repoTableModel.getObjects().contains(re)) {
entries.add(re);
}
}
repoTableModel.addObjects(entries);
resourcesCtr.modelChanged();
flc.setDirty(true);
}
}
} 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
if (repoTableModel.getObjects().remove(re)) {
resourcesCtr.modelChanged();
}
} else if (RepositoryTableModel.TABLE_ACTION_INFOS.equals(actionid)) {
int row = resourcesCtr.getIndexOfSortedObject(re);
doOpenInfos(ureq, re, row);
}
}
}
super.event(ureq, source, event);
}
use of org.olat.core.gui.components.table.TableEvent in project OpenOLAT by OpenOLAT.
the class BookmarksPortletRunController 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)
*/
@Override
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();
PortletEntry<Bookmark> bookmark = bookmarkListModel.getObject(rowid);
String businessPath = bookmark.getValue().getBusinessPath();
NewControllerFactory.getInstance().launch(businessPath, ureq, getWindowControl());
}
}
}
}
use of org.olat.core.gui.components.table.TableEvent in project OpenOLAT by OpenOLAT.
the class NotificationSubscriptionController 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)
*/
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == subscriptionsTableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
Subscriber sub = subscriptionsTableModel.getObject(te.getRowId());
if (actionid.equals("launch")) {
// User want to go to the subscription source, e.g. the forum or the
// folder
NotificationUIFactory.launchSubscriptionResource(ureq, getWindowControl(), sub);
} else if (actionid.equals("del")) {
delYesNoC = activateYesNoDialog(ureq, null, translate("confirm.delete"), delYesNoC);
delYesNoC.setUserObject(sub);
return;
}
}
} else if (source == delYesNoC) {
if (DialogBoxUIFactory.isYesEvent(event)) {
// ok
// Remove subscription and update data model
Subscriber sub = (Subscriber) delYesNoC.getUserObject();
NotificationsManager.getInstance().unsubscribe(sub);
updateSubscriptionsDataModel();
showInfo("info.notification.deleted");
// Notify parent controller
fireEvent(ureq, Event.CHANGED_EVENT);
}
// cleanup dialog
delYesNoC.dispose();
delYesNoC = null;
}
}
use of org.olat.core.gui.components.table.TableEvent in project OpenOLAT by OpenOLAT.
the class BookmarksController 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 row has been cklicked
if (source == tableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
int rowid = te.getRowId();
Bookmark bookmark = (Bookmark) tableCtr.getTableDataModel().getObject(rowid);
if (actionid.equals("choose")) {
String businessPath = bookmark.getBusinessPath();
NewControllerFactory.getInstance().launch(businessPath, ureq, getWindowControl());
} else if (actionid.equals("delete")) {
dc = activateYesNoDialog(ureq, null, translate("bookmark.delete.willyou"), dc);
dc.setUserObject(bookmark);
}
}
} else if (source == dc) {
if (DialogBoxUIFactory.isYesEvent(event)) {
Bookmark bookmark = (Bookmark) dc.getUserObject();
markManager.removeMark(bookmark.getOLATResourceable(), getIdentity(), bookmark.getResSubPath());
showInfo("bookmark.delete.successfull");
populateBmTable();
}
}
}
Aggregations