Package javax.faces.event

Examples of javax.faces.event.PhaseListener


        _testimpl.setAfterPhaseListener(afterListener);

        Method[] mockedMethods = new Method[] {
                PhaseListener.class.getMethod("beforePhase", new Class[] { PhaseEvent.class }),
                PhaseListener.class.getMethod("afterPhase", new Class[] { PhaseEvent.class }) };
        PhaseListener phaseListener = _mocksControl.createMock(phaseListenerClasses.get(phaseId), mockedMethods);
        _testimpl.addPhaseListener(phaseListener);

        PhaseListener anyPhaseListener = _mocksControl.createMock(AnyPhasePhaseListener.class, mockedMethods);
        _testimpl.addPhaseListener(anyPhaseListener);

        PhaseListener restoreViewPhaseListener = _mocksControl.createMock(RestoreViewPhasePhaseListener.class,
                mockedMethods);
        _testimpl.addPhaseListener(restoreViewPhaseListener);

        _mocksControl.checkOrder(true);
View Full Code Here


        {
            List<PhaseListener> result = new ArrayList<PhaseListener>(foundPhaseListeners.size());

            for(Class<? extends PhaseListener> phaseListenerClass : foundPhaseListeners)
            {
                PhaseListener phaseListener = createPhaseListenerInstance(phaseListenerClass);
                result.add(tryToInjectDependencies(phaseListener));
            }

            foundPhaseListeners.clear();
View Full Code Here

  public void beforePhase(PhaseEvent event) {
    Collection listeners = getDelegates(event.getFacesContext());
    Iterator it = listeners.iterator();
    while (it.hasNext()) {
      PhaseListener listener = (PhaseListener) it.next();
      listener.beforePhase(event);
    }
  }
View Full Code Here

  public void afterPhase(PhaseEvent event) {
    Collection listeners = getDelegates(event.getFacesContext());
    Iterator it = listeners.iterator();
    while (it.hasNext()) {
      PhaseListener listener = (PhaseListener) it.next();
      listener.afterPhase(event);
    }
  }
View Full Code Here

  }

  public static void notifyAfterListeners(PhaseId phaseId, Lifecycle lifecycle, FacesContext context) {
    PhaseEvent afterPhaseEvent = new PhaseEvent(context, phaseId, lifecycle);
    for (int i = 0; i < lifecycle.getPhaseListeners().length; i++) {
      PhaseListener listener = lifecycle.getPhaseListeners()[i];
      if (listener.getPhaseId() == phaseId || listener.getPhaseId() == PhaseId.ANY_PHASE) {
        listener.afterPhase(afterPhaseEvent);
      }
    }
  }
View Full Code Here

  }

  public static void notifyBeforeListeners(PhaseId phaseId, Lifecycle lifecycle, FacesContext context) {
    PhaseEvent beforePhaseEvent = new PhaseEvent(context, phaseId, lifecycle);
    for (int i = 0; i < lifecycle.getPhaseListeners().length; i++) {
      PhaseListener listener = lifecycle.getPhaseListeners()[i];
      if (listener.getPhaseId() == phaseId || listener.getPhaseId() == PhaseId.ANY_PHASE) {
        listener.beforePhase(beforePhaseEvent);
      }
    }
  }
View Full Code Here

        // attribute is set, instantiate an instance of the specified class, and register it by calling
        // addPhaseListener(). If the binding attribute was also set, store the listener instance
        // by calling binding.setValue(). If there was an exception thrown, rethrow the
        // exception as a JspException.

        PhaseListener listener = null;
        try {
            listener = new BindingPhaseListener(binding, type);
        } catch(Exception ex) {
            throw new JspException(ex.getMessage(),ex);
        }
View Full Code Here

            this.binding = binding;
            this.type = type;
        }

        public void afterPhase(PhaseEvent event) {
            PhaseListener listener = getPhaseListener();
            if (listener != null) {
                listener.afterPhase(event);
            }
        }
View Full Code Here

                listener.afterPhase(event);
            }
        }

        public void beforePhase(PhaseEvent event) {
            PhaseListener listener = getPhaseListener();
            if (listener != null) {
                listener.beforePhase(event);
            }
        }
View Full Code Here

                listener.beforePhase(event);
            }
        }

        public PhaseId getPhaseId() {
            PhaseListener listener = getPhaseListener();
            if (listener != null) {
                return listener.getPhaseId();
            }

            return null;

        }
View Full Code Here

TOP

Related Classes of javax.faces.event.PhaseListener

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.