Package com.atlassian.jira.user
Interface ExternalLinkInNewWindow
- All Known Implementing Classes:
ExternalLinkInNewWindowImpl
@ExperimentalApi
public interface ExternalLinkInNewWindow
Controls what the behavior should be when a user clicks on an external link. It could be opened in the same tab/window,
replacing the current page, or in a new tab/window. The API consumer has to decide what to with such information,
e. g. add
target="_blank"
attribute to the corresponding <a>
tag.- Since:
- 8.8
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isEnabled
(ApplicationUser user) Tells whether the opening external links in new tabs/windows is enabled for the given user.boolean
shouldOpenInNewWindow
(ApplicationUser user, String url) Tells whether a link with given URL should open in a new tab/window when clicked by the given user.
-
Method Details
-
isEnabled
Tells whether the opening external links in new tabs/windows is enabled for the given user. When the feature is disabled globally, returns false for all users- Parameters:
user
- user to check the setting for- Returns:
- true if the setting is enabled
-
shouldOpenInNewWindow
Tells whether a link with given URL should open in a new tab/window when clicked by the given user. Takes user preference into consideration.- Parameters:
user
- user visiting the linkurl
- address of the link- Returns:
- true if the link should be opened in a separate tab/window
-