Package org.zkoss.zk.ui.impl

## Class EventProcessor

- java.lang.Object
- - org.zkoss.zk.ui.impl.EventProcessor

-     public class EventProcessor
      extends java.lang.Object

  A utility class that simplify the implementation of `EventProcessingThread`.
  Author:
    tomyeh

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EventProcessor​(Desktop desktop, Component comp, Event event)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `cleanup()` | Cleanup this process after processing the event by calling `process()`.
    `Component` | `getComponent()` | Returns the component.
    `Desktop` | `getDesktop()` | Returns the desktop.
    `Event` | `getEvent()` | Returns the event.
    `static boolean` | `inEventListener()` | Returns whether the current thread is an event listener.
    `void` | `process()` | Process the event.
    `void` | `setup()` | Setup this processor before processing the event by calling `process()`.
    `java.lang.String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EventProcessor

          public EventProcessor​(Desktop desktop,
                                Component comp,
                                Event event)

      Parameters:
        `comp` - the component. Its desktop must be either null or the same as desktop.

  - ### Method Detail

    - #### inEventListener

          public static final boolean inEventListener()

      Returns whether the current thread is an event listener.

    - #### getDesktop

          public final Desktop getDesktop()

      Returns the desktop.

    - #### getEvent

          public final Event getEvent()

      Returns the event.

    - #### getComponent

          public final Component getComponent()

      Returns the component.

    - #### process

          public void process()
                       throws java.lang.Exception

      Process the event. Note: it doesn't invoke EventThreadInit and EventThreadCleanup.

      This method is to implement `EventProcessingThread`. See also `Configuration.isEventThreadEnabled()`.

      Throws:
        `java.lang.Exception`

    - #### setup

          public void setup()

      Setup this processor before processing the event by calling `process()`.

      Note: it doesn't invoke `ExecutionCtrl.onActivate()`

    - #### cleanup

          public void cleanup()

      Cleanup this process after processing the event by calling `process()`.

      Note: Don't call this method if the event process executes in the same thread.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`