Class UIEvent

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable
    Direct Known Subclasses:
    CompositionEvent, FocusEvent, InputEvent, KeyboardEvent, MouseEvent, TextEvent, TouchEvent

    public class UIEvent
    extends Event
    JavaScript object representing a UI event. For general information on which properties and functions should be supported, see DOM Level 3 Events.
    See Also:
    Serialized Form
    • Field Detail

      • detail_

        private long detail_
        Specifies some detail information about the event.
      • view_

        private java.lang.Object view_
        Specifies some view information about the event.
      • NO_VIEW

        private static final java.lang.Object NO_VIEW
    • Constructor Detail

      • UIEvent

        public UIEvent()
        Creates a new UI event instance.
      • UIEvent

        public UIEvent​(DomNode domNode,
                       java.lang.String type)
        Creates a new UI event instance.
        Parameters:
        domNode - the DOM node that triggered the event
        type - the event type
      • UIEvent

        public UIEvent​(EventTarget target,
                       java.lang.String type)
        Creates a new event instance.
        Parameters:
        target - the event target
        type - the event type
    • Method Detail

      • jsConstructor

        public void jsConstructor​(java.lang.String type,
                                  org.htmlunit.corejs.javascript.ScriptableObject details)
        JavaScript constructor.
        Overrides:
        jsConstructor in class Event
        Parameters:
        type - the event type
        details - the event details (optional)
      • getDetail

        public long getDetail()
        Returns some detail information about the event, depending on the event type. For mouse events, the detail property indicates how many times the mouse has been clicked in the same location for this event.
        Returns:
        some detail information about the event, depending on the event type
      • setDetail

        protected void setDetail​(long detail)
        Sets the detail information for this event.
        Parameters:
        detail - the detail information for this event
      • getView

        public java.lang.Object getView()
        Returns the view from which the event was generated. In browsers, this is the originating window.
        Returns:
        the view from which the event was generated
      • initUIEvent

        public void initUIEvent​(java.lang.String type,
                                boolean bubbles,
                                boolean cancelable,
                                java.lang.Object view,
                                int detail)
        Implementation of the DOM Level 3 Event method for initializing the UI event.
        Parameters:
        type - the event type
        bubbles - can the event bubble
        cancelable - can the event be canceled
        view - the view to use for this event
        detail - the detail to set for the event
      • getWhich

        public int getWhich()
        Returns:
        a number that indicates which button was pressed on the mouse, or the numeric keyCode or the character code (charCode) of the key pressed on the keyboard