Package velox.api.layer1.utils
Class HyperlinkHelper
java.lang.Object
velox.api.layer1.utils.HyperlinkHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddHyperlinkListener(JEditorPane editorPane) AddsHyperlinkListenerthat opens links in the browser when clicking on them.static voidopenInBrowser(String url) Opens the provided link in the browser and sends event statistics that this link was opened.static voidopenInBrowser(String url, JComponent component) static voidremoveHyperlinkListener(JEditorPane editorPane) Removes the hyperlink listener if you added it before usingaddHyperlinkListener(JEditorPane editorPane)
-
Constructor Details
-
HyperlinkHelper
public HyperlinkHelper()
-
-
Method Details
-
openInBrowser
Opens the provided link in the browser and sends event statistics that this link was opened. Where possible, prioritize the use of theopenInBrowser(String url, JComponent source)method to provide better context- Parameters:
url- to be open
-
openInBrowser
- Parameters:
component- the interaction with which triggered the opening of the link
-
addHyperlinkListener
AddsHyperlinkListenerthat 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- to which the listener will be added
-
removeHyperlinkListener
Removes the hyperlink listener if you added it before usingaddHyperlinkListener(JEditorPane editorPane)- Parameters:
editorPane- from which the listener will be removed
-