Search in sources :

Example 86 with TableEvent

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

Example 87 with TableEvent

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

Example 88 with TableEvent

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();
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent) BusinessGroup(org.olat.group.BusinessGroup) CourseNode(org.olat.course.nodes.CourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) AssessmentNodeData(org.olat.course.assessment.model.AssessmentNodeData)

Example 89 with TableEvent

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);
            // 
            }
        }
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent) PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) UserEfficiencyStatementLight(org.olat.course.assessment.model.UserEfficiencyStatementLight) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) WindowControl(org.olat.core.gui.control.WindowControl) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 90 with TableEvent

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;
    }
}
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