com.gargoylesoftware.htmlunit.javascript.host
Class UIEvent

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.Event
              extended by com.gargoylesoftware.htmlunit.javascript.host.UIEvent
All Implemented Interfaces:
Serializable, Cloneable, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable
Direct Known Subclasses:
KeyboardEvent, MouseEvent

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.

Version:
$Revision: 8931 $
Author:
Daniel Gredler, Ahmed Ashour, Frank Danek
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.Event
ABORT, ALT_MASK, AT_TARGET, BACK, BLUR, BUBBLING_PHASE, CAPTURING_PHASE, CHANGE, CLICK, CONTROL_MASK, DBLCLICK, DRAGDROP, ERROR, FOCUS, FORWARD, HELP, KEYDOWN, KEYPRESS, KEYUP, LOAD, LOCATE, META_MASK, MOUSEDOWN, MOUSEDRAG, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP, MOVE, NONE, RESET, RESIZE, SCROLL, SELECT, SHIFT_MASK, SUBMIT, TEXT, TYPE_BEFORE_UNLOAD, TYPE_BLUR, TYPE_CHANGE, TYPE_DOM_DOCUMENT_LOADED, TYPE_ERROR, TYPE_FOCUS, TYPE_FOCUS_IN, TYPE_FOCUS_OUT, TYPE_HASH_CHANGE, TYPE_INPUT, TYPE_KEY_DOWN, TYPE_KEY_PRESS, TYPE_KEY_UP, TYPE_LOAD, TYPE_MESSAGE, TYPE_PROPERTY_CHANGE, TYPE_READY_STATE_CHANGE, TYPE_RESET, TYPE_SUBMIT, TYPE_UNLOAD, UNLOAD, XFER_DONE
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
UIEvent()
          Creates a new UI event instance.
UIEvent(DomNode domNode, String type)
          Creates a new UI event instance.
UIEvent(SimpleScriptable scriptable, String type)
          Creates a new event instance.
 
Method Summary
 boolean getAltKey()
           Overridden to modify browser configurations.
 boolean getCancelBubble()
           
 boolean getCtrlKey()
           Overridden to modify browser configurations.
 long getDetail()
          Returns some detail information about the event, depending on the event type.
 boolean getMetaKey()
          Returns whether or not the "meta" key was pressed during the event firing.
 boolean getShiftKey()
           Overridden to modify browser configurations.
 Object getView()
          Returns the view from which the event was generated.
 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.
 void setCancelBubble(boolean newValue)
           
protected  void setDetail(long detail)
          Sets the detail information for this event.
protected  void setMetaKey(boolean metaKey)
           
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Event
applies, createPropertyChangeEvent, eventCreated, getBubbles, getCancelable, getCurrentTarget, getDefaultPrevented, getEventPhase, getKeyCode, getPropertyName, getReturnValue, getSrcElement, getTarget, getTimeStamp, getType, initEvent, isAborted, isPropagationStopped, jsConstructor, preventDefault, setAltKey, setBubbles, setCancelable, setCtrlKey, setCurrentTarget, setEventPhase, setEventType, setKeyCode, setReturnValue, setShiftKey, setSrcElement, setTarget, setType, stopPropagation, toString
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement, setParentScope
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setPrototype, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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(SimpleScriptable scriptable,
               String type)
Creates a new event instance.

Parameters:
scriptable - the SimpleScriptable that triggered the event
type - the event type
Method Detail

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

getCancelBubble

public boolean getCancelBubble()
Overrides:
getCancelBubble in class Event
Returns:
indicates if event propagation is stopped

setCancelBubble

public void setCancelBubble(boolean newValue)
Overrides:
setCancelBubble in class Event
Parameters:
newValue - indicates if event propagation is stopped

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

getMetaKey

public boolean getMetaKey()
Returns whether or not the "meta" key was pressed during the event firing.

Returns:
whether or not the "meta" key was pressed during the event firing

setMetaKey

protected void setMetaKey(boolean metaKey)
Parameters:
metaKey - whether Meta has been pressed during this event or not

getAltKey

public boolean getAltKey()
Overridden to modify browser configurations.

Overrides:
getAltKey in class Event
Returns:
whether ALT has been pressed during this event or not

getCtrlKey

public boolean getCtrlKey()
Overridden to modify browser configurations.

Overrides:
getCtrlKey in class Event
Returns:
whether CTRL has been pressed during this event or not

getShiftKey

public boolean getShiftKey()
Overridden to modify browser configurations.

Overrides:
getShiftKey in class Event
Returns:
whether SHIFT has been pressed during this event or not


Copyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.