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 Type
    Method
    Description
    boolean
    Tells whether the opening external links in new tabs/windows is enabled for the given user.
    boolean
    Tells whether a link with given URL should open in a new tab/window when clicked by the given user.
  • Method Details

    • isEnabled

      boolean isEnabled(@Nullable ApplicationUser user)
      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

      boolean shouldOpenInNewWindow(@Nullable ApplicationUser user, @Nullable String url)
      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 link
      url - address of the link
      Returns:
      true if the link should be opened in a separate tab/window