Class JSEventMap

  • All Implemented Interfaces:
    Serializable

    @NotThreadSafe
    public class JSEventMap
    extends Object
    implements Serializable
    This class represents a map from an EJSEvent to an IHasJSCode that represents the code. This is mainly meant for managing HTML element JS event handler.
    Author:
    Philip Helger
    See Also:
    Serialized Form
    • Constructor Detail

      • JSEventMap

        public JSEventMap()
    • Method Detail

      • addHandler

        public void addHandler​(@Nonnull
                               EJSEvent eJSEvent,
                               @Nonnull
                               IHasJSCode aNewHandler)
        Add an additional handler for the given JS event. If an existing handler is present, the new handler is appended at the end.
        Parameters:
        eJSEvent - The JS event. May not be null.
        aNewHandler - The new handler to be added. May not be null.
      • prependHandler

        public void prependHandler​(@Nonnull
                                   EJSEvent eJSEvent,
                                   @Nonnull
                                   IHasJSCode aNewHandler)
        Add an additional handler for the given JS event. If an existing handler is present, the new handler is appended at front.
        Parameters:
        eJSEvent - The JS event. May not be null.
        aNewHandler - The new handler to be added. May not be null.
      • setHandler

        public void setHandler​(@Nonnull
                               EJSEvent eJSEvent,
                               @Nonnull
                               IHasJSCode aNewHandler)
        Set a handler for the given JS event. If an existing handler is present, it is automatically overridden.
        Parameters:
        eJSEvent - The JS event. May not be null.
        aNewHandler - The new handler to be added. May not be null.