fi.hut.tml.xsmiles.mlfc.xbl2.dom
Class HandlerElementImpl

java.lang.Object
  extended byorg.apache.xerces.dom.NodeImpl
      extended byorg.apache.xerces.dom.ChildNode
          extended byorg.apache.xerces.dom.ParentNode
              extended byorg.apache.xerces.dom.ElementImpl
                  extended byorg.apache.xerces.dom.ElementNSImpl
                      extended byfi.hut.tml.xsmiles.dom.XSmilesElementImpl
                          extended byfi.hut.tml.xsmiles.mlfc.xbl2.dom.ElementImpl
                              extended byfi.hut.tml.xsmiles.mlfc.xbl2.dom.HandlerElementImpl
All Implemented Interfaces:
java.lang.Cloneable, org.w3c.dom.Element, org.w3c.dom.events.EventTarget, InitializableElement, org.w3c.dom.Node, org.w3c.dom.NodeList, PseudoClassController, ResourceFetcher, java.io.Serializable, StylableElement, org.w3c.dom.TypeInfo

public class HandlerElementImpl
extends ElementImpl

XBL-element: handler

Author:
Mikko Vestola
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
XSmilesElementImpl.PseudoNodeList
 
Field Summary
static java.lang.String ALTKEY
           
static java.lang.String CTRLKEY
           
static java.lang.String METAKEY
           
static java.lang.String SHIFTKEY
           
 
Fields inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
DESTROYED, elementStatus, INITIALIZED, INITIALIZING, setPseudoClasses, style, UNINITIALIZED, xblpropname
 
Fields inherited from class org.apache.xerces.dom.ElementNSImpl
localName, namespaceURI
 
Fields inherited from class org.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE, UNNORMALIZED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
HandlerElementImpl(org.apache.xerces.dom.DocumentImpl owner, java.lang.String namespace, java.lang.String tag)
           
 
Method Summary
 boolean acceptsAttrChange(short attrChange)
          Helper method for filtering mutation events.
 boolean acceptsAttrName(java.lang.String attrName)
          Helper method for filtering mutation events.
 boolean acceptsButton(int buttonNumb)
          Checks that will the handler accept this button when filtering events.
 boolean acceptsClickCount(int cc)
          This function checks if the "click-count" filter attribute on the event matches the one in the handler.
 boolean acceptsDefaultAction()
          Checks whether the default action should be allowed.
 boolean acceptsModifiers(boolean ctrlKey, boolean shiftKey, boolean altKey, boolean metaKey)
          This method checks that does this handler accept the modifiers given in parameters.
 boolean acceptsNewValue(java.lang.String newValue)
          Helper method for filtering mutation events.
 boolean acceptsPhase(int phase)
          Checks whether the events phase matches the phase attribute on this handler
 boolean acceptsPrevValue(java.lang.String prevValue)
          Helper method for filtering mutation events.
 boolean acceptsTrusted(boolean trusted)
          This function checks if the "trusted" filter attribute on the event matches the one in the handler.
 java.lang.String getEventName()
           
 XBLHandler getXBLHandler()
           
static java.lang.String[] parseSpaceSeparatedList(java.lang.String list)
          This method parses the space separated list and returns an array containing the separated values.
 boolean propagate()
          From the W3C XBL 2.0 specification: The propagate attribute specifies whether, after processing all listeners at the current node, the event is allowed to continue on its path (either in the capture or the bubble phase).
 
Methods inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
addBinding, addUndistributedChild, clone, clonePseudoElements, cloneSubtree, debugNode, debugNode, destroy, dispatchEventInMainThread, get, getApplyBindingSheets, getAuthorSheets, getChildNodes, getElementStatus, getId, getOriginalClone, getPseudoClass, getResourceReferencer, getRuleNode, getStyle, getStyleAttrValue, getText, getText, getUndistributedChildNodes, getXblImplementations, hasBinding, hasStyle, init, initFinalFlattenedTree, initStyle, isInitedForReset, isPseudoClass, removeBinding, removeUndistributedChild, replaceNode, resetFinalFlattenedTree, resolveURI, searchElementWithId, searchElementWithId, setApplyBindingSheets, setAuthorSheets, setPseudoClass, setRuleNode, setStyle, updateStyle
 
Methods inherited from class org.apache.xerces.dom.ElementNSImpl
getBaseURI, getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, setPrefix, setType, setValues
 
Methods inherited from class org.apache.xerces.dom.ElementImpl
cloneNode, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isEqualNode, normalize, reconcileDefaultAttributes, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, insertBefore, item, removeChild, replaceChild, setTextContent, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setUserData, setUserData, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Field Detail

CTRLKEY

public static final java.lang.String CTRLKEY
See Also:
Constant Field Values

SHIFTKEY

