Package com.helger.html.js
Class JSEventMap
- java.lang.Object
-
- com.helger.html.js.JSEventMap
-
- All Implemented Interfaces:
Serializable
@NotThreadSafe public class JSEventMap extends Object implements Serializable
This class represents a map from anEJSEventto anIHasJSCodethat represents the code. This is mainly meant for managing HTML element JS event handler.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JSEventMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHandler(EJSEvent eJSEvent, IHasJSCode aNewHandler)Add an additional handler for the given JS event.booleancontainsHandler(EJSEvent eJSEvent)com.helger.commons.collection.impl.ICommonsMap<EJSEvent,CollectingJSCodeProvider>getAllEventHandler()CollectingJSCodeProvidergetHandler(EJSEvent eJSEvent)voidprependHandler(EJSEvent eJSEvent, IHasJSCode aNewHandler)Add an additional handler for the given JS event.com.helger.commons.state.EChangeremoveHandler(EJSEvent eJSEvent)voidsetHandler(EJSEvent eJSEvent, IHasJSCode aNewHandler)Set a handler for the given JS event.StringtoString()
-
-
-
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 benull.aNewHandler- The new handler to be added. May not benull.
-
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 benull.aNewHandler- The new handler to be added. May not benull.
-
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 benull.aNewHandler- The new handler to be added. May not benull.
-
removeHandler
@Nonnull public com.helger.commons.state.EChange removeHandler(@Nullable EJSEvent eJSEvent)
-
getHandler
@Nullable public CollectingJSCodeProvider getHandler(@Nullable EJSEvent eJSEvent)
-
getAllEventHandler
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsMap<EJSEvent,CollectingJSCodeProvider> getAllEventHandler()
-
-