public class DomElement extends DomNamespaceNode implements Element
Modifier and Type | Class and Description |
---|---|
protected static class |
DomElement.ChildElementsIterator
An iterator over the DomElement children.
|
DomNode.ChildIterator, DomNode.DescendantDomElementsIterator, DomNode.DescendantDomNodesIterator, DomNode.DescendantElementsIterator<T extends DomNode>, DomNode.DescendantHtmlElementsIterator
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_NOT_DEFINED
Constant meaning that the specified attribute was not defined.
|
static String |
ATTRIBUTE_VALUE_EMPTY
Constant meaning that the specified attribute was found but its value was empty.
|
static String |
ID_ATTRIBUTE
id.
|
static String |
NAME_ATTRIBUTE
name.
|
static String |
SRC_ATTRIBUTE
src.
|
static String |
TYPE_ATTRIBUTE
type.
|
static String |
VALUE_ATTRIBUTE
value.
|
PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
DomElement(String namespaceURI,
String qualifiedName,
SgmlPage page,
Map<String,DomAttr> attributes)
Creates an instance of a DOM element that can have a namespace.
|
Modifier and Type | Method and Description |
---|---|
void |
blur()
Removes focus from this element.
|
<P extends Page> |
click()
Simulates clicking on this element, returning the page in the window that has the focus
after the element has been clicked.
|
<P extends Page> |
click(boolean shiftKey,
boolean ctrlKey,
boolean altKey)
Simulates clicking on this element, returning the page in the window that has the focus
after the element has been clicked.
|
<P extends Page> |
click(boolean shiftKey,
boolean ctrlKey,
boolean altKey,
boolean triggerMouseEvents)
Simulates clicking on this element, returning the page in the window that has the focus
after the element has been clicked.
|
<P extends Page> |
click(boolean shiftKey,
boolean ctrlKey,
boolean altKey,
boolean triggerMouseEvents,
boolean handleFocus,
boolean ignoreVisibility,
boolean disableProcessLabelAfterBubbling)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
<P extends Page> |
click(Event event,
boolean shiftKey,
boolean ctrlKey,
boolean altKey,
boolean ignoreVisibility)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
DomNode |
cloneNode(boolean deep) |
<P extends Page> |
dblClick()
Simulates double-clicking on this element, returning the page in the window that has the focus
after the element has been clicked.
|
<P extends Page> |
dblClick(boolean shiftKey,
boolean ctrlKey,
boolean altKey)
Simulates double-clicking on this element, returning the page in the window that has the focus
after the element has been clicked.
|
protected void |
doClickFireChangeEvent()
This method implements the control onchange handler call during the click action.
|
protected ScriptResult |
doClickFireClickEvent(Event event)
This method implements the control onclick handler call during the click action.
|
protected boolean |
doClickStateUpdate(boolean shiftKey,
boolean ctrlKey)
This method implements the control state update part of the click action.
|
ScriptResult |
fireEvent(Event event)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
ScriptResult |
fireEvent(String eventType)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
focus()
Sets the focus on this element.
|
String |
getAttribute(String attributeName)
Returns the value of the attribute specified by name or an empty string.
|
String |
getAttributeDirect(String attributeName)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
DomAttr |
getAttributeNode(String name) |
DomAttr |
getAttributeNodeNS(String namespaceURI,
String localName) |
String |
getAttributeNS(String namespaceURI,
String localName)
Returns the value of the attribute specified by namespace and local name or an empty
string.
|
NamedNodeMap |
getAttributes() |
Map<String,DomAttr> |
getAttributesMap()
Returns the map holding the attributes, keyed by name.
|
int |
getChildElementCount()
Returns the current number of element nodes that are children of this element.
|
Iterable<DomElement> |
getChildElements() |
DomNodeList<HtmlElement> |
getElementsByTagName(String tagName) |
DomNodeList<HtmlElement> |
getElementsByTagNameNS(String namespace,
String localName)
Not yet implemented.
|
protected DomNode |
getEventTargetElement()
Returns the event target element.
|
DomElement |
getFirstElementChild()
Returns the first child element node of this element. null if this element has no child elements.
|
String |
getId() |
DomElement |
getLastElementChild()
Returns the last child element node of this element. null if this element has no child elements.
|
String |
getNodeName() |
short |
getNodeType() |
TypeInfo |
getSchemaTypeInfo()
Not yet implemented.
|
<E extends HtmlElement> |
getStaticElementsByTagName(String tagName)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
StyleElement |
getStyleElement(String name)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
StyleElement |
getStyleElementCaseInSensitive(String name)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
LinkedHashMap<String,StyleElement> |
getStyleMap()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
String |
getTagName()
Returns the tag name of this element.
|
boolean |
hasAttribute(String attributeName)
Returns whether the attribute specified by name has a value.
|
boolean |
hasAttributeNS(String namespaceURI,
String localName)
Returns whether the attribute specified by namespace and local name has a value.
|
boolean |
hasAttributes() |
protected boolean |
isAttributeCaseSensitive()
Indicates if the attribute names are case sensitive.
|
protected boolean |
isDisabledElementAndDisabled() |
protected boolean |
isEmptyXmlTagExpanded()
Indicates if a node without children should be written in expanded form as XML
(i.e. with closing tag rather than with "/>")
|
boolean |
isMouseOver()
Returns whether the Mouse is currently over this element or not.
|
protected boolean |
isStateUpdateFirst()
Returns
true if state updates should be done before onclick event handling. |
boolean |
matches(String selectorString)
Returns true if the element would be selected by the specified selector string; otherwise, returns false.
|
Page |
mouseDown()
Simulates clicking the mouse on this element, returning the page which this element's window contains
after the mouse click.
|
Page |
mouseDown(boolean shiftKey,
boolean ctrlKey,
boolean altKey,
int button)
Simulates clicking the mouse on this element, returning the page which this element's window contains
after the mouse click.
|
Page |
mouseMove()
Simulates moving the mouse over this element, returning the page which this element's window contains
after the mouse move.
|
Page |
mouseMove(boolean shiftKey,
boolean ctrlKey,
boolean altKey,
int button)
Simulates moving the mouse over this element, returning the page which this element's window contains
after the mouse move.
|
Page |
mouseOut()
Simulates moving the mouse out of this element, returning the page which this element's window contains
after the mouse move.
|
Page |
mouseOut(boolean shiftKey,
boolean ctrlKey,
boolean altKey,
int button)
Simulates moving the mouse out of this element, returning the page which this element's window contains
after the mouse move.
|
Page |
mouseOver()
Simulates moving the mouse over this element, returning the page which this element's window contains
after the mouse move.
|
Page |
mouseOver(boolean shiftKey,
boolean ctrlKey,
boolean altKey,
int button)
Simulates moving the mouse over this element, returning the page which this element's window contains
after the mouse move.
|
Page |
mouseUp()
Simulates releasing the mouse click on this element, returning the page which this element's window contains
after the mouse click release.
|
Page |
mouseUp(boolean shiftKey,
boolean ctrlKey,
boolean altKey,
int button)
Simulates releasing the mouse click on this element, returning the page which this element's window contains
after the mouse click release.
|
protected void |
preventDefault()
This method is called if the current fired event is canceled by
preventDefault() . |
protected void |
printOpeningTagContentAsXml(PrintWriter printWriter)
Prints the content between "<" and ">" (or "/>") in the output of the tag name
and its attributes in XML format.
|
protected void |
printXml(String indent,
PrintWriter printWriter)
Recursively write the XML data for the node tree starting at
node . |
protected boolean |
propagateClickStateUpdateToParent() |
void |
removeAttribute(String attributeName)
Removes an attribute specified by name from this element.
|
Attr |
removeAttributeNode(Attr attribute)
Not yet implemented.
|
void |
removeAttributeNS(String namespaceURI,
String localName)
Removes an attribute specified by namespace and local name from this element.
|
void |
removeFocus()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
String |
removeStyleAttribute(String name)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
replaceStyleAttribute(String name,
String value,
String priority)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
Page |
rightClick()
Simulates right clicking the mouse on this element, returning the page which this element's window
contains after the mouse click.
|
Page |
rightClick(boolean shiftKey,
boolean ctrlKey,
boolean altKey)
Simulates right clicking the mouse on this element, returning the page which this element's window
contains after the mouse click.
|
void |
setAttribute(String attributeName,
String attributeValue)
Sets the value of the attribute specified by name.
|
Attr |
setAttributeNode(Attr attribute) |
Attr |
setAttributeNodeNS(Attr attribute)
Not yet implemented.
|
void |
setAttributeNS(String namespaceURI,
String qualifiedName,
String attributeValue)
Sets the value of the attribute specified by namespace and qualified name.
|
protected void |
setAttributeNS(String namespaceURI,
String qualifiedName,
String attributeValue,
boolean notifyAttributeChangeListeners,
boolean notifyMutationObservers)
Sets the value of the attribute specified by namespace and qualified name.
|
void |
setDefaults(ComputedCssStyleDeclaration style)
Callback method which allows different HTML element types to perform custom
initialization of computed styles.
|
void |
setId(String newId)
Sets the identifier this element.
|
void |
setIdAttribute(String name,
boolean isId)
Not yet implemented.
|
void |
setIdAttributeNode(Attr idAttr,
boolean isId)
Not yet implemented.
|
void |
setIdAttributeNS(String namespaceURI,
String localName,
boolean isId)
Not yet implemented.
|
void |
setInnerHtml(String source)
Replaces all child elements of this element with the supplied value parsed as html.
|
void |
setNodeValue(String value) |
String |
toString()
Returns a string representation of this element.
|
void |
writeStyleToElement(Map<String,StyleElement> styleMap)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
getLocalName, getLowercaseName, getNamespaceURI, getPrefix, getQualifiedName, processImportNode, setPrefix
addCharacterDataChangeListener, addDomChangeListener, appendChild, asNormalizedText, asXml, basicRemove, checkChildHierarchy, closest, compareDocumentPosition, detach, fireCharacterDataChanged, fireNodeAdded, fireNodeDeleted, getAncestors, getBaseURI, getByXPath, getByXPath, getCanonicalXPath, getChildNodes, getChildren, getDescendants, getDomElementDescendants, getEndColumnNumber, getEndLineNumber, getFeature, getFirstByXPath, getFirstByXPath, getFirstChild, getHtmlElementDescendants, getHtmlPageOrNull, getIndex, getLastChild, getNextElementSibling, getNextSibling, getNodeValue, getOwnerDocument, getPage, getParentNode, getPreviousElementSibling, getPreviousSibling, getReadyState, getScriptableObject, getSelectorList, getStartColumnNumber, getStartLineNumber, getTextContent, getUserData, getVisibleText, handles, hasChildNodes, hasFeature, insertBefore, insertBefore, isAncestorOf, isAncestorOfAny, isAttachedToPage, isDefaultNamespace, isDisplayed, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, mayBeDisplayed, normalize, notifyIncorrectness, onAddedToDocumentFragment, onAddedToPage, onAllChildrenAddedToPage, parseHtmlSnippet, printChildrenAsXml, querySelector, querySelectorAll, quietlyRemoveAndMoveChildrenTo, remove, removeAllChildren, removeCharacterDataChangeListener, removeChild, removeDomChangeListener, replace, replaceChild, setEndLocation, setParentNode, setReadyState, setScriptableObject, setStartLocation, setTextContent, setUserData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
appendChild, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setPrefix, setTextContent, setUserData
public static final String ID_ATTRIBUTE
public static final String NAME_ATTRIBUTE
public static final String SRC_ATTRIBUTE
public static final String VALUE_ATTRIBUTE
public static final String TYPE_ATTRIBUTE
public static final String ATTRIBUTE_NOT_DEFINED
public static final String ATTRIBUTE_VALUE_EMPTY
public DomElement(String namespaceURI, String qualifiedName, SgmlPage page, Map<String,DomAttr> attributes)
namespaceURI
- the URI that identifies an XML namespacequalifiedName
- the qualified name of the element type to instantiatepage
- the page that contains this elementattributes
- a map ready initialized with the attributes for this element, or
null
. The map will be stored as is, not copied.public String getNodeName()
getNodeName
in interface Node
public final short getNodeType()
getNodeType
in interface Node
public final String getTagName()
getTagName
in interface Element
public final boolean hasAttributes()
hasAttributes
in interface Node
hasAttributes
in class DomNode
public boolean hasAttribute(String attributeName)
hasAttribute
in interface Element
attributeName
- the name of the attributepublic void replaceStyleAttribute(String name, String value, String priority)
name
- the attribute name (delimiter-separated, not camel-cased)value
- the attribute valuepriority
- the new priority of the property; "important"
or the empty string if none.public String removeStyleAttribute(String name)
name
- the attribute name (delimiter-separated, not camel-cased)public StyleElement getStyleElement(String name)
name
- the name of the requested StyleElementpublic StyleElement getStyleElementCaseInSensitive(String name)
name
- the name of the requested StyleElementpublic LinkedHashMap<String,StyleElement> getStyleMap()
LinkedHashMap
map so that results are deterministic and are thus testable.protected void printOpeningTagContentAsXml(PrintWriter printWriter)
printWriter
- the writer to print inprotected void printXml(String indent, PrintWriter printWriter)
node
.protected boolean isEmptyXmlTagExpanded()
false
by defaultpublic String getAttribute(String attributeName)
ATTRIBUTE_NOT_DEFINED
if the attribute wasn't specified or ATTRIBUTE_VALUE_EMPTY
if the
attribute was specified but it was empty.getAttribute
in interface Element
attributeName
- the name of the attributeATTRIBUTE_NOT_DEFINED
or ATTRIBUTE_VALUE_EMPTY
public String getAttributeDirect(String attributeName)
attributeName
- the name of the attributeATTRIBUTE_NOT_DEFINED
or ATTRIBUTE_VALUE_EMPTY
public void removeAttribute(String attributeName)
removeAttribute
in interface Element
attributeName
- the attribute attributeNamepublic final void removeAttributeNS(String namespaceURI, String localName)
removeAttributeNS
in interface Element
namespaceURI
- the URI that identifies an XML namespacelocalName
- the name within the namespacepublic final Attr removeAttributeNode(Attr attribute)
removeAttributeNode
in interface Element
public final boolean hasAttributeNS(String namespaceURI, String localName)
hasAttributeNS
in interface Element
namespaceURI
- the URI that identifies an XML namespacelocalName
- the name within the namespacepublic final Map<String,DomAttr> getAttributesMap()
public NamedNodeMap getAttributes()
getAttributes
in interface Node
getAttributes
in class DomNode
public void setAttribute(String attributeName, String attributeValue)
setAttribute
in interface Element
attributeName
- the name of the attributeattributeValue
- the value of the attributepublic void setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue)
setAttributeNS
in interface Element
namespaceURI
- the URI that identifies an XML namespacequalifiedName
- the qualified name (prefix:local) of the attributeattributeValue
- the value of the attributeprotected void setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue, boolean notifyAttributeChangeListeners, boolean notifyMutationObservers)
namespaceURI
- the URI that identifies an XML namespacequalifiedName
- the qualified name (prefix:local) of the attributeattributeValue
- the value of the attributenotifyAttributeChangeListeners
- to notify the associated HtmlAttributeChangeListener
snotifyMutationObservers
- to notify MutationObserver
s or notprotected boolean isAttributeCaseSensitive()
true
public final String getAttributeNS(String namespaceURI, String localName)
ATTRIBUTE_NOT_DEFINED
if the attribute wasn't specified or ATTRIBUTE_VALUE_EMPTY
if the
attribute was specified but it was empty.getAttributeNS
in interface Element
namespaceURI
- the URI that identifies an XML namespacelocalName
- the name within the namespaceATTRIBUTE_NOT_DEFINED
or ATTRIBUTE_VALUE_EMPTY
public DomAttr getAttributeNode(String name)
getAttributeNode
in interface Element
public DomAttr getAttributeNodeNS(String namespaceURI, String localName)
getAttributeNodeNS
in interface Element
public void writeStyleToElement(Map<String,StyleElement> styleMap)
styleMap
- the stylespublic DomNodeList<HtmlElement> getElementsByTagName(String tagName)
getElementsByTagName
in interface Element
public <E extends HtmlElement> List<E> getStaticElementsByTagName(String tagName)
E
- the specific HtmlElement typetagName
- The name of the tag to match onpublic DomNodeList<HtmlElement> getElementsByTagNameNS(String namespace, String localName)
getElementsByTagNameNS
in interface Element
public TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo
in interface Element
public void setIdAttribute(String name, boolean isId)
setIdAttribute
in interface Element
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
setIdAttributeNS
in interface Element
public Attr setAttributeNode(Attr attribute)
setAttributeNode
in interface Element
public Attr setAttributeNodeNS(Attr attribute)
setAttributeNodeNS
in interface Element
public final void setIdAttributeNode(Attr idAttr, boolean isId)
setIdAttributeNode
in interface Element
public DomNode cloneNode(boolean deep)
public final String getId()
public final void setId(String newId)
newId
- the new identifier of this elementpublic DomElement getFirstElementChild()
public DomElement getLastElementChild()
public int getChildElementCount()
public final Iterable<DomElement> getChildElements()
public String toString()
public <P extends Page> P click() throws IOException
P
- the page typeWebClient.getCurrentWindow()
IOException
- if an IO error occurspublic <P extends Page> P click(boolean shiftKey, boolean ctrlKey, boolean altKey) throws IOException
P
- the page typeshiftKey
- true
if SHIFT is pressed during the clickctrlKey
- true
if CTRL is pressed during the clickaltKey
- true
if ALT is pressed during the clickWebClient.getCurrentWindow()
IOException
- if an IO error occurspublic <P extends Page> P click(boolean shiftKey, boolean ctrlKey, boolean altKey, boolean triggerMouseEvents) throws IOException
P
- the page typeshiftKey
- true
if SHIFT is pressed during the clickctrlKey
- true
if CTRL is pressed during the clickaltKey
- true
if ALT is pressed during the clicktriggerMouseEvents
- if true trigger the mouse events alsoWebClient.getCurrentWindow()
IOException
- if an IO error occursprotected boolean isDisabledElementAndDisabled()
DisabledElement
and disabledpublic <P extends Page> P click(boolean shiftKey, boolean ctrlKey, boolean altKey, boolean triggerMouseEvents, boolean handleFocus, boolean ignoreVisibility, boolean disableProcessLabelAfterBubbling) throws IOException
P
- the page typeshiftKey
- true
if SHIFT is pressed during the clickctrlKey
- true
if CTRL is pressed during the clickaltKey
- true
if ALT is pressed during the clicktriggerMouseEvents
- if true trigger the mouse events alsohandleFocus
- if true set the focus (and trigger the event)ignoreVisibility
- whether to ignore visibility or notdisableProcessLabelAfterBubbling
- ignore label processingWebClient.getCurrentWindow()
IOException
- if an IO error occursprotected DomNode getEventTargetElement()
public <P extends Page> P click(Event event, boolean shiftKey, boolean ctrlKey, boolean altKey, boolean ignoreVisibility) throws IOException
P
- the page typeevent
- the click event usedshiftKey
- true
if SHIFT is pressed during the clickctrlKey
- true
if CTRL is pressed during the clickaltKey
- true
if ALT is pressed during the clickignoreVisibility
- whether to ignore visibility or notWebClient.getCurrentWindow()
IOException
- if an IO error occursprotected boolean doClickStateUpdate(boolean shiftKey, boolean ctrlKey) throws IOException
The default implementation only calls doClickStateUpdate on parent's DomElement (if any).
Subclasses requiring different behavior (like HtmlSubmitInput
) will override this method.
shiftKey
- true
if SHIFT is pressedctrlKey
- true
if CTRL is pressedIOException
- if an IO error occursprotected boolean propagateClickStateUpdateToParent()
Usually the click is propagated to the parent. Overwrite if you
like to disable this.
protected void doClickFireChangeEvent()
protected ScriptResult doClickFireClickEvent(Event event)
event
- the click event usedpublic <P extends Page> P dblClick() throws IOException
click()
is automatically called first.P
- the page typeIOException
- if an IO error occurspublic <P extends Page> P dblClick(boolean shiftKey, boolean ctrlKey, boolean altKey) throws IOException
click(boolean, boolean, boolean)
is automatically
called first.P
- the page typeshiftKey
- true
if SHIFT is pressed during the double-clickctrlKey
- true
if CTRL is pressed during the double-clickaltKey
- true
if ALT is pressed during the double-clickIOException
- if an IO error occurspublic Page mouseOver()
public Page mouseOver(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
shiftKey
- true
if SHIFT is pressed during the mouse movectrlKey
- true
if CTRL is pressed during the mouse movealtKey
- true
if ALT is pressed during the mouse movebutton
- the button code, must be MouseEvent.BUTTON_LEFT
, MouseEvent.BUTTON_MIDDLE
or MouseEvent.BUTTON_RIGHT
public Page mouseMove()
public Page mouseMove(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
shiftKey
- true
if SHIFT is pressed during the mouse movectrlKey
- true
if CTRL is pressed during the mouse movealtKey
- true
if ALT is pressed during the mouse movebutton
- the button code, must be MouseEvent.BUTTON_LEFT
, MouseEvent.BUTTON_MIDDLE
or MouseEvent.BUTTON_RIGHT
public Page mouseOut()
public Page mouseOut(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
shiftKey
- true
if SHIFT is pressed during the mouse movectrlKey
- true
if CTRL is pressed during the mouse movealtKey
- true
if ALT is pressed during the mouse movebutton
- the button code, must be MouseEvent.BUTTON_LEFT
, MouseEvent.BUTTON_MIDDLE
or MouseEvent.BUTTON_RIGHT
public Page mouseDown()
public Page mouseDown(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
shiftKey
- true
if SHIFT is pressed during the mouse clickctrlKey
- true
if CTRL is pressed during the mouse clickaltKey
- true
if ALT is pressed during the mouse clickbutton
- the button code, must be MouseEvent.BUTTON_LEFT
, MouseEvent.BUTTON_MIDDLE
or MouseEvent.BUTTON_RIGHT
public Page mouseUp()
public Page mouseUp(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
shiftKey
- true
if SHIFT is pressed during the mouse click releasectrlKey
- true
if CTRL is pressed during the mouse click releasealtKey
- true
if ALT is pressed during the mouse click releasebutton
- the button code, must be MouseEvent.BUTTON_LEFT
, MouseEvent.BUTTON_MIDDLE
or MouseEvent.BUTTON_RIGHT
public Page rightClick()
public Page rightClick(boolean shiftKey, boolean ctrlKey, boolean altKey)
shiftKey
- true
if SHIFT is pressed during the mouse clickctrlKey
- true
if CTRL is pressed during the mouse clickaltKey
- true
if ALT is pressed during the mouse clickpublic ScriptResult fireEvent(String eventType)
eventType
- the event type (like "load", "click")null
if nothing is executedpublic ScriptResult fireEvent(Event event)
event
- the event to firenull
if nothing is executedprotected void preventDefault()
preventDefault()
.
The default implementation does nothing.
public void focus()
public void blur()
public void removeFocus()
protected boolean isStateUpdateFirst()
true
if state updates should be done before onclick event handling. This method
returns false
by default, and is expected to be overridden to return true
by
derived classes like HtmlCheckBoxInput
.true
if state updates should be done before onclick event handlingpublic boolean isMouseOver()
public boolean matches(String selectorString)
selectorString
- the selector to testpublic void setNodeValue(String value)
setNodeValue
in interface Node
public void setDefaults(ComputedCssStyleDeclaration style)
style
- the style to initializepublic void setInnerHtml(String source) throws SAXException, IOException
source
- the new value for the contents of this elementSAXException
- in case of errorIOException
- in case of errorCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.