This appendix contains the complete Java [Java] bindings for the Level 3 Document Object Model Events.
The Java files are also available as http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/java-binding.zip
package org.w3c.dom.events; public class EventException extends RuntimeException { public EventException(short code, String message) { super(message); this.code = code; } public short code; // EventExceptionCode public static final short UNSPECIFIED_EVENT_TYPE_ERR = 0; public static final short DISPATCH_REQUEST_ERR = 1; }
package org.w3c.dom.events; public interface Event { // PhaseType public static final short CAPTURING_PHASE = 1; public static final short AT_TARGET = 2; public static final short BUBBLING_PHASE = 3; public String getType(); public EventTarget getTarget(); public EventTarget getCurrentTarget(); public short getEventPhase(); public boolean getBubbles(); public boolean getCancelable(); public long getTimeStamp(); public void stopPropagation(); public void preventDefault(); public void initEvent(String eventTypeArg, boolean canBubbleArg, boolean cancelableArg); public String getNamespaceURI(); public void stopImmediatePropagation(); public boolean getDefaultPrevented(); public void initEventNS(String namespaceURIArg, String eventTypeArg, boolean canBubbleArg, boolean cancelableArg); }
package org.w3c.dom.events; public interface CustomEvent extends Event { public Object getDetail(); public void initCustomEventNS(String namespaceURIArg, String typeArg, boolean canBubbleArg, boolean cancelableArg, Object detailArg); }
package org.w3c.dom.events; import org.w3c.dom.DOMException; public interface EventTarget { public void addEventListener(String type, EventListener listener, boolean useCapture); public void removeEventListener(String type, EventListener listener, boolean useCapture); public boolean dispatchEvent(Event evt) throws EventException, DOMException; public void addEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture); public void removeEventListenerNS(String namespaceURI, String type, EventListener listener, boolean useCapture); }
package org.w3c.dom.events; public interface EventListener { public void handleEvent(Event evt); }
package org.w3c.dom.events; import org.w3c.dom.DOMException; public interface DocumentEvent { public Event createEvent(String eventType) throws DOMException; public boolean canDispatch(String namespaceURI, String type); }
package org.w3c.dom.events; import org.w3c.dom.views.AbstractView; public interface UIEvent extends Event { public AbstractView getView(); public int getDetail(); public void initUIEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg); public void initUIEventNS(String namespaceURIArg, String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg); }
package org.w3c.dom.events; import org.w3c.dom.views.AbstractView; public interface TextEvent extends UIEvent { public String getData(); public void initTextEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, String dataArg); public void initTextEventNS(String namespaceURIArg, String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, String dataArg); }
package org.w3c.dom.events; import org.w3c.dom.views.AbstractView; public interface KeyboardEvent extends UIEvent { // KeyLocationCode public static final int DOM_KEY_LOCATION_STANDARD = 0x00; public static final int DOM_KEY_LOCATION_LEFT = 0x01; public static final int DOM_KEY_LOCATION_RIGHT = 0x02; public static final int DOM_KEY_LOCATION_NUMPAD = 0x03; public String getKeyIdentifier(); public int getKeyLocation(); public boolean getCtrlKey(); public boolean getShiftKey(); public boolean getAltKey(); public boolean getMetaKey(); public boolean getModifierState(String keyIdentifierArg); public void initKeyboardEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, String keyIdentifierArg, int keyLocationArg, String modifiersListArg); public void initKeyboardEventNS(String namespaceURIArg, String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, String keyIdentifierArg, int keyLocationArg, String modifiersListArg); }
package org.w3c.dom.events; import org.w3c.dom.views.AbstractView; public interface MouseEvent extends UIEvent { public int getScreenX(); public int getScreenY(); public int getClientX(); public int getClientY(); public boolean getCtrlKey(); public boolean getShiftKey(); public boolean getAltKey(); public boolean getMetaKey(); public short getButton(); public EventTarget getRelatedTarget(); public void initMouseEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, boolean ctrlKeyArg, boolean altKeyArg, boolean shiftKeyArg, boolean metaKeyArg, short buttonArg, EventTarget relatedTargetArg); public boolean getModifierState(String keyIdentifierArg); public void initMouseEventNS(String namespaceURIArg, String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, short buttonArg, EventTarget relatedTargetArg, String modifiersListArg); }
package org.w3c.dom.events; import org.w3c.dom.views.AbstractView; public interface MouseMultiWheelEvent extends MouseEvent { public int getWheelDeltaX(); public int getWheelDeltaY(); public int getWheelDeltaZ(); public void initMouseMultiWheelEventNS(String namespaceURIArg, String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, short buttonArg, EventTarget relatedTargetArg, String modifiersListArg, int wheelDeltaXArg, int wheelDeltaYArg, int wheelDeltaZArg); }
package org.w3c.dom.events; import org.w3c.dom.views.AbstractView; public interface MouseWheelEvent extends MouseEvent { public int getWheelDelta(); public void initMouseWheelEventNS(String namespaceURIArg, String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, short buttonArg, EventTarget relatedTargetArg, String modifiersListArg, int wheelDeltaArg); }
package org.w3c.dom.events; import org.w3c.dom.Node; public interface MutationEvent extends Event { // attrChangeType public static final short MODIFICATION = 1; public static final short ADDITION = 2; public static final short REMOVAL = 3; public Node getRelatedNode(); public String getPrevValue(); public String getNewValue(); public String getAttrName(); public short getAttrChange(); public void initMutationEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, Node relatedNodeArg, String prevValueArg, String newValueArg, String attrNameArg, short attrChangeArg); public void initMutationEventNS(String namespaceURIArg, String typeArg, boolean canBubbleArg, boolean cancelableArg, Node relatedNodeArg, String prevValueArg, String newValueArg, String attrNameArg, short attrChangeArg); }
package org.w3c.dom.events; import org.w3c.dom.Node; public interface MutationNameEvent extends MutationEvent { public String getPrevNamespaceURI(); public String getPrevNodeName(); public void initMutationNameEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, Node relatedNodeArg, String prevNamespaceURIArg, String prevNodeNameArg); public void initMutationNameEventNS(String namespaceURIArg, String typeArg, boolean canBubbleArg, boolean cancelableArg, Node relatedNodeArg, String prevNamespaceURIArg, String prevNodeNameArg); }