Examples of UIViewRoot


Examples of javax.faces.component.UIViewRoot

    public void writeState(FacesContext facesContext,
                           Object state) throws IOException
    {
        if (log.isLoggable(Level.FINEST)) log.finest("Entering writeState");

        UIViewRoot uiViewRoot = facesContext.getViewRoot();
        //save state in response (client)
        RenderKit renderKit = getRenderKitFactory().getRenderKit(facesContext, uiViewRoot.getRenderKitId());
        ResponseStateManager responseStateManager = renderKit.getResponseStateManager();

        responseStateManager.writeState(facesContext, state);

        if (log.isLoggable(Level.FINEST)) log.finest("Exiting writeState");
View Full Code Here

Examples of javax.faces.component.UIViewRoot

    @Override
    protected Object getComponentStateToSave(FacesContext facesContext)
    {
        if (log.isLoggable(Level.FINEST)) log.finest("Entering getComponentStateToSave");

        UIViewRoot viewRoot = facesContext.getViewRoot();
        if (viewRoot.isTransient())
        {
            return null;
        }

        Object serializedComponentStates = viewRoot.processSaveState(facesContext);
        //Locale is a state attribute of UIViewRoot and need not be saved explicitly
        if (log.isLoggable(Level.FINEST)) log.finest("Exiting getComponentStateToSave");
        return serializedComponentStates;
    }
View Full Code Here

Examples of javax.faces.component.UIViewRoot

     */
    @Override
    protected Object getTreeStructureToSave(FacesContext facesContext)
    {
        if (log.isLoggable(Level.FINEST)) log.finest("Entering getTreeStructureToSave");
        UIViewRoot viewRoot = facesContext.getViewRoot();
        if (viewRoot.isTransient())
        {
            return null;
        }
        TreeStructureManager tsm = new TreeStructureManager();
        Object retVal = tsm.buildTreeStructureToSave(viewRoot);
View Full Code Here

Examples of javax.faces.component.UIViewRoot

        if ((context == null) || (name == null))
        {
            throw new NullPointerException();
        }
        Locale locale = null;
        UIViewRoot viewRoot = context.getViewRoot();
        if (viewRoot != null)
        {
            locale = viewRoot.getLocale();
        }
        if (locale == null)
        {
            locale = Locale.getDefault();
        }
View Full Code Here

Examples of javax.faces.component.UIViewRoot

    @Attribute
    public Object getLocale() {
        Object locale = getStateHelper().eval(PropertyKeys.locale);
        if (locale == null) {
            FacesContext facesContext = getFacesContext();
            UIViewRoot viewRoot = facesContext.getViewRoot();
            if (viewRoot != null) {
                locale = viewRoot.getLocale();
            }
        }
        return locale != null ? locale : Locale.US;
    }
View Full Code Here

Examples of javax.faces.component.UIViewRoot

        recordMocks();
        facesEnvironment.replay();
    }

    protected void recordMocks() {
        UIViewRoot viewRoot = facesEnvironment.createMock(UIViewRoot.class);
        expect(viewRoot.getLocale()).andStubReturn(Locale.ENGLISH);
        expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(viewRoot);
        expect(input.getAttributes()).andStubReturn(Collections.EMPTY_MAP);
        expect(input.getClientId(facesEnvironment.getFacesContext())).andStubReturn(TEST_COMPONENT_ID);
    }
View Full Code Here

Examples of javax.faces.component.UIViewRoot

    return null;
  }

  @Override
  public UIViewRoot createView(FacesContext ctx, String viewId) {
    UIViewRoot viewRoot = new UIViewRoot();
      viewRoot.setViewId(viewId);
      //TODO: set locale?
      return viewRoot;
  }
View Full Code Here

Examples of javax.faces.component.UIViewRoot

  
   public static String getViewId(FacesContext facesContext)
   {
      if (facesContext!=null)
      {
         UIViewRoot viewRoot = facesContext.getViewRoot();
         if (viewRoot!=null) return viewRoot.getViewId();
      }
      return null;
   }
View Full Code Here

Examples of javax.faces.component.UIViewRoot

      private void restoreViewPhase()
      {
         phases.beforePhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, MockLifecycle.INSTANCE));
         try
         {
            UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, getViewId());
            facesContext.setViewRoot(viewRoot);
            Map restoredViewRootAttributes = facesContext.getViewRoot().getAttributes();
            if (conversationId != null)
            {
               if (isGetRequest())
View Full Code Here

Examples of javax.faces.component.UIViewRoot

            if (outcome==null)
            {
               fromAction = action.getMethodExpression().getExpressionString();
               result = true;
               outcome = Pages.toString( action.getMethodExpression().invoke() );
               UIViewRoot oldViewRoot = facesContext.getViewRoot();
               Pages.handleOutcome(facesContext, outcome, fromAction);
               if (facesContext.getResponseComplete() || oldViewRoot != facesContext.getViewRoot()) {
                  break;
               }
            }
            else
            {
               UIViewRoot oldViewRoot = facesContext.getViewRoot();
               Pages.handleOutcome(facesContext, outcome, fromAction);
               if (facesContext.getResponseComplete() || oldViewRoot != facesContext.getViewRoot()) {
                  break;
               }
            }
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.