Class UIEvent

java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
All Implemented Interfaces:
Serializable, 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:
  • Field Details

    • SCROLL_PAGE_DOWN

      public static final int SCROLL_PAGE_DOWN
      Constant.
      See Also:
    • SCROLL_PAGE_UP

      public static final int SCROLL_PAGE_UP
      Constant.
      See Also:
    • detail_

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

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

      private static final Object NO_VIEW
  • Constructor Details

    • UIEvent

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

      public UIEvent(DomNode domNode, 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, String type)
      Creates a new event instance.
      Parameters:
      target - the event target
      type - the event type
  • Method Details

    • jsConstructor

      public void jsConstructor(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 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(String type, boolean bubbles, boolean cancelable, 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