Search in sources :

Example 71 with TableEvent

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());
            }
        }
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent)

Example 72 with TableEvent

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);
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent) ArrayList(java.util.ArrayList) List(java.util.List) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 73 with TableEvent

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());
            }
        }
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent)

Example 74 with TableEvent

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;
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent) Subscriber(org.olat.core.commons.services.notifications.Subscriber)

Example 75 with TableEvent

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();
        }
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent)

Aggregations

TableEvent (org.olat.core.gui.components.table.TableEvent)114 ArrayList (java.util.ArrayList)42 List (java.util.List)40 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)40 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)16 Identity (org.olat.core.id.Identity)16 BitSet (java.util.BitSet)12 WindowControl (org.olat.core.gui.control.WindowControl)12 SingleIdentityChosenEvent (org.olat.basesecurity.events.SingleIdentityChosenEvent)10 UserRequest (org.olat.core.gui.UserRequest)10 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)10 PopupBrowserWindow (org.olat.core.gui.control.generic.popup.PopupBrowserWindow)10 MultiIdentityChosenEvent (org.olat.basesecurity.events.MultiIdentityChosenEvent)8 BusinessGroup (org.olat.group.BusinessGroup)8 RepositoryEntry (org.olat.repository.RepositoryEntry)8 AssertException (org.olat.core.logging.AssertException)6 UserInfoMainController (org.olat.user.UserInfoMainController)6 KalendarEvent (org.olat.commons.calendar.model.KalendarEvent)4 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)4 Subscriber (org.olat.core.commons.services.notifications.Subscriber)4