Package javax.faces.component.visit

Examples of javax.faces.component.visit.VisitContextFactory


    private boolean visitActivatorComponent(String componentActivatorId, VisitCallback visitCallback, Set<VisitHint> visitHints) {
        final FacesContext facesContext = getFacesContext();
        try {
            Set<String> idsToVisit = Collections.singleton(componentActivatorId);
            setVisitMode(ExtendedVisitContextMode.EXECUTE);
            VisitContextFactory visitContextFactory = (VisitContextFactory) FactoryFinder
                    .getFactory(javax.faces.FactoryFinder.VISIT_CONTEXT_FACTORY);
            VisitContext visitContext = visitContextFactory.getVisitContext(facesContext, idsToVisit, visitHints);
            return facesContext.getViewRoot().visitTree(visitContext, visitCallback);
        } finally {
            resetVisitMode();
        }
    }
View Full Code Here


            // which has synchronized blocks.
            _visitContextFactory = (VisitContextFactory) _facesContext.getExternalContext().
                    getApplicationMap().get("oam.vf.VisitContextFactory");
            if (_visitContextFactory == null)
            {
                VisitContextFactory factory = (VisitContextFactory)
                        FactoryFinder.getFactory(FactoryFinder.VISIT_CONTEXT_FACTORY);
                _facesContext.getExternalContext().
                        getApplicationMap().put("oam.vf.VisitContextFactory", factory);
                _visitContextFactory = factory;
            }
View Full Code Here

            // which has synchronized blocks.
            _visitContextFactory = (VisitContextFactory) _facesContext.getExternalContext().
                    getApplicationMap().get("oam.vf.VisitContextFactory");
            if (_visitContextFactory == null)
            {
                VisitContextFactory factory = (VisitContextFactory)
                        FactoryFinder.getFactory(FactoryFinder.VISIT_CONTEXT_FACTORY);
                _facesContext.getExternalContext().
                        getApplicationMap().put("oam.vf.VisitContextFactory", factory);
                _visitContextFactory = factory;
            }
View Full Code Here

    }

    public void testVisitTree()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        VisitContextFactory factory = new MockVisitContextFactory();
        VisitContext visitContext = factory.getVisitContext(facesContext, null,
                null);

        VisitCallback callback = new MockVisitCallback();
        UIComponent component = facesContext.getViewRoot();
        assertEquals(VisitResult.ACCEPT, visitContext.invokeVisitCallback(
View Full Code Here

            // which has synchronized blocks.
            _visitContextFactory = (VisitContextFactory) _facesContext.getExternalContext().
                    getApplicationMap().get("oam.vf.VisitContextFactory");
            if (_visitContextFactory == null)
            {
                VisitContextFactory factory = (VisitContextFactory)
                        FactoryFinder.getFactory(FactoryFinder.VISIT_CONTEXT_FACTORY);
                _facesContext.getExternalContext().
                        getApplicationMap().put("oam.vf.VisitContextFactory", factory);
                _visitContextFactory = factory;
            }
View Full Code Here

        // process.  Create our (partial) VisitContext and the
        // VisitCallback that will be invoked for each component that
        // is visited.  Note that we use the SKIP_UNRENDERED hint as we
        // only want to visit the rendered subtree.
        EnumSet<VisitHint> hints = EnumSet.of(VisitHint.SKIP_UNRENDERED, VisitHint.EXECUTE_LIFECYCLE);
        VisitContextFactory visitContextFactory = (VisitContextFactory)
                FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY);
        VisitContext visitContext = visitContextFactory.getVisitContext(context, phaseClientIds, hints);
         PhaseAwareVisitCallback visitCallback =
             new PhaseAwareVisitCallback(ctx, phaseId);
         component.visitTree(visitContext, visitCallback);

        PartialVisitContext partialVisitContext = unwrapPartialVisitContext(visitContext);
View Full Code Here

        // process.  Create our (partial) VisitContext and the
        // VisitCallback that will be invoked for each component that
        // is visited.  Note that we use the SKIP_UNRENDERED hint as we
        // only want to visit the rendered subtree.
        EnumSet<VisitHint> hints = EnumSet.of(VisitHint.SKIP_UNRENDERED, VisitHint.EXECUTE_LIFECYCLE);
        VisitContextFactory visitContextFactory = (VisitContextFactory)
                FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY);
        VisitContext visitContext = visitContextFactory.getVisitContext(context, phaseClientIds, hints);
        PhaseAwareVisitCallback visitCallback =
            new PhaseAwareVisitCallback(ctx, phaseId);
        component.visitTree(visitContext, visitCallback);

        PartialVisitContext partialVisitContext = unwrapPartialVisitContext(visitContext);
View Full Code Here

        // process.  Create our (partial) VisitContext and the
        // VisitCallback that will be invoked for each component that
        // is visited.  Note that we use the SKIP_UNRENDERED hint as we
        // only want to visit the rendered subtree.
        EnumSet<VisitHint> hints = EnumSet.of(VisitHint.SKIP_UNRENDERED, VisitHint.EXECUTE_LIFECYCLE);
        VisitContextFactory visitContextFactory = (VisitContextFactory)
                FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY);
        VisitContext visitContext = visitContextFactory.getVisitContext(context, phaseClientIds, hints);
        PhaseAwareVisitCallback visitCallback =
            new PhaseAwareVisitCallback(ctx, phaseId);
        component.visitTree(visitContext, visitCallback);

        PartialVisitContext partialVisitContext = unwrapPartialVisitContext(visitContext);
View Full Code Here

        // process.  Create our (partial) VisitContext and the
        // VisitCallback that will be invoked for each component that
        // is visited.  Note that we use the SKIP_UNRENDERED hint as we
        // only want to visit the rendered subtree.
        EnumSet<VisitHint> hints = EnumSet.of(VisitHint.SKIP_UNRENDERED, VisitHint.EXECUTE_LIFECYCLE);
        VisitContextFactory visitContextFactory = (VisitContextFactory)
                FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY);
        VisitContext visitContext = visitContextFactory.getVisitContext(context, phaseClientIds, hints);
        PhaseAwareVisitCallback visitCallback =
            new PhaseAwareVisitCallback(ctx, phaseId);
        component.visitTree(visitContext, visitCallback);

        PartialVisitContext partialVisitContext = unwrapPartialVisitContext(visitContext);
View Full Code Here

  protected void cleanupPartial(FacesContext facesContext, Collection<String> renderIds) {

    if ((renderIds != null) && (renderIds.size() > 0)) {

      VisitContextFactory visitContextFactory = (VisitContextFactory) FactoryFinder.getFactory(
          FactoryFinder.VISIT_CONTEXT_FACTORY);

      EnumSet<VisitHint> visitHints = EnumSet.of(VisitHint.EXECUTE_LIFECYCLE);
      VisitContext visitContext = visitContextFactory.getVisitContext(facesContext, renderIds, visitHints);
      VisitCallback visitCallback = new VisitCallbackCleanupImpl();
      facesContext.getViewRoot().visitTree(visitContext, visitCallback);
    }
  }
View Full Code Here

TOP

Related Classes of javax.faces.component.visit.VisitContextFactory

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.