public final class WebViews extends Object
WebView
.Modifier and Type | Method and Description |
---|---|
static WebViewHyperlinkListenerHandle |
addHyperlinkListener(javafx.scene.web.WebView webView,
WebViewHyperlinkListener listener)
|
static WebViewHyperlinkListenerHandle |
addHyperlinkListener(javafx.scene.web.WebView webView,
WebViewHyperlinkListener listener,
HyperlinkEvent.EventType eventType)
|
static boolean |
canConvertToHyperlinkEvent(Event domEvent)
Indicates whether the specified DOM event can be converted to a
HyperlinkEvent . |
static HyperlinkEvent |
convertToHyperlinkEvent(Event domEvent,
Object source)
Converts the specified DOM event to a hyperlink event.
|
static WebViewHyperlinkListenerHandle |
createHyperlinkListenerHandle(javafx.scene.web.WebView webView,
WebViewHyperlinkListener listener)
Creates a handle with which the specified listener can be
attached to the specified web view. |
static WebViewHyperlinkListenerHandle |
createHyperlinkListenerHandle(javafx.scene.web.WebView webView,
WebViewHyperlinkListener listener,
HyperlinkEvent.EventType eventType)
Creates a handle with which the specified listener can be
attached to the specified web view. |
static String |
domEventToString(Event event)
Returns a string representation of the specified event.
|
static String |
hyperlinkEventToString(HyperlinkEvent event)
Returns a string representation of the specified event.
|
public static WebViewHyperlinkListenerHandle createHyperlinkListenerHandle(javafx.scene.web.WebView webView, WebViewHyperlinkListener listener)
attached
to the specified web view.
Once attached, the listener will be called on any event on an hyperlink (i.e. any element with tag name "a")
which can be represented as a HyperlinkEvent
. This is the case on MOUSE_ENTER
, MOUSE_LEAVE
and CLICK
.
webView
- the WebView
to which the listener will be addedlistener
- the WebViewHyperlinkListener
to add to the web viewaddHyperlinkListener(WebView, WebViewHyperlinkListener)
public static WebViewHyperlinkListenerHandle createHyperlinkListenerHandle(javafx.scene.web.WebView webView, WebViewHyperlinkListener listener, HyperlinkEvent.EventType eventType)
attached
to the specified web view.
Once attached, the listener will be called on any event on an hyperlink (i.e. any element with tag name "a")
which can be represented as a HyperlinkEvent
with the specified event type. See
DomEventType.toHyperlinkEventType()
for the conversion of event types.
webView
- the WebView
to which the listener will be addedlistener
- the WebViewHyperlinkListener
to add to the web vieweventType
- the HyperlinkEvent.EventType
of all events passed to the listeneraddHyperlinkListener(WebView, WebViewHyperlinkListener, HyperlinkEvent.EventType)
public static WebViewHyperlinkListenerHandle addHyperlinkListener(javafx.scene.web.WebView webView, WebViewHyperlinkListener listener)
webView
- the WebView
to which the listener will be addedlistener
- the WebViewHyperlinkListener
to add to the web viewcreateHyperlinkListenerHandle(WebView, WebViewHyperlinkListener)
public static WebViewHyperlinkListenerHandle addHyperlinkListener(javafx.scene.web.WebView webView, WebViewHyperlinkListener listener, HyperlinkEvent.EventType eventType)
webView
- the WebView
to which the listener will be addedlistener
- the WebViewHyperlinkListener
to add to the web vieweventType
- the HyperlinkEvent.EventType
of all events passed to the listenercreateHyperlinkListenerHandle(WebView, WebViewHyperlinkListener, HyperlinkEvent.EventType)
public static boolean canConvertToHyperlinkEvent(Event domEvent)
HyperlinkEvent
.public static 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
IllegalArgumentException
- if the specified event can not be converted to a hyperlink event; this is the case if
canConvertToHyperlinkEvent(Event)
returns falsepublic static String hyperlinkEventToString(HyperlinkEvent event)
event
- the HyperlinkEvent
which will be converted to a stringThis documentation is licensed under CC-BY 4.0, attributed to Nicolai Parlog from CodeFX.