Package org.apache.myfaces.trinidad.context

Examples of org.apache.myfaces.trinidad.context.RequestContext$StubWindowManagerFactory


    {
      _delegate.handleNavigation(context, fromAction, outcome);
      return;
    }
    RequestContext afc = RequestContext.getCurrentInstance();
   
    // We are interested for "dialog:" prefixed outcomes
    if ((outcome != null) && (outcome.startsWith(afc.getDialogService().getDialogNavigationPrefix())))
    {
      // Handle "dialog:" URLs
     
      // First we try find a classic navigation case from faces-config.xml
      NavigationCase navigationCase = getNavigationCase(context, fromAction, outcome);
     
      // Then if there is no rule (but we are in dialog here) try interpret
      // outcome as view id - JSF 2.0 Implicit Navigation.
      if (navigationCase == null)
      {
        navigationCase = getNavigationCase(context, fromAction,
            outcome.substring(afc.getDialogService().getDialogNavigationPrefix().length()));
      }
     
      UIViewRoot newRoot = null;
      UIViewRoot oldRoot = context.getViewRoot();
     
      if (navigationCase == null)
      {
        // Execute the old (pre-ConfigurableNavigation) code in case the navigation case
        // could not be determined
       
        // ViewMap is cleared during navigation, so save it here (we will be undoing the navigation
        // by restoring the old view root below)
        Map<String,Object> viewMap = oldRoot.getViewMap(false);
        Map<String,Object> cloneMap = (viewMap == null) ? null : new HashMap<String, Object>(viewMap);
       
        _delegate.handleNavigation(context, fromAction, outcome);
       
        newRoot = context.getViewRoot();
       
        if (newRoot != oldRoot)
        {
          // Navigate back to the original root
          context.setViewRoot(oldRoot);
         
          // Restore the old ViewMap because it gets cleared during setViewRoot()
          if (cloneMap != null)
          {
            oldRoot.getViewMap().putAll(cloneMap);
          }
        }
      }
      else
      {
        newRoot = context.getApplication().getViewHandler().createView(context, navigationCase.getToViewId(context));
      }
    
      if (newRoot != oldRoot)
      {
        // Give ourselves a new page flow scope
        afc.getPageFlowScopeProvider().pushPageFlowScope(context, true);
        // And ask the component to launch a dialog
        afc.getDialogService().queueLaunchEvent(newRoot);
      }
    }
    else
    {
       // not a dialog, call the wrapped NavigationHandler
View Full Code Here



  private Object _saveStateToCache(FacesContext context, Object viewState, UIViewRoot root)
  {
    ExternalContext extContext = context.getExternalContext();
    RequestContext trinContext = RequestContext.getCurrentInstance();

    TokenCache cache = _getViewCache(trinContext, extContext);
    assert(cache != null);

View Full Code Here

      PageState viewState = _getPageState(extContext, token);

      if (viewState != null)
        _updateRequestTokenForResponse(context, token);

      RequestContext trinContext = RequestContext.getCurrentInstance();

      // Make sure that if the view state is present, the cache still
      // has the token, and vice versa

      // NOTE: it's very important that we call through to the
View Full Code Here

   * @param context
   * @return
   */
  public static boolean isPartialRequest(FacesContext context)
  {
    RequestContext rc = RequestContext.getCurrentInstance();
    if (rc == null)
      return false;
    boolean isPartial = rc.isPartialRequest(context);
   
    if (isPartial && context.getPartialViewContext().isRenderAll())
    {
      // We do not want to create PartialPageContext and use the tree visit (if enabled)
      // for the 'render all' <f:ajax> case
View Full Code Here

  /**
   * Choose a RenderKit for the current request.
   */
  static public String chooseRenderKit(FacesContext context)
  {
    RequestContext afc = RequestContext.getCurrentInstance();
    // According to the spec FacesContext can be null.
    // In that case RequestContext could also be null.
    // bug 4695929:
    if (afc != null)
    {
      // TODO: Obviously, this cheesy algorithm is not quite enough!
      Agent agent = afc.getAgent();
      if (Agent.TYPE_PDA.equals(agent.getType()))
        return "org.apache.myfaces.trinidad.core.pda";
    }
    return "org.apache.myfaces.trinidad.core.desktop";
  }
View Full Code Here

      RequestContext.getCurrentInstance().getPageFlowScope();
   
    if (processParameters != null)
      pageFlowScope.putAll(processParameters);

    RequestContext rc = RequestContext.getCurrentInstance();
    DialogRequest request = new DialogRequest(targetRoot,
                                              sourceId,
                                              formId,
                                              windowProperties,
                                              usePopupForDialog(context, rc));
View Full Code Here

        out.write("parent.TrPopupDialog._returnFromDialog();");
        out.write("</script>");
      }
      else
      {
        RequestContext afC = RequestContext.getCurrentInstance();

        String returnId = (String) afC.getPageFlowScope().get(_RETURN_ID);

        if (returnId == null)
          throw new IllegalStateException(_LOG.getMessage(
            "NO_RETURNID_AVAILABLE_FOR_RETURNING_FROM_DIALOG"));
View Full Code Here


  static private ResponseWriter _addDebugResponseWriters(
     ResponseWriter responseWriter)
  {
    RequestContext requestContext = RequestContext.getCurrentInstance();
    if (requestContext.isDebugOutput())
    {
      responseWriter = new IndentingResponseWriter(responseWriter);
      responseWriter = new DebugResponseWriter(responseWriter);
      if ("text/html".equals(responseWriter.getContentType()))
        responseWriter = new DebugHtmlResponseWriter(responseWriter);
View Full Code Here

  static public final String EMPTY_STYLE_CLASS = "";

  public CoreRenderingContext()
  {
    FacesContext context = FacesContext.getCurrentInstance();
    RequestContext afContext = RequestContext.getCurrentInstance();

    _facesContext = context;
    _requestContext = afContext;
   
    _properties = new HashMap<Object, Object>();

    _outputMode = afContext.getOutputMode();
    _agent = _initializeAgent(context,
                              afContext.getAgent(),
                              // Go back through getOutputMode()
                              // in case anyone has overidden getOutputMode()
                              getOutputMode());

    _initializeSkin(context, afContext);
    _initializePPR(context, afContext);
    // Get and cache (since it can be EL-bound)
    _accessibilityMode = afContext.getAccessibilityMode();
    _animationEnabled = afContext.isAnimationEnabled();

    // Initialize the accessibility profile, providing a default
    // instance if necessary.
    _accessibilityProfile = afContext.getAccessibilityProfile();
    if (_accessibilityProfile == null)
      _accessibilityProfile = AccessibilityProfile.getDefaultInstance();
  }
View Full Code Here

     if (conv instanceof javax.faces.convert.DateTimeConverter)
        tZone = ((javax.faces.convert.DateTimeConverter)conv).getTimeZone();
     
     if (tZone == null)
     {
       RequestContext context = RequestContext.getCurrentInstance();
       if (context == null)
       {
         _LOG.warning("NO_REQUESTCONTEXT_TIMEZONE_DEFAULT");
       }
       else
       {
         tZone = context.getTimeZone();
       }

       // If RequestContext is null or if it returns a null,
       // then set it to the default time zone which is GMT time zone
       if (tZone == null)
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.context.RequestContext$StubWindowManagerFactory

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.