Package org.olat.core.gui.components.tabbedpane

Examples of org.olat.core.gui.components.tabbedpane.TabbedPaneChangedEvent


   */
  @Override
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source == tabbedPane) {
      if (event instanceof TabbedPaneChangedEvent) {
        TabbedPaneChangedEvent tabbedEvent = (TabbedPaneChangedEvent) event;
        // Lazy initialize the notification subscription controller when the
        // user clicks the tab the first time
        if (tabbedEvent.getNewComponent() == subscriptionPanel && subscriptionCtr == null) {
          subscriptionCtr = NotificationUIFactory.createSubscriptionListingController(subscriberIdentity, ureq, getWindowControl());
          listenTo(subscriptionCtr);
          subscriptionPanel.setContent(subscriptionCtr.getInitialComponent());
        }
        // Lazy initialize the notification subscription controller when the
        // user clicks the tab the first time
        else if (tabbedEvent.getNewComponent() == rssPanel && rssPanel.getContent() == null) {
          VelocityContainer notificationsRssVC = createVelocityContainer("notificationsRSS");
          String rssLink = RSSUtil.getPersonalRssLink(ureq);
          notificationsRssVC.contextPut("rssLink", rssLink);
          User user = subscriberIdentity.getUser();
          String fullName = user.getProperty(UserConstants.FIRSTNAME, getLocale()) + " " + user.getProperty(UserConstants.LASTNAME, getLocale());
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 (event instanceof TabbedPaneChangedEvent) {
      TabbedPaneChangedEvent tabbedPaneEvent = (TabbedPaneChangedEvent) event;
      if (feedbackPanel.equals(tabbedPaneEvent.getNewComponent())) {
        if (feedbackCtr != null) removeAsListenerAndDispose(feedbackCtr);
        feedbackCtr = new FeedbackFormController(ureq, getWindowControl(), qtiPackage, item, restrictedEdit);
        // feedback controller sends out NodeBeforeChangeEvents which must be propagated       
        this.listenTo(feedbackCtr);
        feedbackPanel.setContent(feedbackCtr.getInitialComponent());
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 (event instanceof TabbedPaneChangedEvent) {
      TabbedPaneChangedEvent tpcEvent = (TabbedPaneChangedEvent) event;
      if (tpcEvent.getNewComponent() == mainPanel) main.contextPut("itemPreview", getQuestionPreview(item));
    }
  }
View Full Code Here

       * tabbed pane events
       ************************************************************************/
      // first release a potential lock on this page. only when the edit tab is acitve
      // a lock will be created. in all other cases it is save to release an existing lock
      doReleaseEditLock();
      TabbedPaneChangedEvent tabEvent = (TabbedPaneChangedEvent) event;
      Component comp = tabEvent.getNewComponent();
      String compName = comp.getComponentName();
      if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED)) {
        updatePageContext(page);
      }
      if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_article")) {
View Full Code Here

    myErrors.contextPut("mymm", err_mm);
    myErrors.contextPut("myyyyy", err_yyyy);
    myErrors.contextPut("olat_formatter", Formatter.getInstance(ureq.getLocale()));
    myErrors.contextPut("example_error", "N" + CoordinatorManager.getCoordinator().getNodeId() + "-E12, N" + CoordinatorManager.getCoordinator().getNodeId() + "-E64..." );
    //FIXME:fj:b do not use this call
    event(ureq, tabbedPane, new TabbedPaneChangedEvent(null, mySessions));
  }
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 == tabbedPane) { // those must be links
      TabbedPaneChangedEvent tbcEvent = (TabbedPaneChangedEvent)event;
      Component newComponent = tbcEvent.getNewComponent();
      if (newComponent == cachePanel) {
        if (cacheController != null) {
          cacheController.dispose();
        }
        cacheController = new AllCachesController(ureq, getWindowControl());
        cachePanel.setContent(cacheController.getInitialComponent());
      }
      else if (newComponent == infoMsgCtrl.getInitialComponent()) {
       
      }
     
      else if (newComponent == mySysinfo) {
        Runtime r = Runtime.getRuntime();
        StringBuilder sb = new StringBuilder();
        appendFormattedKeyValue(sb, "Processors", new Integer(r.availableProcessors()));
        appendFormattedKeyValue(sb, "Total Memory", StringHelper.formatMemory(r.totalMemory()));
        appendFormattedKeyValue(sb, "Free Memory", StringHelper.formatMemory(r.freeMemory()));
        appendFormattedKeyValue(sb, "Max Memory", StringHelper.formatMemory(r.maxMemory()));
        int controllerCnt = DefaultController.getControllerCount();
        sb.append("<br />Controller Count (active and not disposed):"+controllerCnt);
        sb.append("<br />Concurrent Dispatching Threads: "+DispatcherAction.getConcurrentCounter());
        mySysinfo.contextPut("memory", sb.toString());
        mySysinfo.contextPut("threads",getThreadsInfo());
        mySysinfo.contextPut("javaenv", getJavaenv());
       
      }
      else if (newComponent == usessC.getInitialComponent()) {
        usessC.reset();
      }
      else if (newComponent == myMultiUserEvents) {
        StringBuilder sb = new StringBuilder();
        Map infocenter = CoordinatorManager.getCoordinator().getEventBus().getUnmodifiableInfoCenter();
        int cntRes = infocenter.size();
        // cluster::: sort the entries (table?): sort by count and name
        // REVIEW:2008-12-11:pb access ea.getListenerCount -> possible dead lock
        // -> look for a different way to show info
        // see also OLAT-3681
        //
        /*
        sb.append("Total (possible weak-referenced) Resources: "+cntRes+" (showing only those with listeners, 'null' for a listener value meaning the OLAT system), count is cluster-wide, identities only vm-wide<br /><br />");
        for (Iterator it_ores = infocenter.entrySet().iterator(); it_ores.hasNext();) {
          Map.Entry entry = (Map.Entry) it_ores.next();
          String oresDerivedString = (String) entry.getKey();
          EventAgency ea = (EventAgency) entry.getValue();
          Set listenIdentNames = ea.getListeningIdentityNames();
          if (listenIdentNames.size() > 0) {
            sb.append("<b>Resource:</b> [").append(ea.getListenerCount()).append("] on ").append(oresDerivedString).append("<br />Listeners: ");
            for (Iterator it_id = listenIdentNames.iterator(); it_id.hasNext();) {
              String login = (String) it_id.next();
              sb.append(login).append("; ");
            }
            sb.append("<br /><br />");
          }
        }
        */
        sb.append(" <a href=\"http://bugs.olat.org/jira/browse/OLAT-3681\">OLAT-3681</a> ");
        myMultiUserEvents.contextPut("info", sb.toString());
      }
      else  if (newComponent == sessionAdministrationController.getInitialComponent()) {
      }
      else if (newComponent == myHibernateInfo) {
        myHibernateInfo.contextPut("isStatisticsEnabled", DBFactory.getInstance(false).getStatistics().isStatisticsEnabled());
        myHibernateInfo.contextPut("hibernateStatistics", DBFactory.getInstance(false).getStatistics());
      }      
      else if (newComponent == myLocks) {
        StringBuilder sb = new StringBuilder();
        List<LockEntry> locks = CoordinatorManager.getCoordinator().getLocker().adminOnlyGetLockEntries();
        for (LockEntry entry : locks) {
          sb.append("user "+entry.getOwner().getName()+" owns lock on "+entry.getKey()+"<br /><br />");         
        }
        myLocks.contextPut("locks", sb.toString());
      }
      else if (newComponent == myLoglevels) {
        List loggers = Tracing.getLoggersSortedByName(); // put it in a list in case of a reload (enum can only be used once)
        myLoglevels.contextPut("loggers", loggers);
     
      }
      else if (newComponent == mySnoop) {
        mySnoop.contextPut("snoop", getSnoop(ureq));
      }
    }
    else if (source == myLoglevels) {
      if (event.getCommand().equals(ACTION_SETLEVEL)) {
        String level = ureq.getHttpReq().getParameter("level");
        String logger = ureq.getHttpReq().getParameter("logger");
        if (logger.equals(org.olat.core.logging.Tracing.class.getName())) {
          getWindowControl().setError("log level of "+org.olat.core.logging.Tracing.class.getName()+" must not be changed!");
          return;
        }
        Level l;
        if (level.equals("debug")) l = Level.DEBUG;
        else if (level.equals("info")) l = Level.INFO;
        else if (level.equals("warn")) l = Level.WARN;
        else l = Level.ERROR;
       
        Tracing.setLevelForLogger(l, logger);
        getWindowControl().setInfo("Set logger " + logger + " to level " + level);
       
      } else if (event.getCommand().equals(ACTION_VIEWLOG)) {
        String toBeViewed = ureq.getParameter(ACTION_VIEWLOG_PACKAGE);
        if (toBeViewed == null) return; // should not happen
        if (logViewerCtr != nulllogViewerCtr.dispose();
        logViewerCtr = new LogRealTimeViewerController(ureq, getWindowControl(), toBeViewed, Level.ALL, true);
        if (cmc != nullcmc.dispose();
        cmc = new CloseableModalController(getWindowControl(), getTranslator().translate("close"), logViewerCtr.getInitialComponent());
        cmc.addControllerListener(this);
        cmc.activate();
      }
      // push loglevel list again
      event(ureq, tabbedPane, new TabbedPaneChangedEvent(null, myLoglevels));
    }
    else if (source == resetloglevelsButton){
      Tracing.setLevelForAllLoggers(Level.INFO);
      getWindowControl().setInfo("All loglevels set to INFO");
    }
    else if (source == gcButton){
      Runtime.getRuntime().gc();
      getWindowControl().setInfo("Garbage collection done.");
      event(ureq, tabbedPane, new TabbedPaneChangedEvent(null, mySysinfo));
    }
    else if (source == myErrors) {
      HttpServletRequest hreq = ureq.getHttpReq();
      err_nr = hreq.getParameter("mynr");
      if (hreq.getParameter("mydd") != null)
        err_dd = hreq.getParameter("mydd");
      if (hreq.getParameter("mymm") != null)
        err_mm = hreq.getParameter("mymm");
      if (hreq.getParameter("myyyyy") != null)
        err_yyyy = hreq.getParameter("myyyyy");
      if (err_nr != null) {
        myErrors.contextPut("mynr", err_nr);
        LogFile lf = new LogFile();
        myErrors.contextPut("errormsgs", lf.getError(err_nr, err_dd, err_mm, err_yyyy, true));
      }

      myErrors.contextPut("highestError", Tracing.getErrorCount());
      myErrors.contextPut("mydd", err_dd);
      myErrors.contextPut("mymm", err_mm);
      myErrors.contextPut("myyyyy", err_yyyy);
      myErrors.contextPut("olat_formatter", Formatter.getInstance(ureq.getLocale()));

    }
    else if (source == enableHibernateStatisticsButton){
      DBFactory.getInstance(false).getStatistics().setStatisticsEnabled(true);
      myHibernateInfo.contextPut("isStatisticsEnabled", DBFactory.getInstance(false).getStatistics().isStatisticsEnabled());
      getWindowControl().setInfo("Hibernate statistics enabled.");
      event(ureq, tabbedPane, new TabbedPaneChangedEvent(null, myHibernateInfo));
    }
    else if (source == disableHibernateStatisticsButton){
      DBFactory.getInstance(false).getStatistics().setStatisticsEnabled(false);
      myHibernateInfo.contextPut("isStatisticsEnabled", DBFactory.getInstance(false).getStatistics().isStatisticsEnabled());
      getWindowControl().setInfo("Hibernate statistics disabled.");
      event(ureq, tabbedPane, new TabbedPaneChangedEvent(null, myHibernateInfo));
    }
    else if (source == clearHibernateStatisticsButton){
      DBFactory.getInstance(false).getStatistics().clear();
      getWindowControl().setInfo("Hibernate statistics clear done.");
      event(ureq, tabbedPane, new TabbedPaneChangedEvent(null, myHibernateInfo));
    }
  }
View Full Code Here

  public void event(UserRequest ureq, Component source, Event event) {
    if (source == pane) {
      if (event instanceof TabbedPaneChangedEvent) {
        // prepare links tab
        TabbedPaneChangedEvent tpce = (TabbedPaneChangedEvent)event;
        if (tpce.getNewComponent().equals(linkVC)) {
          // display link provider if any
          String calendarID = eventForm.getChoosenKalendarID();
          KalendarRenderWrapper calendarWrapper = null;
          for (Iterator iter = availableCalendars.iterator(); iter.hasNext();) {
            calendarWrapper = (KalendarRenderWrapper) iter.next();
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.tabbedpane.TabbedPaneChangedEvent

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.