public static final java.lang.String SHIFTKEY
See Also:
Constant Field Values

ALTKEY

public static final java.lang.String ALTKEY
See Also:
Constant Field Values

METAKEY

public static final java.lang.String METAKEY
See Also:
Constant Field Values
Constructor Detail

HandlerElementImpl

public HandlerElementImpl(org.apache.xerces.dom.DocumentImpl owner,
                          java.lang.String namespace,
                          java.lang.String tag)
Method Detail

getXBLHandler

public XBLHandler getXBLHandler()

parseSpaceSeparatedList

public static java.lang.String[] parseSpaceSeparatedList(java.lang.String list)
This method parses the space separated list and returns an array containing the separated values.

Parameters:
list - Space separated list (e.g. "12 3 35 foo bar"), is allowed to contain other whitespace characters which are removed.
Returns:
Returns the values in array, whitespaces removed, each value in its own cell (e.g. [12,3,35,foo,bar]. If the string is just whitespaces, returns an empty array.

propagate

public boolean propagate()
From the W3C XBL 2.0 specification: The propagate attribute specifies whether, after processing all listeners at the current node, the event is allowed to continue on its path (either in the capture or the bubble phase). The possible values are stop and continue (the default). If stop is specified, then after the event handler has been fired, the event's stopPropagation() method must be called.

Returns:
If the propagate attribute is set to "stop", returns false. Otherwise returns true.

acceptsButton

public boolean acceptsButton(int buttonNumb)
Checks that will the handler accept this button when filtering events. The handler has a list of button numbers that it accepts.

Parameters:
buttonNumb - Button number
Returns:
True, if the hanler has the button number in its button attribute (space separated list) or the handler accepts every button (so the button attribute is not set). False, if the handler does not accept the button.

acceptsModifiers

public boolean acceptsModifiers(boolean ctrlKey,
                                boolean shiftKey,
                                boolean altKey,
                                boolean metaKey)
This method checks that does this handler accept the modifiers given in parameters. Handler has a list of modifiers (e.g. modifiers="alt -control") and based on the list, it filters events. The filter matches if all the modifiers that the UI supports are accounted for, and none of the modifiers made the filter fail.

Parameters:
ctrlKey - Was control key down?
shiftKey - Was shift key down?
altKey - Was alt key down?
metaKey - Was meta key down?
Returns:
True, if the filter matches. False, if the filter does not match.

acceptsClickCount

public boolean acceptsClickCount(int cc)
This function checks if the "click-count" filter attribute on the event matches the one in the handler. Click-count attribute is a space-separated list of values one of which must match for this filter to pass.

Parameters:
cc - click-count from the detail-attribute of the event
Returns:
whether the filter matches the event.

acceptsTrusted

public boolean acceptsTrusted(boolean trusted)
This function checks if the "trusted" filter attribute on the event matches the one in the handler.

Parameters:
trusted - value of the trusted attribute on the event object
Returns:
whether the filter matches the event.

acceptsPhase

public boolean acceptsPhase(int phase)
Checks whether the events phase matches the phase attribute on this handler

Parameters:
phase - the events phase
Returns:
whether it matches the phase attribute on the handler

acceptsDefaultAction

public boolean acceptsDefaultAction()
Checks whether the default action should be allowed.

Returns:
true if allowed, false if it should be prevented

acceptsPrevValue

public boolean acceptsPrevValue(java.lang.String prevValue)
Helper method for filtering mutation events.

Parameters:
prevValue - The prevValue attribute of the event object.
Returns:
True if the handler's prev-value attribute matches the string given in parameters or the handler doesn't have the specified attribute. False otherwise.

acceptsNewValue

public boolean acceptsNewValue(java.lang.String newValue)
Helper method for filtering mutation events.

Parameters:
newValue - The newValue attribute of the event object.
Returns:
True if the handler's new-value attribute matches the string given in parameters or the handler doesn't have the specified attribute. False otherwise.

acceptsAttrName

public boolean acceptsAttrName(java.lang.String attrName)
Helper method for filtering mutation events.

Parameters:
attrName - The attrName attribute of the event object.
Returns:
True if the handler's attr-name attribute matches the string given in parameters or the handler doesn't have the specified attribute. False otherwise.

acceptsAttrChange

public boolean acceptsAttrChange(short attrChange)
Helper method for filtering mutation events.

Parameters:
attrChange - The attrChange attribute of the event object.
Returns:
True if some of the values in the handler's attr-change attribute (space-separated list of values from the three literal keywords: modification, addition and removal, which map to the short values in MutationEventImpl) matches the short value given in parameters or the handler doesn't have the attr-change attribute. False otherwise.
See Also:
MutationEventImpl

getEventName

public java.lang.String getEventName()


X-Smiles 1.2