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

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


  }

  @Override
  protected void event(UserRequest ureq, Controller source, Event event) {   
    if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
      TableMultiSelectEvent multiselectionEvent = (TableMultiSelectEvent) event;
      if (multiselectionEvent.getAction().equals(ACTION_MULTISELECT_CHOOSE)) {       
        //sortedItems = tableDataModel.getObjects(multiselectionEvent.getSelection());
        sortedItems = tableController.getSelectedSortedObjects(multiselectionEvent.getSelection(), tableDataModel);   
        if(sortedItems.size()==0) {
          this.showWarning("portlet.sorting.manual.empty_sel");
        } else {
          fireEvent(ureq, event);
        }
      } else if (multiselectionEvent.getAction().equals(ACTION_MULTISELECT_CANCEL)) {
        fireEvent(ureq, Event.CANCELLED_EVENT);
      }
    }   
  }
View Full Code Here


              fireEvent(ureq, FolderCommand.FOLDERCOMMAND_FINISHED);
            }
          }
        }
      } else if (event instanceof TableMultiSelectEvent) {
        TableMultiSelectEvent tEvent = (TableMultiSelectEvent) event;
        if (CMD_CANCEL.equals(tEvent.getAction())) {
          status = FolderCommandStatus.STATUS_CANCELED;
          fireEvent(ureq, FolderCommand.FOLDERCOMMAND_FINISHED);
        } else {
          List<VFSRevision> selectedVersions = getSelectedRevisions(tEvent.getSelection());
          if (!selectedVersions.isEmpty()) {
            if (CMD_DELETE.equals(tEvent.getAction())) {
              String numOfVersionToDelete = Integer.toString(selectedVersions.size());
              confirmDeleteBoxCtr = activateYesNoDialog(ureq, null, getTranslator().translate("version.confirmDelete",
                  new String[] { numOfVersionToDelete }), confirmDeleteBoxCtr);
              confirmDeleteBoxCtr.setUserObject(selectedVersions);
            }
View Full Code Here

            status = FolderCommandStatus.STATUS_FAILED;
            // ERROR
          }
        }
      } else if (event instanceof TableMultiSelectEvent) {
        TableMultiSelectEvent tEvent = (TableMultiSelectEvent) event;
        if (CMD_CANCEL.equals(tEvent.getAction())) {
          status = FolderCommandStatus.STATUS_CANCELED;
          fireEvent(ureq, FolderCommand.FOLDERCOMMAND_FINISHED);
        } else if (CMD_RESTORE.equals(tEvent.getAction())) {
          List<VFSRevision> selectedRevisions = getSelectedRevisions(tEvent.getSelection());
          boolean allOk = true;
          for (VFSRevision revision : selectedRevisions) {
            allOk &= VersionsManager.getInstance().restore(container, revision);
          }
          if (allOk) {
            status = FolderCommandStatus.STATUS_SUCCESS;
            fireEvent(ureq, FolderCommand.FOLDERCOMMAND_FINISHED);
          } else {
            status = FolderCommandStatus.STATUS_FAILED;
          }
        } else if (CMD_DELETE.equals(tEvent.getAction())) {
          List<Versions> versionsToDelete = getSelectedVersions(tEvent.getSelection());
          if (!versionsToDelete.isEmpty()) {
           
            Translator trans = getTranslator();
            String msg = trans.translate("version.del.confirm") + "<p>" + renderVersionsAsHtml(versionsToDelete) + "</p>";
            // create dialog controller
View Full Code Here

          } else {
            deliverMediaFile(ureq, element.getFilename());
          }
        }
      } else if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
        if (tmse.getAction().equals(ACTION_DELETE_MEDIAS)) {
            deleteMediaFile(mediaFilesTableModel.getObjects(tmse.getSelection()), ureq);
            editContent.contextPut("fileList", wiki.getMediaFileList());
        }
      }
    } else if (source == archiveWikiDialogCtr) {
        if (DialogBoxUIFactory.isOkEvent(event)) {
View Full Code Here

          //
        }
      }
      if (event instanceof TableMultiSelectEvent) {
        // Multiselect events
        TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
        if (tmse.getAction().equals(CMD_BULKEDIT)) {
          if (tmse.getSelection().isEmpty()) {
            // empty selection
            showWarning("msg.selectionempty");
            return;
          }
          selectedIdentities = tdm.getIdentities(tmse.getSelection());
          final UserBulkChangeManager ubcMan = UserBulkChangeManager.getInstance();
          // valid selection: load in wizard
          Step start = new UserBulkChangeStep00(ureq, selectedIdentities);
          Roles roles = ureq.getUserSession().getRoles();
          isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());

          // callback executed in case wizard is finished.
          StepRunnerCallback finish = new StepRunnerCallback() {
            public Step execute(UserRequest ureq1, WindowControl wControl1, StepsRunContext runContext) {
              // all information to do now is within the runContext saved
              boolean hasChanges = false;
              try {
                if (runContext.containsKey("validChange") && ((Boolean) runContext.get("validChange")).booleanValue()) {
                  HashMap<String, String> attributeChangeMap = (HashMap<String, String>) runContext.get("attributeChangeMap");
                  HashMap<String, String> roleChangeMap = (HashMap<String, String>) runContext.get("roleChangeMap");
                  if (!(attributeChangeMap.size()==0 && roleChangeMap.size()==0)){
                    ubcMan.changeSelectedIdentities(selectedIdentities, attributeChangeMap, roleChangeMap, notUpdatedIdentities,
                      isAdministrativeUser, getTranslator());
                    hasChanges = true;
                  }
                }
              } catch (Exception any) {
                // return new ErrorStep
              }
              // signal correct completion and tell if changes were made or not.
              return hasChanges ? StepsMainRunController.DONE_MODIFIED : StepsMainRunController.DONE_UNCHANGED;
            }
          };

          userBulkChangeStepsController = new StepsMainRunController(ureq, getWindowControl(), start, finish, null,
              translate("bulkChange.title"));
          listenTo(userBulkChangeStepsController);
          getWindowControl().pushAsModalDialog(userBulkChangeStepsController.getInitialComponent());

        } else if (tmse.getAction().equals(CMD_MAIL)) {
          if (tmse.getSelection().isEmpty()) {
            // empty selection
            showWarning("msg.selectionempty");
            return;
          }
          removeAsListenerAndDispose(contactCtr);
          // create e-mail message
          ContactMessage cmsg = new ContactMessage(ureq.getIdentity());

          selectedIdentities = tdm.getIdentities(tmse.getSelection());
          ContactList contacts = new ContactList(translate("mailto.userlist"));
          contacts.addAllIdentites(selectedIdentities);
          cmsg.addEmailTo(contacts);

          // create contact form controller with ContactMessage
View Full Code Here

 
  @Override
  public void event(UserRequest ureq, Controller source, Event event) {
    if ( source == searchCtr ) {
      if (event instanceof TableMultiSelectEvent) {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
        if (tmse.getAction().equals(RepositorySearchMultiSelectController.ACTION_MULTI_SELECT)) {
          boolean hasSelected = false;
          for (int i = tmse.getSelection().nextSetBit(0); i >= 0; i = tmse.getSelection().nextSetBit(i+1)) {
            if (i != -1) {
              hasSelected = true;
              repoEntries.add(searchCtr.getValueAt(i));
            }
          }
View Full Code Here

          fireEvent(ureq, new SingleIdentityChosenEvent(identity));
        }

      } else if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
        // Multiselect events
        TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
        if (tmse.getAction().equals(COMMAND_REMOVEUSER)) {
          if(tmse.getSelection().isEmpty()){
            //empty selection
            content.setDirty(true);
            showWarning("msg.selectionempty");
            return;
          }
          int size = identitiesTableModel.getObjects().size();
          toRemove = identitiesTableModel.getIdentities(tmse.getSelection());
          // list is never null, but can be empty
          if (keepAtLeastOne && (size == 1 || size - toRemove.size() == 0)) {
            //at least one must be kept
            //do not delete the last one => ==1
            //do not allow to delete all => size - selectedCnt == 0
View Full Code Here

          openVisitingCard(ureq);
        }
      }
    } else if(source == editChecklistTable) {
      if(event instanceof TableMultiSelectEvent) {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent)event;
        if(tmse.getAction().equals("save")) {
          BitSet selection = tmse.getSelection();
          updateCheckpointsFor(selectedIdentity, selection);
          initManageTable(ureq);
        }
        cmc.deactivate();
      }
View Full Code Here

        if (te.getActionId().equals(ACTION_SINGLESELECT_CHOOSE)) {
          int rowid = te.getRowId();
          UserDeletionManager.getInstance().setIdentityAsActiv( (Identity) tdm.getObject(rowid) );
        }
      } else if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
        if (tmse.getAction().equals(ACTION_MULTISELECT_CHOOSE)) {
          handleEmailButtonEvent(ureq, tmse);
        }
      }
      initializeContent();
    } else if (source == deleteUserMailCtr) {
View Full Code Here

   */
  @Override
  protected void event(UserRequest ureq, Controller source, Event event) {
    if(source == runChecklistTable) {
      if(event instanceof TableMultiSelectEvent) {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent)event;
        selection = tmse.getSelection();
        boolean doUpdate = true;
        int size = visibleCheckpoints.size();
        // check for once editable checkpoints -> show confirmation dialog
        for(int i = 0; i < size; i++) {
          Checkpoint checkpoint = visibleCheckpoints.get(i);
View Full Code Here

TOP

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

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.