Package javax.faces.component

Examples of javax.faces.component.UIViewRoot$ComponentResourceContainer


    renderSheet(facesContext, data, (clickAction != null || dblClickAction != null));

    writer.endElement(HtmlConstants.DIV);

    ResourceManager resourceManager = ResourceManagerFactory.getResourceManager(facesContext);
    UIViewRoot viewRoot = facesContext.getViewRoot();
    String contextPath = facesContext.getExternalContext().getRequestContextPath();

    String unchecked = contextPath + resourceManager.getImage(viewRoot, "image/sheetUnchecked.gif");
    String checked = contextPath + resourceManager.getImage(viewRoot, "image/sheetChecked.gif");
    boolean ajaxEnabled = TobagoConfig.getInstance(facesContext).isAjaxEnabled();
View Full Code Here


      writer.writeAttribute(HtmlAttributes.TYPE, "hidden", false);
      writer.writeAttribute(HtmlAttributes.VALUE, StringUtils.toString(selectedRows), false);
      writer.endElement(HtmlConstants.INPUT);
    }
    ResourceManager resourceManager = ResourceManagerFactory.getResourceManager(facesContext);
    UIViewRoot viewRoot = facesContext.getViewRoot();
    String contextPath = facesContext.getExternalContext().getRequestContextPath();

    //String checkedImage = contextPath + resourceManager.getImage(viewRoot, "image/sheetChecked.gif");
    //String uncheckeImage = contextPath + resourceManager.getImage(viewRoot, "image/sheetUnchecked.gif");
    String selectorDisabled = contextPath + resourceManager.getImage(viewRoot, "image/sheetUncheckedDisabled.gif");
View Full Code Here

     *
     * @param event
     * @param phaseIdType
     */
    private void performObservation(PhaseEvent event, PhaseIdType phaseIdType) {
        UIViewRoot viewRoot = (UIViewRoot) event.getFacesContext().getViewRoot();
        List<? extends Annotation> restrictionsForPhase = getRestrictionsForPhase(phaseIdType, viewRoot.getViewId());
        if (restrictionsForPhase != null) {
            log.debugf("Enforcing on phase %s", phaseIdType);
            enforce(event.getFacesContext(), viewRoot, restrictionsForPhase);
        }
    }
