public final class DomEventConverter extends Object
DOM Events
to Swing's HyperlinkEvents
.
This class is thread-safe, i.e. the provided methods can be called from different threads and concurrent executions do not interfere with each other.
Constructor and Description |
---|
DomEventConverter() |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvertToHyperlinkEvent(Event domEvent)
Indicates whether the specified DOM event can be converted to a
HyperlinkEvent . |
HyperlinkEvent |
convertToHyperlinkEvent(Event domEvent,
Object source)
Converts the specified DOM event to a hyperlink event.
|
public boolean canConvertToHyperlinkEvent(Event domEvent)
HyperlinkEvent
.public HyperlinkEvent convertToHyperlinkEvent(Event domEvent, Object source) throws IllegalArgumentException
domEvent
- the DOM-Event
from which the HyperlinkEvent
will be createdsource
- the source of the domEvent
HyperlinkEvent
with the following properties:
getEventType()
returns the HyperlinkEvent.EventType
corresponding to
the domEvent's type as defined by DomEventType
getSource()
returns the specified source
getUrl()
returns the href-attribute's value of the event's source
element
getDescription()
returns the text content of the event's
source element
getInputEvent()
returns null
getSourceElement()
returns null
IllegalArgumentException
- if the specified event can not be converted to a hyperlink event; this is the case if
canConvertToHyperlinkEvent(Event)
returns falseThis documentation is licensed under CC-BY 4.0, attributed to Nicolai Parlog from CodeFX.