Package org.ajax4jsf.event

Examples of org.ajax4jsf.event.EventsQueue


   * @param phaseId -
   *            phase, for which events must be processed.
   */
  void broadcastEvents(FacesContext context, PhaseId phaseId) {
    EventsQueue[] events = getEvents();
    EventsQueue anyPhaseEvents = events[PhaseId.ANY_PHASE.getOrdinal()];
    EventsQueue phaseEvents = events[phaseId.getOrdinal()];
    if (phaseEvents.isEmpty() && anyPhaseEvents.isEmpty())
      return;
    // FacesEvent event = null;
    boolean haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
    boolean havePhaseEvents = !phaseEvents.isEmpty();
    do {
      // ANY_PHASE first
      processEvents(context, anyPhaseEvents, haveAnyPhaseEvents);

      processEvents(context, phaseEvents, havePhaseEvents);
      // Events can queued in other events processing
      haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
      havePhaseEvents = !phaseEvents.isEmpty();
    } while (haveAnyPhaseEvents || havePhaseEvents);
    if (context.getRenderResponse() || context.getResponseComplete()) {
      clearEvents();
    }

View Full Code Here


      }
    }
  }

  public void broadcastAjaxEvents(FacesContext context) {
    EventsQueue queue = getAjaxEventsQueue();
    processEvents(context, queue, !queue.isEmpty());
  }
View Full Code Here

  public void clearEvents() {
    int len;
    events = new EventsQueue[len = PhaseId.VALUES.size()];
    for (int i = 0; i < len; i++) {
      events[i] = new EventsQueue();
    }
  }
View Full Code Here

         * @param phaseId -
         *                phase, for wich events must be processed.
         */
    void broadcastEvents(FacesContext context, PhaseId phaseId) {
  EventsQueue[] events = getEvents(context);
  EventsQueue anyPhaseEvents = events[PhaseId.ANY_PHASE.getOrdinal()];
  EventsQueue phaseEvents = events[phaseId.getOrdinal()];
  if (phaseEvents.isEmpty() && anyPhaseEvents.isEmpty())
      return;
  // FacesEvent event = null;
  boolean haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
  boolean havePhaseEvents = !phaseEvents.isEmpty();
  do {
      // ANY_PHASE first
      processEvents(anyPhaseEvents, haveAnyPhaseEvents);

      processEvents(phaseEvents, havePhaseEvents);
      // Events can queued in other events processing
      haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
      havePhaseEvents = !phaseEvents.isEmpty();
  } while (haveAnyPhaseEvents || havePhaseEvents);
  if (context.getRenderResponse() || context.getResponseComplete()) {
      clearEvents(context);
  }

View Full Code Here

      }
  }
    }

    public void broadcastAjaxEvents(FacesContext context) {
  EventsQueue queue = getAjaxEventsQueue(context);
  processEvents(queue, !queue.isEmpty());
    }
View Full Code Here

    public void clearEvents(FacesContext context) {
  int len;
  events = new EventsQueue[len = PhaseId.VALUES.size()];
  for (int i = 0; i < len; i++) {
      events[i] = new EventsQueue();
  }
    }
View Full Code Here

   * @param phaseId -
   *            phase, for which events must be processed.
   */
  void broadcastEvents(FacesContext context, PhaseId phaseId) {
    EventsQueue[] events = getEvents();
    EventsQueue anyPhaseEvents = events[PhaseId.ANY_PHASE.getOrdinal()];
    EventsQueue phaseEvents = events[phaseId.getOrdinal()];
    if (phaseEvents.isEmpty() && anyPhaseEvents.isEmpty())
      return;
    // FacesEvent event = null;
    boolean haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
    boolean havePhaseEvents = !phaseEvents.isEmpty();
    do {
      // ANY_PHASE first
      processEvents(context, anyPhaseEvents, haveAnyPhaseEvents);

      processEvents(context, phaseEvents, havePhaseEvents);
      // Events can queued in other events processing
      haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
      havePhaseEvents = !phaseEvents.isEmpty();
    } while (haveAnyPhaseEvents || havePhaseEvents);
    if (context.getRenderResponse() || context.getResponseComplete()) {
      clearEvents();
    }

View Full Code Here

      }
    }
  }

  public void broadcastAjaxEvents(FacesContext context) {
    EventsQueue queue = getAjaxEventsQueue();
    processEvents(context, queue, !queue.isEmpty());
  }
View Full Code Here

  public void clearEvents() {
    int len;
    events = new EventsQueue[len = PhaseId.VALUES.size()];
    for (int i = 0; i < len; i++) {
      events[i] = new EventsQueue();
    }
  }
View Full Code Here

        externalContext.getRequestParameterMap().put(
                menuItem.getClientId(facesContext), "Action");
        menuItem.decode(facesContext);

        MockViewRoot mockViewRoot = (MockViewRoot) facesContext.getViewRoot();
        EventsQueue events = mockViewRoot.getEventsQueue(PhaseId.APPLY_REQUEST_VALUES);
        assertNotNull(events);
        assertEquals(1, events.size());
    }
View Full Code Here

TOP

Related Classes of org.ajax4jsf.event.EventsQueue

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.