Adobe InDesign CS5 (7.0) Object Model JS: UIEvent

InDesign CS5

Class

UIEvent

 

Encapsulates input event information for an event that propagates through a container and control hierarchy.

Implements W3C standard event handling. This object is passed to a function that you register to respond to events of a certain type that occur in a window or control. Use windowObj.addEventListener() or controlObj.addEventListener() to register a handler function.

QuickLinks

UIEvent, initEvent, initUIEvent, preventDefault, stopPropagation

Properties

PropertyTypeAccessDescription
bubblesBoolean readonlyTrue if the event is of a type that bubbles.
cancelableBoolean readonlyTrue if the default action associated with the event can be canceled with preventDefault().
capturesBoolean readonlyTrue if this event can be captured.
currentTargetBoolean readonlyThe event target object which is currently handling the event. During capturing and bubbling, this is different from the property target.
detailAny readonlyThe click count for a mouse-click event.
eventPhaseString readonlyThe current phase of event propagation; one of none, target, capture, bubble.
targetObject readonlyThe event target object for this event.
timeStampDate readonlyThe date and time at which the event occurred.
typeString readonlyThe name of the event that this object represents.
Event types are listed in the JavaScript Tools Guide.
viewAny readonlyThe ScriptUI element that this event relates to.

Methods

Constructor

UIEvent UIEvent (type: String[, captures: Boolean=false][, bubbles: Boolean=false][, view: Object][, detail: Number])
Creates an event.
The UIEvent object is normally created by ScriptUI and passed to your event handler. However, you can simulate a user action by constructing an event object and sending it to a target object's dispatchEvent() function.

ParameterTypeDescription
typeString The event type. See UIEvent.type property.
capturesBooleanSet to true if this event can be captured. (default: false)
bubblesBooleanSet to true if the event bubbles. (default: false)
viewObjectThe ScriptUI element that this event relates to. (Optional)
detailNumberThe click count for a mouse-click event. (Optional)

Instances

void initEvent (type: String[, captures: Boolean=false][, bubbles: Boolean=false][, cancelable: Boolean=false])
Initializes a UI event as a core W3C event.

ParameterTypeDescription
typeStringThe event type.
capturesBooleanSet to true if this event can be captured. (default: false)
bubblesBooleanSet to true if the event bubbles. (default: false)
cancelableBooleanSet to true if the default action is cancelable. (default: false)

void initUIEvent (type: String[, captures: Boolean=false][, bubbles: Boolean=false][, view: Object][, detail: Number])
Initializes an event.

ParameterTypeDescription
typeStringThe event type.
capturesBooleanSet to true if this event can be captured. (default: false)
bubblesBooleanSet to true if the event bubbles. (default: false)
viewObjectThe ScriptUI element that this event relates to. (Optional)
detailNumberThe click count for a mouse-click event. (Optional)

void preventDefault ()
Prevents the default action associated with this event from being called.

void stopPropagation ()
Stops the propagation of this event.

Return

UIEvent UIEvent.UIEvent (type: String[, captures: Boolean=false][, bubbles: Boolean=false][, view: Object][, detail: Number])

UIEvent Window (SUI).dispatchEvent ()

Jongware, 20-Jun-2010 v3.0.3dContents :: Index