Package com.sun.faces.component

Examples of com.sun.faces.component.CompositeComponentStackManager


            if (COMPOSITE_COMPONENT_PARENT_NAME.equals(propertyName)) {
                UIComponent c = (UIComponent) base;
                context.setPropertyResolved(true);
                FacesContext ctx = (FacesContext)
                      context.getContext(FacesContext.class);
                CompositeComponentStackManager m =
                      CompositeComponentStackManager.getManager(ctx);
                UIComponent ccp = m.getParentCompositeComponent(TreeCreation,
                                                                ctx,
                                                                c);
                if (ccp == null) {
                    m.getParentCompositeComponent(Evaluation,
                                                  ctx,
                                                  c);
                }
                return ccp;
            }


                    // however, this isn't desirable behavior when passing
                    // attributes between nested composite components, so we
                    // need to alter the behavior so that the components behave
                    // as the user would expect.
                    /* BEGIN DEVIATION */
                    CompositeComponentStackManager manager =
                          CompositeComponentStackManager.getManager(facesContext);
                    Object o = manager.peek();
                    /* END DEVIATION */
                    if (o == null) {
                        o = UIComponent.getCurrentCompositeComponent(facesContext);
                    }
                    context.setPropertyResolved(o != null);

            // hook method
            owner.onComponentCreated(ctx, c, parent);
        }
        c.pushComponentToEL(ctx.getFacesContext(), c);
        boolean compcompPushed = false;
        CompositeComponentStackManager ccStackManager =
              CompositeComponentStackManager.getManager(ctx.getFacesContext());
        if (UIComponent.isCompositeComponent(c)) {
            compcompPushed = ccStackManager.push(c, TreeCreation);
        }
        // first allow c to get populated
        owner.applyNextHandler(ctx, c);

        // finish cleaning up orphaned children
        if (componentFound) {
            ComponentSupport.finalizeForDeletion(c);
           
            if (getFacetName(ctx, parent) == null) {
                parent.getChildren().remove(c);
            }
        }

        this.privateOnComponentPopulated(ctx, c, parent);
        owner.onComponentPopulated(ctx, c, parent);
        // add to the tree afterwards
        // this allows children to determine if it's
        // been part of the tree or not yet
        ComponentSupport.addComponent(ctx, parent, c);
        c.popComponentFromEL(ctx.getFacesContext());
        if (compcompPushed) {
            ccStackManager.pop(TreeCreation);
        }

        if (shouldMarkInitialState(ctx.getFacesContext())) {
            c.markInitialState();
        }

            // hook method
            owner.onComponentCreated(ctx, c, parent);
        }

       CompositeComponentStackManager ccStackManager =
              CompositeComponentStackManager.getManager(context);
        boolean compcompPushed = pushComponentToEL(ctx, c, ccStackManager);

        if (ProjectStage.Development == context.getApplication().getProjectStage()) {
            ComponentSupport.setTagForComponent(context, c, this.owner.getTag());

    // ----------------------------------------------------- Private Methods


    private boolean pushCompositeComponent(FacesContext ctx) {

        CompositeComponentStackManager manager =
              CompositeComponentStackManager.getManager(ctx);
        UIComponent cc = null;

        if (location != null) {
            cc = manager.findCompositeComponentUsingLocation(ctx, location);
        } else {
            // We need to obtain the Location of the source expression in order
            // to find the composite component that needs to be available within
            // the evaluation stack.
            if (source instanceof TagValueExpression) {
                ValueExpression orig = ((TagValueExpression) source).getWrapped();
                if (orig instanceof ContextualCompositeValueExpression) {
                    cc = manager.findCompositeComponentUsingLocation(ctx, ((ContextualCompositeValueExpression) orig).getLocation());
                }
            }
        }

        return manager.push(cc);

    }

    }


    private void popCompositeComponent(FacesContext ctx) {

        CompositeComponentStackManager manager =
              CompositeComponentStackManager.getManager(ctx);
        manager.pop();

    }

    // ----------------------------------------------------- Private Methods


    private boolean pushCompositeComponent(FacesContext ctx) {

        CompositeComponentStackManager manager =
              CompositeComponentStackManager.getManager(ctx);
        UIComponent cc = manager.findCompositeComponentUsingLocation(ctx, location);
        return manager.push(cc);

    }

    }


    private void popCompositeComponent(FacesContext ctx) {

        CompositeComponentStackManager manager =
              CompositeComponentStackManager.getManager(ctx);
        manager.pop();

    }

            if (COMPOSITE_COMPONENT_PARENT_NAME.equals(propertyName)) {
                UIComponent c = (UIComponent) base;
                context.setPropertyResolved(true);
                FacesContext ctx = (FacesContext)
                      context.getContext(FacesContext.class);
                CompositeComponentStackManager m =
                      CompositeComponentStackManager.getManager(ctx);
                UIComponent ccp = m.getParentCompositeComponent(TreeCreation,
                                                                ctx,
                                                                c);
                if (ccp == null) {
                    ccp = m.getParentCompositeComponent(Evaluation,
                                                        ctx,
                                                        c);
                }
                return ccp;
            }

            if (COMPOSITE_COMPONENT_PARENT_NAME.equals(propertyName)) {
                UIComponent c = (UIComponent) base;
                context.setPropertyResolved(true);
                FacesContext ctx = (FacesContext)
                      context.getContext(FacesContext.class);
                CompositeComponentStackManager m =
                      CompositeComponentStackManager.getManager(ctx);
                UIComponent ccp = m.getParentCompositeComponent(TreeCreation,
                                                                ctx,
                                                                c);
                if (ccp == null) {
                    ccp = m.getParentCompositeComponent(Evaluation,
                                                        ctx,
                                                        c);
                }
                return ccp;
            }

TOP

Related Classes of com.sun.faces.component.CompositeComponentStackManager

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.