Examples of VisitContext


Examples of javax.faces.component.visit.VisitContext

            // new VisitHint(s) yet - but still wish to know that they should be non-iterating
            // during state saving.  It should be removed at some point.
            facesContext.getAttributes().put(SKIP_ITERATION_HINT, true);

            Set<VisitHint> hints = EnumSet.of(VisitHint.SKIP_ITERATION);
            VisitContext visitContext = VisitContext.createVisitContext(facesContext, null, hints);
            root.visitTree(visitContext, new VisitCallback() {

                        public VisitResult visit(VisitContext context, UIComponent target) {
                            postRestoreStateEvent.setComponent(target);
                            target.processEvent(postRestoreStateEvent);
View Full Code Here

Examples of javax.faces.component.visit.VisitContext

         * Since we did not find it the cheaper way we need to assume there is a
         * UINamingContainer that does not prepend its ID. So we are going to
         * walk the tree to find it.
         */
        if (found.isEmpty()) {
            VisitContext visitContext = VisitContext.createVisitContext(context);
            context.getViewRoot().visitTree(visitContext, new VisitCallback() {

                public VisitResult visit(VisitContext visitContext, UIComponent component) {
                    VisitResult result = VisitResult.ACCEPT;
                    if (component.getClientId(visitContext.getFacesContext()).equals(clientId)) {
                        found.add(component);
                        result = VisitResult.COMPLETE;
                    }
                    return result;
                }
View Full Code Here

Examples of javax.faces.component.visit.VisitContext

         * Since we did not find it the cheaper way we need to assume there is a
         * UINamingContainer that does not prepend its ID. So we are going to
         * walk the tree to find it.
         */
        if (found.isEmpty()) {
            VisitContext visitContext = VisitContext.createVisitContext(context);
            context.getViewRoot().visitTree(visitContext, new VisitCallback() {

                public VisitResult visit(VisitContext visitContext, UIComponent component) {
                    VisitResult result = VisitResult.ACCEPT;
                    if (component.getClientId(visitContext.getFacesContext()).equals(clientId)) {
                        found.add(component);
                        result = VisitResult.COMPLETE;
                    }
                    return result;
                }
View Full Code Here

Examples of javax.faces.component.visit.VisitContext

            {
                try
                {
                    facesContext.getAttributes().put(SKIP_ITERATION_HINT, Boolean.TRUE);

                    VisitContext visitContext = VisitContext.createVisitContext(facesContext, null, null);
                    facet.visitTree(visitContext, new RefreshViewContext());
                }
                finally
                {
                    // We must remove hint in finally, because an exception can break this phase,
View Full Code Here

Examples of javax.faces.component.visit.VisitContext

        // new VisitHint(s) yet - but still wish to know that they should be non-iterating
        // during state saving.  It should be removed at some point.
        context.getAttributes().put(SKIP_ITERATION_HINT, true);

        Set<VisitHint> hints = EnumSet.of(VisitHint.SKIP_ITERATION);
        VisitContext visitContext = VisitContext.createVisitContext(context, null, hints);
        final FacesContext finalContext = context;
        try {
            viewRoot.visitTree(visitContext, new VisitCallback() {
                public VisitResult visit(VisitContext context, UIComponent target) {
                    VisitResult result = VisitResult.ACCEPT;
View Full Code Here

Examples of javax.faces.component.visit.VisitContext

                // new VisitHint(s) yet - but still wish to know that they should be non-iterating
                // during state saving.  It should be removed at some point.
                context.getAttributes().put(SKIP_ITERATION_HINT, true);

                Set<VisitHint> hints = EnumSet.of(VisitHint.SKIP_ITERATION, VisitHint.EXECUTE_LIFECYCLE);
                VisitContext visitContext = VisitContext.createVisitContext(context, null, hints);
                viewRoot.visitTree(visitContext, new VisitCallback() {

                    public VisitResult visit(VisitContext context, UIComponent target) {
                        VisitResult result = VisitResult.ACCEPT;
                        String cid = target.getClientId(context.getFacesContext());
View Full Code Here

Examples of javax.faces.component.visit.VisitContext

        for (UIComponent child : children) {
            try {
                context.getAttributes().put(SKIP_ITERATION_HINT, true);
                Set<VisitHint> hints = EnumSet.of(VisitHint.SKIP_ITERATION);

                VisitContext visitContext = VisitContext.createVisitContext(context, null, hints);
                child.visitTree(visitContext, new VisitCallback() {

                    public VisitResult visit(VisitContext visitContext, UIComponent component) {
                        VisitResult result = VisitResult.ACCEPT;
View Full Code Here

Examples of javax.faces.component.visit.VisitContext

        try {
            context.getAttributes().put(SKIP_ITERATION_HINT, true);
            Set<VisitHint> hints = EnumSet.of(VisitHint.SKIP_ITERATION);

            VisitContext visitContext = VisitContext.createVisitContext(context, null, hints);
            subTree.visitTree(visitContext, new VisitCallback() {

                public VisitResult visit(VisitContext visitContext, UIComponent component) {
                    VisitResult result = VisitResult.ACCEPT;
                    if (component.getClientId(visitContext.getFacesContext()).equals(clientId)) {
                        /*
                         * If the client id matches up we have found our match.
                         */
                        found.add(component);
                        result = VisitResult.COMPLETE;
                    } else if (component instanceof UIForm) {
                        /*
                         * If the component is a UIForm and it is prepending its
                         * id then we can short circuit out of here if the the
                         * client id of the component we are trying to find does
                         * not begin with the id of the UIForm.
                         */
                        UIForm form = (UIForm) component;
                        if (form.isPrependId() && !clientId.startsWith(form.getClientId(visitContext.getFacesContext()))) {
                            result = VisitResult.REJECT;
                        }
                    } else if (component instanceof NamingContainer &&
                            !clientId.startsWith(component.getClientId(visitContext.getFacesContext()))) {
                        /*
                         * If the component is a naming container then assume it
                         * is prepending its id so if our client id we are
                         * looking for does not start with the naming container
                         * id we can skip visiting this tree.
View Full Code Here

Examples of javax.faces.component.visit.VisitContext

        final UIViewRoot viewRoot = context.getViewRoot();

        try {
            context.getAttributes().put(SKIP_ITERATION_HINT, true);
            Set<VisitHint> hints = EnumSet.of(VisitHint.SKIP_ITERATION);
            VisitContext visitContext = VisitContext.createVisitContext(context, null, hints);

            viewRoot.visitTree(visitContext, new VisitCallback() {

                public VisitResult visit(VisitContext visitContext, UIComponent component) {
                    VisitResult result = VisitResult.ACCEPT;
View Full Code Here

Examples of javax.faces.component.visit.VisitContext

        final UIViewRoot viewRoot = context.getViewRoot();
        final FacesContext finalContext = context;

        context.getAttributes().put(SKIP_ITERATION_HINT, true);
        Set<VisitHint> hints = EnumSet.of(VisitHint.SKIP_ITERATION);
        VisitContext visitContext = VisitContext.createVisitContext(context, null, hints);

        try {
            viewRoot.visitTree(visitContext, new VisitCallback() {

                public VisitResult visit(VisitContext context, UIComponent component) {
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.