Examples of GUIPath


Examples of org.olat.core.gui.control.state.GUIPath

    // when the user presses the back-button of the browser, he/she expects that some change on the screen happens)
   
    // VALIDATE events are special events which are to be ignored here - they are no user-dispatched events, but a result thereof.
    if (event == ComponentUtil.VALIDATE_EVENT) return;
   
    GUIPath guiPath = new GUIPathImpl();
    WindowControlInfo curwcI;
    if (newWci == null) {
      curwcI = wControl.getWindowControlInfo();
    } else {
      // take the special, supplied info
      curwcI = newWci;
      newWci = null;
    }
     
    WindowControlInfo prev = null;
    do {
      ExtendedControllerState state = curwcI.getExtendedControllerState();
      guiPath.addStateInfo(state);
      prev = curwcI;
    } while ((curwcI = curwcI.getParentWindowControlInfo()) != null);
    // the prev is now the windowcontrol with a null parent = the root
    // -> remember for later back-button handling/traversing
   
    if (rootWCI == null) {
      rootWCI = prev;
    } else if (rootWCI != prev) {
      //REVIEW:2008-02-28 PB: this happens for example in DOCKCONTROLLER in popuwindow
      //REVIEW:2008-02-28 PB: gets important for BackHandling
      log.warn("WindowControlInfo different root now?? for Controller:"+controller.getClass().getCanonicalName());
      //throw new AssertException("different root now??");
    }
    // clear old forward gui paths if needed
    int esize = guipathentries.size();
    if (curGPpos < esize-1) { // we are not rightmost,
      // that is we have traversed back in history -> clear forward history of gui paths, because those are dumped by the browser. (concept of only having one forward path)
      guipathentries.subList(curGPpos+1, esize).clear();
      guipathentries.add(guiPath);
      //System.out.println("first guipath on click after back:"+guiPath.toString());
      curGPpos++;
    } else { // curGP >= esize-1
      if (esize > 0) {
        // only add the new guipath if it is not the same as the previous
        // (meaning that no state change occured and thus should not be remembered -
        // we don't user to experience "nothing" when they press the browser back button)
        GUIPath latestGP = guipathentries.get(esize-1);
        if (!guiPath.isSame(latestGP)) {
          guipathentries.add(guiPath);
          //System.out.println("new guipath:"+guiPath.toString());
          curGPpos++;
        } else {
View Full Code Here

Examples of org.olat.core.gui.control.state.GUIPath

          //throw new AssertException("back, but no entries??");
          // this case can happen when the user presses reload on the first page after the login (olat home page)
          return;
        }
        // get the guipath to restore our state : the latest one is the current one which needs to be backed
        GUIPath guiPath = guipathentries.get(curGPpos);
        curGPpos--;
        //System.out.println("backing using guipath:"+guiPath);
        adjustState(true, rootWCI, guiPath, ureq);     
      } else if (diff > 0) { // handle FORWARD case
        // ignore when we have reached then end of the history.
        // when e.g. a user traverses back in history using one click, but traverses more than one step, then olat can only detect "back", but
        // not how much (it could be done, but 99,9% the use case I guess to be the "normal" back, that is, hitting the browser back button (maybe repeatedly)).
        // so the browser may offer the "forward" button, even though we cannot forward.
        if (curGPpos == esize-1) return;
        GUIPath guiPath = guipathentries.get(curGPpos+1);
        //System.out.println("forwarding using guipath:"+guiPath);
        curGPpos++;
        adjustState(false, rootWCI, guiPath, ureq)
      }
    }
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.