Package org.olat.core.gui.components.table

Examples of org.olat.core.gui.components.table.TableEvent


   * @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 == tableCtr) { // process table actions
      TableEvent te = (TableEvent) event;
      String action  = te.getActionId();
      CategoriesListModel categoriesListModel = (CategoriesListModel) tableCtr.getTableDataModel();
      CatalogEntry selectedCategoryLevel = categoriesListModel.getCatalogEntry(te.getRowId());
     
      if (action.equals(CategoriesListModel.ACTION_GOTO)) {
        // select repo site and activate catalog entry in catalog
        DTabs dts = (DTabs) getWindowControl().getWindowBackOffice().getWindow().getAttribute("DTabs");
        dts.activateStatic(ureq, RepositorySite.class.getName(), "search.catalog:" + selectedCategoryLevel.getKey());
View Full Code Here


   *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == tableController) {
      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();
          KalendarEvent kalendarEvent = (KalendarEvent)((DefaultTableDataModel)tableController.getTableDataModel()).getObject(rowid);
          Date startDate = kalendarEvent.getBegin();
          String activationCmd = "cal." + new SimpleDateFormat("yyyy.MM.dd").format(startDate);
          DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
          //was brasato:: getWindowControl().getDTabs().activateStatic(ureq, HomeSite.class.getName(), activationCmd);
View Full Code Here

    if (source == versioningTableCtr) {
      /*************************************************************************
       * history table events
       ************************************************************************/
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        if (te.getActionId().equals(ACTION_COMPARE)) {
          selectedPage = (WikiPage) versioningTableModel.getObject(te.getRowId());
          diffs = wiki.getDiff(page, selectedPage.getVersion() - 1, selectedPage.getVersion());
          versioningContent.contextPut("diffs", diffs);
          versioningContent.remove(wikiVersionDisplayComp);
          versioningContent.contextPut("page", selectedPage);
        } else if (te.getActionId().equals(ACTION_SHOW)) {
          versioningContent.contextRemove("diffs");
          selectedPage = (WikiPage) versioningTableModel.getObject(te.getRowId());
          selectedPage = wiki.loadVersion(selectedPage, selectedPage.getVersion());
          wikiVersionDisplayComp.setWikiContent(selectedPage.getContent());
          wikiVersionDisplayComp.setImageMapperUri(ureq, wikiContainer);
          versioningContent.put("versionDisplay", wikiVersionDisplayComp);
          versioningContent.contextPut("page", selectedPage);
        }
      }
    } else if (source == fileUplCtr) {
      /*************************************************************************
       * file upload controller events
       ************************************************************************/
      if (event == Event.DONE_EVENT) {
        fileUplCtr.reset();
      } else if (event.getCommand().equals(FolderEvent.UPLOAD_EVENT)) {
        FolderEvent fEvent = (FolderEvent)event;
        createMediaMetadataFile(fEvent.getFilename(), ureq.getIdentity().getKey());
        editContent.contextPut("fileList", wiki.getMediaFileList());
      }
    } else if (source == breadCrumpCtr) {
      /*************************************************************************
       * BreadCrump controller events
       ************************************************************************/
      page = wiki.getPage(event.getCommand(), true);
      updatePageContext(page);
      setTabsEnabled(true);
      breadCrumpCtr.addLink(page.getPageName(), page.getPageName());
      tabs.setSelectedPane(0);
    } else if (source == removePageDialogCtr) {
      if (DialogBoxUIFactory.isOkEvent(event)) {
        wiki.removePage(page);
        breadCrumpCtr.removeLink(page.getPageName());
        WikiManager.getInstance().deleteWikiPage(ores, page);
        page = wiki.getPage(WikiPage.WIKI_INDEX_PAGE);
        updatePageContext(page);
        tabs.setSelectedPane(0);
      }
    } else if (source == mediaTableCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        if (te.getActionId().equals(ACTION_DELETE_MEDIA)) {
          List list = new ArrayList(1);
          list.add(mediaFilesTableModel.getObject(te.getRowId()));
          deleteMediaFile(list, ureq);
        } else if (te.getActionId().equals(ACTION_SHOW_MEDIA)) {
          // show a selected file from the media folder
          MediaFileElement element = (MediaFileElement)mediaFilesTableModel.getObject(te.getRowId());
          if (isImage(element.getFilename()) ) { // show images inline as modal overlay
            imageDisplay.contextPut("mediaElement", element);
            imageDisplay.contextPut("imageUri", wikiArticleComp.getImageBaseUri());
            CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"), imageDisplay);
            cmc.activate();
View Full Code Here

   *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  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)) {
          int rowid = te.getRowId();
          Map nodeData = (Map) nodeTableModel.getObject(rowid);
          ICourse course = CourseFactory.loadCourse(ores);
          CourseNode node = course.getRunStructure().getNode((String) nodeData.get(AssessmentHelper.KEY_IDENTIFYER));
          this.currentCourseNode = (FOCourseNode) node;
          // cast should be save, only ta course nodes nodes are selectable
View Full Code Here

    } else if (source == singleThreadTableCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        // user has selected a message title from singleThreadTable
        // -> display message details and below all messages with the same
        // topthread_id as the selected one
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        if (actionid.equals(CMD_SHOWDETAIL)) {
          int rowid = te.getRowId();
          Message m = (Message) sttdmodel.getObjects().get(rowid);
          showThreadView(ureq, m);
          ThreadLocalUserActivityLogger.log(ForumLoggingAction.FORUM_MESSAGE_READ, getClass(), LoggingResourceable.wrap(currentMsg));
        }
      }
    } else if (source == allThreadTableCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        if (actionid.equals(CMD_SHOWDETAIL)) {
          int rowid = te.getRowId();
          Object[] msgWrapper = (Object[]) attdmodel.getObjects().get(rowid);
          int size = msgWrapper.length;
          Message m = (Message) msgWrapper[size-1];         
          showThreadView(ureq, m);
        }
      }
    } else if (source == yesNoSplit) {
      // the dialogbox is already removed from the gui stack - do not use getWindowControl().pop(); to remove dialogbox
      if (DialogBoxUIFactory.isYesEvent(event)){
        splitThread(ureq);       
      }
    } else if (source == moveMessageTableCtr) {
      TableEvent te = (TableEvent)event;
      Message topMsg = threadList.get(te.getRowId());
      moveMessage(ureq, topMsg);
    }
   
    // events from messageEditor
    else if (source == msgEditCtr){
View Full Code Here

        doInitContextList(ureq, groupContexts);
        content.setContent(columnLayoutCtr.getInitialComponent());
      }
    } else if (source == contextListCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        int rowid = te.getRowId();
        BGContext context = contextTableModel.getGroupContextAt(rowid);
        if (actionid.equals(CMD_CONTEXT_RUN)) {
          doInitGroupmanagement(ureq, context, true);
        }
      }
