Package org.olat.core.gui.control.generic.dtabs

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


     * TODO:pb discuss with HJZ multi window concept.
     */
   
    // detach DTabs implementation from the controller - DTabs may be fetched from the window and locked on (synchronized access).
    // if this is controller the controller is locked instead of only the DTabs part.
    myDTabsImpl = new DTabs() {

      public void activate(UserRequest ureq, DTab dTab, String viewIdentifier) {
        BaseFullWebappController.this.activate(ureq, dTab, viewIdentifier);
      }

View Full Code Here


   */
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == showAllLink){
      // activate homes tab in top navigation and active efficiencyStatements menu item
      //was brasato:: getWindowControl().getDTabs().activateStatic(ureq, HomeSite.class.getName(), "efficiencyStatements");
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      dts.activateStatic(ureq, HomeSite.class.getName(), "efficiencyStatements");
    } else if (event == ComponentUtil.VALIDATE_EVENT && needReloadModel) {     
      reloadModel(sortingCriteria);
    }
  }
View Full Code Here

   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == showAllLink){
      // activate homes tab in top navigation and active notes menu item
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      //was brasato:: getWindowControl().getDTabs().activateStatic(ureq, HomeSite.class.getName(), "note");
      dts.activateStatic(ureq, HomeSite.class.getName(), "note");
    }
  }
View Full Code Here

   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == showAllLink){
      // activate homes tab in top navigation and active bookmarks menu item
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      //was brasato:: getWindowControl().getDTabs().activateStatic(ureq, HomeSite.class.getName(), "adminnotifications");
      dts.activateStatic(ureq, HomeSite.class.getName(), "adminnotifications");
    } else if (event == ComponentUtil.VALIDATE_EVENT && needsModelReload) {
      //updateTableModel(ureq.getLocale(), ureq.getIdentity());
      reloadModel(sortingCriteria);
      needsModelReload = false;
    }
View Full Code Here

              if (subidentifier.equals(CalendarController.ACTION_CALENDAR_GROUP)) {
                resName = BusinessGroupManagerImpl.getInstance().loadBusinessGroup(pub.getResId(), true).getResourceableTypeName();
              }
              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 {
                dts.activate(ureq, dt, subidentifier);
              }
            }
          }
        }
      }
View Full Code Here

        if (cc == null) throw new AssertException("logged in, but no window/Chiefcontroller 'olatmain' found!");
        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 {
            // case C) opened dyn tab found, activate the dyn tab
            dts.activate(ureq, dt, jh.extractActiveViewId(ureq));
          }
        }
        // render the window
        Window w = cc.getWindow();
        w.dispatchRequest(ureq, true); // renderOnly
View Full Code Here

    } else if (source == mainVC && event.getCommand().equals("command.glossary")){
      // start glossary in window
      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) {
            GlossaryMainController glossaryController = CourseGlossaryFactory.createCourseGlossaryMainRunController(lwControl, lureq, cc,
                allowGlossaryEditing);
View Full Code Here

   *      org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == showAllLink) {
      String activationCmd = "cal." + new SimpleDateFormat("yyyy.MM.dd").format(new Date());
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      //was brasato:: getWindowControl().getDTabs().activateStatic(ureq, HomeSite.class.getName(), activationCmd);
      dts.activateStatic(ureq, HomeSite.class.getName(), activationCmd);
    } else if (event == ComponentUtil.VALIDATE_EVENT && dirty) {
      List events = getMatchingEvents(ureq, getWindowControl());
      tableController.setTableDataModel(new EventsModel(events, ureq.getLocale(), trans));
    }
  }
View Full Code Here

      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());
       
      } else if (action.equals(CategoriesListModel.ACTION_DELETE)) {
        // remove selected entry from the data model
        CatalogManager cm = CatalogManager.getInstance();
        List<CatalogEntry> children = cm.getChildrenOf(selectedCategoryLevel);
View Full Code Here

        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);
          dts.activateStatic(ureq, HomeSite.class.getName(), activationCmd);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.core.gui.control.generic.dtabs.DTabs

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.