Examples of DTabs


Examples of org.olat.core.gui.control.generic.dtabs.DTabs

       

    OLATResourceable ores = repositoryEntry.getOlatResource();
   
    //was brasato:: DTabs dts = getWindowControl().getDTabs();
    DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
    DTab dt = dts.getDTab(ores);
    if (dt == null) {
      // does not yet exist -> create and add
      dt = dts.createDTab(ores, repositoryEntry.getDisplayname());
      if (dt == null){
        //null means DTabs are full -> warning is shown
        return;
      }
      //user activity logger is set by course factory
      Controller editorController = typeToEdit.getEditorController(ores, ureq, dt.getWindowControl());
      if(editorController == null){
        //editor could not be created -> warning is shown
        return;
      }
      dt.setController(editorController);
      dts.addDTab(dt);
    }
    dts.activate(ureq, dt, RepositoryDetailsController.ACTIVATE_EDITOR);
  }
View Full Code Here

Examples of org.olat.core.gui.control.generic.dtabs.DTabs

      wControl.setWarning(trans.translate("warn.cantlaunch"));
    } else {
      // get the OLAT resource from this repo entry
      OLATResourceable ores = re.getOlatResource();
      //was brasato:: DTabs dts = getWindowControl().getDTabs();
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      DTab dt = dts.getDTab(ores);
      if (dt == null) {
        // does not yet exist -> create and add
        dt = dts.createDTab(ores, bookmark.getTitle());
        if (dt == null) {
          //ups? what happend here?
          log.warn("Could not create dTab for bookmark with title::" + bookmark.getTitle() + " and ores::" + ores);
          return true;
        }
        Controller launchController = ControllerFactory.createLaunchController(ores, null, ureq, dt.getWindowControl(), true);
        dt.setController(launchController);
        dts.addDTab(dt);
      }
      // null: do not activate to a certain view
      dts.activate(ureq, dt, null);
    }                       
    // in any case return true - this was a repo entry bookmark!
    return true;
  }
View Full Code Here

Examples of org.olat.core.gui.control.generic.dtabs.DTabs

    if (!typeToEdit.supportsEdit()){
      throw new AssertException("Trying to edit repository entry which has no assoiciated editor: "+ typeToEdit);
    }         
    // Open editor in new tab
    OLATResourceable ores = repositoryEntry.getOlatResource();
    DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
    DTab dt = dts.getDTab(ores);
    if (dt == null) {
      // does not yet exist -> create and add
      dt = dts.createDTab(ores, repositoryEntry.getDisplayname());
      if (dt == null){
        //null means DTabs are full -> warning is shown
        return;
      }
      //user activity logger is set by course factory
      Controller editorController = typeToEdit.getEditorController(ores, ureq, dt.getWindowControl());
      if(editorController == null){
        //editor could not be created -> warning is shown
        return;
      }
      dt.setController(editorController);
      dts.addDTab(dt);
    }
    dts.activate(ureq, dt, RepositoryDetailsController.ACTIVATE_EDITOR);
  }
View Full Code Here

Examples of org.olat.core.gui.control.generic.dtabs.DTabs

        if (re != null) {
          if (!rm.isAllowedToLaunch(ureq, re)) {
            getWindowControl().setWarning(translate("warn.cantlaunch"));
          } else {
            OLATResourceable ores = re.getOlatResource();
            DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
            DTab dt = dts.getDTab(ores);
            if (dt == null) {
              // does not yet exist -> create and add
              dt = dts.createDTab(ores, re.getDisplayname());
              if (dt == null) return;
              Controller launchController = ControllerFactory.createLaunchController(ores, null, ureq, dt.getWindowControl(), true);
              dt.setController(launchController);
              dts.addDTab(dt);
            }
            dts.activate(ureq, dt, null); // null: do not activate a certain
                                          // view
          }
        } else {
          getWindowControl().setWarning(translate("warn.cantlaunch"));
        }
      } else if (polyLink.getLinkType().equals(InstitutionPortlet.TYPE_CATALOG)) {
        try {
          CatalogEntry ce = CatalogManager.getInstance().loadCatalogEntry(resultIDForUser != null ? resultIDForUser : defaultID);
          DTabs dts = (DTabs) getWindowControl().getWindowBackOffice().getWindow().getAttribute("DTabs");
          dts.activateStatic(ureq, RepositorySite.class.getName(), "search.catalog:" + ce.getKey());
        } catch (Exception e) {
          Tracing.createLoggerFor(InstitutionPortletRunController.class).error(e.getMessage());
          getWindowControl().setWarning(translate("warn.cantlaunch"));
        }
      }
View Full Code Here

Examples of org.olat.core.gui.control.generic.dtabs.DTabs

        return;
      }
      RepositoryHandler typeToEdit = RepositoryHandlerFactory.getInstance().getRepositoryHandler(repositoryEntry);
      // Open editor in new tab
      OLATResourceable ores = repositoryEntry.getOlatResource();
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      DTab dt = dts.getDTab(ores);
      if (dt == null) {
        // does not yet exist -> create and add
        dt = dts.createDTab(ores, repositoryEntry.getDisplayname());
        if (dt == null){
          //null means DTabs are full -> warning is shown
          return;
        }
        //user activity logger is set by course factory
        Controller editorController = typeToEdit.getLaunchController(ores, null, ureq, dt.getWindowControl());
        if(editorController == null){
          //editor could not be created -> warning is shown
          return;
        }
        dt.setController(editorController);
        dts.addDTab(dt);
      }
      dts.activate(ureq, dt, RepositoryDetailsController.ACTIVATE_EDITOR);
    }

  }
