Examples of DTab


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

        //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.
       */
 
View Full Code Here

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

          // 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
View Full Code Here

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

      final CourseConfig cc = courseEnvir.getCourseConfig(); // do not cache cc, not save
     
      // if glossary had been opened from LR as Tab before, warn user:
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(cc.getGlossarySoftKey(), false);
      DTab dt = dts.getDTab(repoEntry.getOlatResource());
      if (dt != null) {
        dts.activate(ureq, dt, ((Boolean)allowGlossaryEditing).toString());
      } else {
        ControllerCreator ctrlCreator = new ControllerCreator() {
          public Controller createController(UserRequest lureq, WindowControl lwControl) {
View Full Code Here

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

    }
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(resName, resId);
    String title = NotificationsManager.getInstance().getNotificationsHandler(sub.getPublisher()).createTitleInfo(sub, ureq.getLocale());
    // Launch in dtab
    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, title);
      if (dt == null) {
        // huh, no tabs available? don't know what to do here
        return;
      }
      Controller launchController = ControllerFactory.createLaunchController(ores, subidentifier, ureq, dt.getWindowControl(), false);
      // Try with the new factory controller too
      boolean newFactory = false;
      if (launchController == null) {
        try {
          String resourceUrl = "[" + resName + ":0][notifications]";
          BusinessControl bc = BusinessControlFactory.getInstance().createFromString(resourceUrl);
          WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, windowControl);
          NewControllerFactory.getInstance().launch(ureq, bwControl);
          newFactory = true;
        } catch (Exception ex) {
          // fail silently
        }
      }
      if (newFactory) {
        // hourra
      } else if (launchController == null) { // not possible to launch anymore
        Translator trans = Util.createPackageTranslator(NotificationUIFactory.class, ureq.getLocale());
        windowControl.setWarning(trans.translate("warn.nolaunch"));
      } else {
        dt.setController(launchController);
        dts.addDTab(dt);
        dts.activate(ureq, dt, null); // null: do not reactivate to a
        // certain view here, this
        // happened in
        // ControllerFactory.createLaunchController
View Full Code Here

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

    if (window == null) {
      logDebug("Found no window for jumpin => take WindowBackOffice", null);
      window = wControl.getWindowBackOffice().getWindow();
    }
    DTabs dts = (DTabs) window.getAttribute("DTabs");
    DTab dt = dts.getDTab(ores);
    if (dt != null) {
      // tab already open => close it
      dts.removeDTab(dt);// disposes also dt and controllers
    }

    String firstType = mainCe.getOLATResourceable().getResourceableTypeName();
    // String firstTypeId = ClassToId.getInstance().lookup() BusinessGroup
    ContextEntryControllerCreator typeHandler = contextEntryControllerCreators.get(firstType);
    if (typeHandler == null) throw new AssertException("Unable to get a handler for the type: " + firstType);

    String siteClassName = typeHandler.getSiteClassName(mainCe);
    // open in existing site
    if (siteClassName != null) {
      // use special activation key to trigger the activate method
      String viewIdentifyer = null;
      if (bc.hasContextEntry()) {
        ContextEntry subContext = bc.popLauncherContextEntry();
        if (subContext != null) {
          OLATResourceable subResource = subContext.getOLATResourceable();
          if (subResource != null) {
            viewIdentifyer = subResource.getResourceableTypeName();
            if (subResource.getResourceableId() != null) {
              // add resource instance id if available. The ':' is a common
              // separator in the activatable interface
              viewIdentifyer = viewIdentifyer + ":" + subResource.getResourceableId();
            }
          }
        }
      } else if (!ceConsumed) {
        //the olatresourceable is not in a dynamic tab but in a fix one
        if(ores != null) {
          viewIdentifyer = ores.getResourceableTypeName();
          if (ores.getResourceableId() != null) {
            // add resource instance id if available. The ':' is a common
            // separator in the activatable interface
            viewIdentifyer = viewIdentifyer + ":" + ores.getResourceableId();
          }
        }
      }
      dts.activateStatic(ureq, siteClassName, viewIdentifyer);
    } else {
      // or create new tab
      String tabName = typeHandler.getTabName(mainCe);
      // create and add Tab
      dt = dts.createDTab(ores, tabName);
      if (dt == null) {
        // tabs are full: TODO
        // user error message is generated in BaseFullWebappController, nothing
        // to do here
      } else {

        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, dt.getWindowControl());
        Controller launchC = typeHandler.createController(mainCe, ureq, bwControl);

        dt.setController(launchC);
        dts.addDTab(dt);
      }

      dts.activate(ureq, dt, null); // null: do not activate to a certain view
    }
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.