sk.baka.ikslibs
Enum EventTypesEnum

java.lang.Object
  extended by java.lang.Enum<EventTypesEnum>
      extended by sk.baka.ikslibs.EventTypesEnum
All Implemented Interfaces:
Serializable, Comparable<EventTypesEnum>

public enum EventTypesEnum
extends Enum<EventTypesEnum>

DOM Event types constants. You may use toString() to obtain the event type as required by the W3C DOM 2 level event specification.

Author:
Martin Vysny

Enum Constant Summary
MAttrModified
           Fired after an Attr has been modified on a node.
MCharacterDataModified
           Fired after CharacterData within a node has been modified but the node itself has not been inserted or deleted.
MNodeInserted
           Fired when a node has been added as a child of another node.
MNodeInsertedIntoDocument
           Fired when a node is being inserted into a document, either through direct insertion of the Node or insertion of a subtree in which it is contained.
MNodeRemoved
           Fired when a node is being removed from its parent node.
MNodeRemovedFromDocument
           Fired when a node is being removed from a document, either through direct removal of the Node or removal of a subtree in which it is contained.
MSubtreeModified
           This is a general event for notification of all changes to the document.
 
Method Summary
static void addEventListenerTo(EventTarget node, EventListener listener, boolean useCapture, Set<EventTypesEnum> eventTypes)
          Registers given listener to given node for all specified event types.
 boolean bubbles()
          Checks if this event can bubble.
static EventTypesEnum fromEvent(Event event)
          Retrieves the event constant for given event.
static EventTypesEnum fromType(String type)
          Retrieves the event constant from given string type representation.
static Set<EventTypesEnum> getAllOfClass(EventClassEnum c)
          Returns set of all event types with given class.
 EventClassEnum getEventClass()
          Returns true if this event is one of the mutation events.
 String getTypeName()
          Returns the 'type' of the event as specified by the W3C DOM 2 level event specification.
 boolean isCancellable()
          Checks if this event is cancellable.
 boolean isRaw()
          Checks if this event is a raw (or a low-level) event.
static void removeEventListenerFrom(EventTarget node, EventListener listener, boolean useCapture, EnumSet<EventTypesEnum> eventTypes)
          Removes given listener from given node for all specified event types.
 String toString()
           
static EventTypesEnum valueOf(String name)
          Returns the enum constant of this type with the specified name.
static EventTypesEnum[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MSubtreeModified

public static final EventTypesEnum MSubtreeModified

This is a general event for notification of all changes to the document. It can be used instead of the more specific events listed below. It may be fired after a single modification to the document or, at the implementation's discretion, after multiple changes have occurred. The latter use should generally be used to accomodate multiple changes which occur either simultaneously or in rapid succession. The target of this event is the lowest common parent of the changes which have taken place. This event is dispatched after any other events caused by the mutation have fired.


MNodeInserted

public static final EventTypesEnum MNodeInserted

Fired when a node has been added as a child of another node. This event is dispatched after the insertion has taken place. The target of this event is the node being inserted.


MNodeRemoved

public static final EventTypesEnum MNodeRemoved

Fired when a node is being removed from its parent node. This event is dispatched before the node is removed from the tree. The target of this event is the node being removed.


MNodeRemovedFromDocument

public static final EventTypesEnum MNodeRemovedFromDocument

Fired when a node is being removed from a document, either through direct removal of the Node or removal of a subtree in which it is contained. This event is dispatched before the removal takes place. The target of this event is the Node being removed. If the Node is being directly removed the DOMNodeRemoved event will fire before the DOMNodeRemovedFromDocument event.


MNodeInsertedIntoDocument

public static final EventTypesEnum MNodeInsertedIntoDocument

Fired when a node is being inserted into a document, either through direct insertion of the Node or insertion of a subtree in which it is contained. This event is dispatched after the insertion has taken place. The target of this event is the node being inserted. If the Node is being directly inserted the DOMNodeInserted event will fire before the DOMNodeInsertedIntoDocument event.


MAttrModified

public static final EventTypesEnum MAttrModified

Fired after an Attr has been modified on a node. The target of this event is the Node whose Attr changed. The value of attrChange indicates whether the Attr was modified, added, or removed. The value of relatedNode indicates the Attr node whose value has been affected. It is expected that string based replacement of an Attr value will be viewed as a modification of the Attr since its identity does not change. Subsequently replacement of the Attr node with a different Attr node is viewed as the removal of the first Attr node and the addition of the second.


MCharacterDataModified

public static final EventTypesEnum MCharacterDataModified

Fired after CharacterData within a node has been modified but the node itself has not been inserted or deleted. This event is also triggered by modifications to PI elements. The target of this event is the CharacterData node.

Method Detail

values

public static final EventTypesEnum[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(EventTypesEnum c : EventTypesEnum.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static EventTypesEnum valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

getTypeName

public String getTypeName()
Returns the 'type' of the event as specified by the W3C DOM 2 level event specification.

Returns:
the 'type' of the event as required by the EventTarget.addEventListener(String, EventListener, boolean) method.

toString

public String toString()
Overrides:
toString in class Enum<EventTypesEnum>

fromType

public static EventTypesEnum fromType(String type)
Retrieves the event constant from given string type representation.

Parameters:
type - the string type as specified by the W3C DOM 2 level event specification
Returns:
enum constant or null if given type is unknown.

fromEvent

public static EventTypesEnum fromEvent(Event event)
Retrieves the event constant for given event.

Parameters:
event - the DOM event.
Returns:
enum constant or null if given type is unknown.

getEventClass

public EventClassEnum getEventClass()
Returns true if this event is one of the mutation events.

Returns:
true if the event is a mutation event, false otherwise.

isRaw

public boolean isRaw()
Checks if this event is a raw (or a low-level) event. For example, DOMNodeInserted is raw event (it cannot be composed of some lower level events). Both DOMSubtreeModified and DOMNodeInsertedIntoDocument are not raw events because they can be composed from another events.

Returns:
false if this event is a composite of another events.

bubbles

public boolean bubbles()
Checks if this event can bubble.

Returns:
true if this event can bubble, false otherwise.

isCancellable

public boolean isCancellable()
Checks if this event is cancellable.

Returns:
true if events of this type can be cancelled, false otherwise.

getAllOfClass

public static Set<EventTypesEnum> getAllOfClass(EventClassEnum c)
Returns set of all event types with given class.

Parameters:
c - the event class.
Returns:
unmodifiable set of event types.

addEventListenerTo

public static void addEventListenerTo(EventTarget node,
                                      EventListener listener,
                                      boolean useCapture,
                                      Set<EventTypesEnum> eventTypes)
Registers given listener to given node for all specified event types.

Parameters:
node - The event target node.
listener - The listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs.
useCapture - if true then invoke the event in the capture phase, otherwise the bubble phase is used.
eventTypes - registers event listener for all these types.

removeEventListenerFrom

public static void removeEventListenerFrom(EventTarget node,
                                           EventListener listener,
                                           boolean useCapture,
                                           EnumSet<EventTypesEnum> eventTypes)
Removes given listener from given node for all specified event types.

Parameters:
node - The event target node.
listener - The listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs.
useCapture - if true then invoke the event in the capture phase, otherwise the bubble phase is used.
eventTypes - registers event listener for all these types.


Copyright © 2006 Martin Vysny - baka. All Rights Reserved.