View Full Code Here

        return delegate.getViewId();
    }

    @Override
    public UIViewRoot createMetadataView(FacesContext context) {
        UIViewRoot viewRoot = null;

        try {
            viewRoot = delegate.createMetadataView(context);
        } catch (RuntimeException e) {
            // deal with swallowed exception in Mojarra
            logger.fatal(e.getMessage());
            throw e;
        }

        UIComponent metadataFacet = viewRoot.getFacet(UIViewRoot.METADATA_FACET_NAME);

        if (metadataFacet == null) {
            return viewRoot;
        }

        boolean foundViewParam = false;
        boolean foundOther = false;

        for (UIComponent candidate : metadataFacet.getChildren()) {
            if (candidate instanceof UIViewParameter) {
                foundViewParam = true;
            } else {
                foundOther = true;
            }
        }

        if (foundOther && !foundViewParam) {
            UIViewParameter placeholder = (UIViewParameter) context.getApplication().createComponent(
                    UIViewParameter.COMPONENT_TYPE);
            placeholder.setId(viewRoot.createUniqueId());
            placeholder.setName("");
            metadataFacet.getChildren().add(0, placeholder);
        }

        return viewRoot;
View Full Code Here


        if (valueExpression != null) {
          com.caucho.jsf.dev.JsfDeveloperAid.ViewRoot root = viewRoots[1];

          UIViewRoot uiViewRoot = new UIViewRoot();
          uiViewRoot.setLocale(root.getLocale());
          uiViewRoot.setRenderKitId(root.getRenderKitId());
          //need view for resolving property bundles.
          context.setViewRoot(uiViewRoot);

          printEvaluated(context,
                         request,
View Full Code Here

      sessionMap.put("caucho.jsf.developer.aid", aidMap);
    }

    try {
      final UIViewRoot uiViewRoot = context.getViewRoot();

      if (uiViewRoot != null) {
        final String viewId = uiViewRoot.getViewId();
        final String phaseId = event.getPhaseId().toString();

        final ViewRoot viewRoot = (ViewRoot) reflect(context, uiViewRoot);
        viewRoot.setPhase(phaseId);
View Full Code Here

  public void beforePhase(PhaseEvent event)
  {
    if (!PhaseId.RENDER_RESPONSE.equals(event.getPhaseId()))
      return;

    UIViewRoot viewRoot = FacesContext.getCurrentInstance().getViewRoot();

    if (viewRoot == null)
      return;

    JsfDeveloperAidLink link = new JsfDeveloperAidLink();

    link.setStyle(_developerAidLinkStyle);

    viewRoot.getChildren().add(link);
  }
View Full Code Here

  public Component reflect(FacesContext facesContext, UIComponent uiComponent)
  {
    final Component result;

    if (uiComponent instanceof UIViewRoot) {
      UIViewRoot uiViewRoot = (UIViewRoot) uiComponent;
      result = new ViewRoot();

      ViewRoot viewRoot = (ViewRoot) result;

      viewRoot.setLocale(uiViewRoot.getLocale());
      viewRoot.setRenderKitId(uiViewRoot.getRenderKitId());
    }
    else
      result = new Component();

    result._uiComponentClass = uiComponent.getClass().getSimpleName();
View Full Code Here

    @Override
    public UIViewRoot restoreView(FacesContext facesContext, String viewId, String renderKitId)
    {
        if (log.isLoggable(Level.FINEST)) log.finest("Entering restoreView - viewId: "+viewId+" ; renderKitId: "+renderKitId);

        UIViewRoot uiViewRoot = null;
       
        ViewDeclarationLanguage vdl = facesContext.getApplication().
            getViewHandler().getViewDeclarationLanguage(facesContext,viewId);
        StateManagementStrategy sms = null;
        if (vdl != null)
        {
            sms = vdl.getStateManagementStrategy(facesContext, viewId);
        }
       
        if (sms != null)
        {
            if (log.isLoggable(Level.FINEST)) log.finest("Redirect to StateManagementStrategy: "+sms.getClass().getName());
           
            uiViewRoot = sms.restoreView(facesContext, viewId, renderKitId);
        }
        else
        {
            RenderKit renderKit = getRenderKitFactory().getRenderKit(facesContext, renderKitId);
            ResponseStateManager responseStateManager = renderKit.getResponseStateManager();

            Object state = responseStateManager.getState(facesContext, viewId);

            if (state != null) {
                Object[] stateArray = (Object[])state;
                TreeStructureManager tsm = new TreeStructureManager();
                uiViewRoot = tsm.restoreTreeStructure(stateArray[0]);

                if (uiViewRoot != null) {
                    facesContext.setViewRoot (uiViewRoot);
                    uiViewRoot.processRestoreState(facesContext, stateArray[1]);
                }
            }           
        }
        if (log.isLoggable(Level.FINEST)) log.finest("Exiting restoreView - "+viewId);
View Full Code Here

     */
    @Override
    public Object saveView(FacesContext facesContext)
    {
        Object serializedView = null;
        UIViewRoot uiViewRoot = facesContext.getViewRoot();
        ResponseStateManager responseStateManager = facesContext.getRenderKit().getResponseStateManager();
       
        String viewId = uiViewRoot.getViewId();
        ViewDeclarationLanguage vdl = facesContext.getApplication().
            getViewHandler().getViewDeclarationLanguage(facesContext,viewId);
        if (vdl != null)
        {
            StateManagementStrategy sms = vdl.getStateManagementStrategy(facesContext, viewId);
           
            if (sms != null)
            {
                if (log.isLoggable(Level.FINEST)) log.finest("Calling saveView of StateManagementStrategy: "+sms.getClass().getName());
               
                serializedView = sms.saveView(facesContext);
               
                // If MyfacesResponseStateManager is used, give the option to do
                // additional operations for save the state if is necessary.
                if (StateCacheUtils.isMyFacesResponseStateManager(responseStateManager))
                {
                    StateCacheUtils.getMyFacesResponseStateManager(responseStateManager).saveState(facesContext, serializedView);
                }
               
                return serializedView;
            }
        }

        // In StateManagementStrategy.saveView there is a check for transient at
        // start, but the same applies for VDL without StateManagementStrategy,
        // so this should be checked before call parent (note that parent method
        // does not do this check).
        if (uiViewRoot.isTransient())
        {
            return null;
        }

        if (log.isLoggable(Level.FINEST)) log.finest("Entering saveSerializedView");
View Full Code Here

TOP

Related Classes of javax.faces.component.UIViewRoot$ComponentResourceContainer

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.