Examples of DTab


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

      String mC = link.getCommand().substring(0, 1);
      if (mC.equals("t")) { // activate normal tab
        SiteInstance s = (SiteInstance) link.getUserObject();
        activateSite(s, ureq, null);
      } else if (mC.equals("a")) { // activate dyntab
        DTab dt = (DTab) link.getUserObject();
        doActivateDTab((DTabImpl) dt);
      } else if (mC.equals("u")) { // undock dyntab
        // TODO:fj:c look at undock feature
      } else if (mC.equals("c")) { // close dyntab
        DTab dt = (DTab) link.getUserObject();
        requestCloseTab(dt);
      }
    } else if (source == getWindowControl().getWindowBackOffice().getWindow()) {
      //OLAT BACK-FORWARD Handling -> Prevent any back forward until 80% handles back-forward as defined
      //see adjustState
View Full Code Here

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

    if (tabIndex > -1) {
      // Event comes from a controller in a dtab. Check if the controller is
      // finished and close the tab. Cancel and failed is interpreted as
      // finished.
      if (event == Event.DONE_EVENT || event == Event.CANCELLED_EVENT || event == Event.FAILED_EVENT) {
        DTab tab = dtabs.get(tabIndex);
        removeDTab(tab);//disposes also tab and controllers
      }
    }

  }
View Full Code Here

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

  /**
   * @see org.olat.core.gui.control.generic.dtabs.DTabs#getDTab(org.olat.core.id.OLATResourceable
   */
  public DTab getDTab(OLATResourceable ores) {
    for (Iterator it_dts = dtabs.iterator(); it_dts.hasNext();) {
      DTab dtab = (DTab) it_dts.next();
      if (OresHelper.equals(dtab.getOLATResourceable(), ores)) return dtab;
    }
    return null;
  }
View Full Code Here

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

  /**
   * @see org.olat.core.gui.control.generic.dtabs.DTabs#addDTab(org.olat.core.gui.control.generic.dtabs.DTab)
   */
  public void addDTab(DTab dt) {
    // FIXME:fj:restrict to say 7 elements
    DTab old = getDTab(dt.getOLATResourceable());
    if (old != null) throw new AssertException("dtabs already contained: " + old);
    // add to tabs list
    synchronized (dtabs) {
      // make dtabs and dtabsControllers access synchronized
      dtabs.add(dt);
View Full Code Here

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

        activateSite(s, ureq, null);
        break;
      case 'd': // dynamic tab selection
        String oresString = state.substring(1);
        for (int i = 0; i < dtabs.size(); i++) {
          DTab dt = dtabs.get(i);
          if (oresString.equals(OresHelper.createStringRepresenting(dt.getOLATResourceable()))) {
            doActivateDTab((DTabImpl) dt);
            break;
          }
          // if no matching dtabs were found - do nothing, since that means the
          // tab was closed and we cannot "browserback" to it again.
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(pub).createTitleInfo(sub, getLocale());
              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, title);
                if (dt == null) 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, getWindowControl());
                    NewControllerFactory.getInstance().launch(ureq, bwControl);
                    newFactory = true;
                  } catch (Exception ex) {
                    //fail silently
                  }
                }
               
                if(newFactory) {
                  //hourra
                }
                else if (launchController == null) {
                  // not possible to launch anymore
                  getWindowControl().setWarning(getTranslator().translate("warn.nolaunch"));
                } else {
                  dt.setController(launchController);
                  dts.addDTab(dt);
                  // null: do not reactivate to a certain view here, this happened in ControllerFactory.createLaunchController
                  dts.activate(ureq, dt, null);
                }
              } else {
View Full Code Here

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

        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.DTab

        WindowControl wControl = cc.getWindowControl();

        // add to tabs
        DTabs dts = (DTabs)wControl.getWindowBackOffice().getWindow().getAttribute(D_TABS);
        synchronized (dts) { //o_clusterok per:fj user session
          DTab dt = dts.getDTab(ores);
          if (dt == null) {
            // no dynamic tab found, lets see if the ores implements the SiteInstance interface.
            boolean isSiteInstance;
            try {
              // try to load class from ores resource type name and try to cast it to SiteInstance
              Class site = ores.getClass().getClassLoader().loadClass(ores.getResourceableTypeName());
              site.asSubclass(SiteInstance.class);
              // ok, casting did not fail, must be a site then
              isSiteInstance = true;
            } catch (Exception e) {
              // casting failed, not a site
              isSiteInstance = false;
            }
           
            if (isSiteInstance) {
              // case A) is a site: create view identifyer for this jump in to the site
              JumpInResult jres = jh.createJumpInResult(ureq, cc.getWindowControl());
              dts.activateStatic(ureq, ores.getResourceableTypeName(), jres.getInitialViewIdentifier());             
            } else {
              // case B) no site and no opened tab -> create and add
              dt = dts.createDTab(ores, title);
              if (dt == null) { // tabs are full
                //create dtabs already issues a warning message 
              } else {
                JumpInResult jres = jh.createJumpInResult(ureq, dt.getWindowControl());
                Controller resC = jres.getController();
                if (resC == null) { // the resource was not found or user is not
                  // allowed to start the resource
                  DispatcherAction.sendNotFound(request.getRequestURI(), response);
                  return;
                }
                dt.setController(resC);
                dts.addDTab(dt);
                dts.activate(ureq, dt, null); // null: do not activate controller
              }             
            }
          } else {
View Full Code Here

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

        Identity chosenIdentity = (Identity) userObject;
        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.DTab

    BusinessGroupMainRunController bgMrc = null;

    OLATResourceable ores = businessGroup;
    DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
    //was brasato:: DTabs dts = wControl.getDTabs();
    DTab dt = dts.getDTab(ores);
    if (dt == null) {
      // does not yet exist -> create and add
      dt = dts.createDTab(ores, displayName);
      // tabs full
      if (dt == null) return null;
      bgMrc = this.createRunControllerFor(ureq, dt.getWindowControl(), businessGroup, isGMAdmin, initialViewIdentifier);
      dt.setController(bgMrc);
      dts.addDTab(dt);
    }
    dts.activate(ureq, dt, null); // null: do not activate to a certain view
    return bgMrc;
  }
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.