Class DomEventSupport

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.String>

    public class DomEventSupport
    extends java.util.HashMap<java.lang.String,​java.lang.String>
    implements java.io.Serializable
    DomEventSupport is a map from event to handler, and can be used in JSF EL expression like map['name']. Event handler is client script only, not ajax.
    Since:
    4.0
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String EVENT_CHANGE
      Value change event, supported by input entity properties
      static java.lang.String EVENT_CLICK
      Click event, supported by Menu nodes.
      static java.lang.String EVENT_FOCUS
      Focus event, supported by input text entity properties
      static java.lang.String EVENT_KEY_PRESS
      Keypress event, supported by input text entity properties
    • Constructor Summary

      Constructors 
      Constructor Description
      DomEventSupport​(ClientBehaviorHolder clientBehaviorHolder)
      Constructor with clientBehaviorHolder such as a MenuNode or EntityProperty.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEventHandler​(java.lang.String event, java.lang.String script)
      Add client event behavior that is static script only, not ajax.
      java.lang.String get​(java.lang.Object event)
      Get event handler.
      boolean isDynamicHandler​(java.lang.String event)
      Is the event handler dynamic for the event?
      void removeEventHandler​(java.lang.String event)
      Remove client event behavior.
      void setDynamicHandler​(java.lang.String event, boolean dynamic)
      Set whether the handler for the event is dynamic.
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • Field Detail

      • EVENT_CLICK

        public static final java.lang.String EVENT_CLICK
        Click event, supported by Menu nodes.
        See Also:
        Constant Field Values
      • EVENT_CHANGE

        public static final java.lang.String EVENT_CHANGE
        Value change event, supported by input entity properties
        See Also:
        Constant Field Values
      • EVENT_FOCUS

        public static final java.lang.String EVENT_FOCUS
        Focus event, supported by input text entity properties
        See Also:
        Constant Field Values
      • EVENT_KEY_PRESS

        public static final java.lang.String EVENT_KEY_PRESS
        Keypress event, supported by input text entity properties
        See Also:
        Constant Field Values
    • Constructor Detail

      • DomEventSupport

        public DomEventSupport​(ClientBehaviorHolder clientBehaviorHolder)
        Constructor with clientBehaviorHolder such as a MenuNode or EntityProperty.
        Parameters:
        clientBehaviorHolder - ClientBehaviorHolder instance
    • Method Detail

      • addEventHandler

        public void addEventHandler​(java.lang.String event,
                                    java.lang.String script)
        Add client event behavior that is static script only, not ajax.
        Parameters:
        event - supported DOM event such as focus, click, mouseover, etc.
        script - event handler
      • removeEventHandler

        public void removeEventHandler​(java.lang.String event)
        Remove client event behavior.
        Parameters:
        event - supported DOM event such as focus, click, mouseover, etc.
        Since:
        5.5
      • setDynamicHandler

        public void setDynamicHandler​(java.lang.String event,
                                      boolean dynamic)
        Set whether the handler for the event is dynamic. If dynamic, its ClientBehaviorHolder needs to provide event handler script.
        Parameters:
        event - DOM event such as click, focus.
        dynamic - true for dynamic
      • isDynamicHandler

        public boolean isDynamicHandler​(java.lang.String event)
        Is the event handler dynamic for the event?
        Parameters:
        event - DOM event name
        Returns:
        true if dynamic
      • get

        public java.lang.String get​(java.lang.Object event)
        Get event handler. If dynamic, get the handler script from its ClientBehaviorHolder.
        Specified by:
        get in interface java.util.Map<java.lang.String,​java.lang.String>
        Overrides:
        get in class java.util.HashMap<java.lang.String,​java.lang.String>
        Parameters:
        event - DOM event name
        Returns:
        event handler that is script.