View Full Code Here

  protected void event(UserRequest ureq, Controller source, Event event) {
    checkForumChangedEventReceived();
   
    if(source == userListCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
       
        int rowid = te.getRowId();
        final UserInfo selectedInfo = usersTableModel.getUserInfo(rowid);
        if (te.getActionId().equals(CMD_SHOW)) {
          showMessages(ureq, selectedInfo);
        } else if (te.getActionId().equals(CMD_HOMEPAGE)) {
          ControllerCreator ctrlCreator = new ControllerCreator() {
            public Controller createController(UserRequest lureq, WindowControl lwControl) {
              return new UserInfoMainController(lureq, lwControl, selectedInfo.getIdentity());
            }
          };
View Full Code Here

  }
 
  protected 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("empty")) {
          int rowid = te.getRowId();
          String cname = cnames[rowid];
          Cache toEmpty = cm.getCache(cname);
         
          //provide dc as argument, this ensures that dc is disposed before newly created
          dc = activateYesNoDialog(ureq, null, translate("confirm.emptycache"), dc);
View Full Code Here

   *      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(ExtendedIdentitiesTableControllerFactory.COMMAND_SELECTUSER)) {
          int rowid = te.getRowId();
          foundIdentity = tdm.getIdentityAt(rowid);
          // Tell parentController that a subject has been found
          fireEvent(ureq, new SingleIdentityChosenEvent(foundIdentity));
        } else if (actionid.equals(ExtendedIdentitiesTableControllerFactory.COMMAND_VCARD)) {
          // get identitiy and open new visiting card controller in new window
          int rowid = te.getRowId();
          final Identity identity = tdm.getIdentityAt(rowid);
          ControllerCreator userInfoMainControllerCreator = new ControllerCreator() {
            public Controller createController(UserRequest lureq, WindowControl lwControl) {
              return new UserInfoMainController(lureq, lwControl, identity);
            }
View Full Code Here

   * @param ureq
   * @param event
   */
  private void handleEventsGroupTables(UserRequest ureq, Event event) {
    if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
      TableEvent te = (TableEvent) event;
      String actionid = te.getActionId();
      int rowid = te.getRowId();
      currBusinessGroup = groupListModel.getBusinessGroupAt(rowid);
      String trnslP = currBusinessGroup.getName();

      if (actionid.equals(TABLE_ACTION_LAUNCH)) {
        BGControllerFactory.getInstance().createRunControllerAsTopNavTab(currBusinessGroup, ureq, getWindowControl(), false, null);
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.table.TableEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.