Skip to main content

HyperlinkHelper

Package: velox.api.layer1.utils

Type: Class

Inheritance: java.lang.Object รขโ€ โ€™ velox.api.layer1.utils.HyperlinkHelper

Constructorsโ€‹

HyperlinkHelperโ€‹

public HyperlinkHelper()

Methodsโ€‹

openInBrowserโ€‹

public static void openInBrowser(String url)

Opens the provided link in the browser and sends event statistics that this link was opened. Where possible, prioritize the use of the openInBrowser(String url, JComponent source) method to provide better context.

Parameters:

  • url - URL to be opened

openInBrowserโ€‹

public static void openInBrowser(String url, JComponent component)

See openInBrowser(String url)

Parameters:

  • component - The interaction with which triggered the opening of the link

addHyperlinkListenerโ€‹

public static void addHyperlinkListener(JEditorPane editorPane)

Adds HyperlinkListener that opens links in the browser when clicking on them. Make sure that you use links with protocol, otherwise an exception will be thrown when trying to follow the link.

Parameters:

  • editorPane - Editor pane to which the listener will be added

removeHyperlinkListenerโ€‹

public static void removeHyperlinkListener(JEditorPane editorPane)

Removes the hyperlink listener if you added it before using addHyperlinkListener(JEditorPane editorPane)

Parameters:

  • editorPane - Editor pane from which the listener will be removed