View Full Code Here

Examples of org.olat.core.gui.control.generic.dtabs.DTabs

   */
  @Override
  @SuppressWarnings("unused")
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source == restartLink) {
      DTabs dts = (DTabs) getWindowControl().getWindowBackOffice().getWindow().getAttribute("DTabs");
      OLATResourceable ores = OLATResourceManager.getInstance().findResourceable(
          courseRepositoryEntry.getOlatResource().getResourceableId(), courseRepositoryEntry.getOlatResource().getResourceableTypeName());
      if(ores==null) {
        //course was deleted!       
        MessageController msgController = MessageUIFactory.createInfoMessage(ureq, this.getWindowControl(), translate("course.deleted.title"), translate("course.deleted.text"));
        panel.setContent(msgController.getInitialComponent());       
        return;
      }
      DTab dt = dts.getDTab(ores);
      // remove and dispose "old course run"
      dts.removeDTab(dt);//disposes also dt and controllers
      /*
       * create new tab with "refreshed course run" and activate the course
       */
      dt = dts.createDTab(ores, courseRepositoryEntry.getDisplayname());
      if (dt == null) return; // full tabs -> warning already set by
                              // dts.create...
      Controller launchController = ControllerFactory.createLaunchController(ores, null, ureq, dt.getWindowControl(), true);
      dt.setController(launchController);
      dts.addDTab(dt);
      dts.activate(ureq, dt, null);
      /*
       * last but not least dispose myself - to clean up.
       */
      dispose();
    }
 
View Full Code Here

Examples of org.olat.core.gui.control.generic.dtabs.DTabs

          // we can create a controller and launch
          // it in OLAT, e.g. if it is a
          // content-packacking or a course

          //was brasato:: DTabs dts = getWindowControl().getDTabs();
          DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
          DTab dt = dts.getDTab(ores);
          if (dt == null) {
            // does not yet exist -> create and add
            dt = dts.createDTab(ores, displayName);
            if (dt == null) return;
            Controller launchController = ControllerFactory.createLaunchController(ores, null, ureq, dt.getWindowControl(), true);
            dt.setController(launchController);
            dts.addDTab(dt);
          }
          dts.activate(ureq, dt, null); // null: start with main entry point of controller
        } else if (repoEntry.getCanDownload()) {
          // else not launchable in olat, but downloadable -> send the document
          // directly to browser but "downloadable" (pdf, word, excel)
          MediaResource mr = handler.getAsMediaResource(ores);
          RepositoryManager.getInstance().incrementDownloadCounter(repoEntry);
View Full Code Here

Examples of org.olat.core.gui.control.generic.dtabs.DTabs

  public boolean tryToLaunch(Bookmark bookmark, UserRequest ureq, WindowControl wControl) {
    OLATResourceable reores = BookmarkManager.getInstance().getLaunchOlatResourceable(bookmark);
    // only launch bookmarks of type catalog entry
    if(reores.getResourceableTypeName().equals(CatalogManager.CATALOGENTRY)){
      // set catalog param to same syntax as used in jumpin activation process
      DTabs dts = (DTabs) wControl.getWindowBackOffice().getWindow().getAttribute("DTabs");
      // encode sub view identifyer using ":" character
      dts.activateStatic(ureq, RepositorySite.class.getName(),"search.catalog:" + bookmark.getOlatreskey());   
      return true;
    }
    return false;
  }
View Full Code Here

Examples of org.olat.core.gui.control.generic.dtabs.DTabs

        SingleIdentityChosenEvent foundEvent = (SingleIdentityChosenEvent) event;
        Identity chosenIdentity = foundEvent.getChosenIdentity();
        if (chosenIdentity != null) {
          HomePageConfigManager hpcm = HomePageConfigManagerImpl.getInstance();
          OLATResourceable ores = hpcm.loadConfigFor(chosenIdentity.getName());
          DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
          //was brasato:: DTabs dts = getWindowControl().getDTabs();
          DTab dt = dts.getDTab(ores);
          if (dt == null) {
            // does not yet exist -> create and add
            dt = dts.createDTab(ores, chosenIdentity.getName());
            if (dt == null) return;
            UserInfoMainController uimc = new UserInfoMainController(ureq, dt.getWindowControl(), chosenIdentity);
            dt.setController(uimc);
            dts.addDTab(dt);
          }
          dts.activate(ureq, dt, null);
        }
      }
    }
  }
View Full Code Here

Examples of org.olat.core.gui.control.generic.dtabs.DTabs

   */
  public void event(UserRequest ureq, Component source, Event event) {   
    if (source == showAllLink){
      // activate homes tab in top navigation and active bookmarks menu item
      //was brasato:: getWindowControl().getDTabs().activateStatic(ureq, HomeSite.class.getName(), "bookmarks");
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      dts.activateStatic(ureq, HomeSite.class.getName(), "bookmarks");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.