Class DarkFeatureEnabledCondition

java.lang.Object
com.atlassian.sal.api.features.DarkFeatureEnabledCondition
All Implemented Interfaces:
com.atlassian.plugin.web.api.baseconditions.BaseCondition, com.atlassian.plugin.web.Condition, com.atlassian.webresource.spi.condition.UrlReadingCondition

@ParametersAreNonnullByDefault public class DarkFeatureEnabledCondition extends Object implements com.atlassian.plugin.web.Condition, com.atlassian.webresource.spi.condition.UrlReadingCondition
A parameterised plugin module condition for enabling modules in the presence of a dark feature. Pass a param with parameter name "featureKey" containing the dark feature key. Example:
  <web-item key="some-key" section="some/section" weight="1">
      <label key="menu.title"/>
      <link>/some/path</link>
      <condition class="com.atlassian.sal.api.features.DarkFeatureEnabledCondition">
          <param name="featureKey">feature.key</param>
      </condition>
  </web-item>
 
The feature key is validated using the ValidFeatureKeyPredicate.
See Also:
  • Constructor Details

    • DarkFeatureEnabledCondition

      public DarkFeatureEnabledCondition(DarkFeatureManager darkFeatureManager)
  • Method Details

    • init

      public void init(Map<String,String> params)
      Specified by:
      init in interface com.atlassian.plugin.web.Condition
      Specified by:
      init in interface com.atlassian.webresource.spi.condition.UrlReadingCondition
    • addToUrl

      public void addToUrl(com.atlassian.webresource.api.url.UrlBuilder urlBuilder)
      For supporting web-resources
      Specified by:
      addToUrl in interface com.atlassian.webresource.spi.condition.UrlReadingCondition
    • shouldDisplay

      public boolean shouldDisplay(com.atlassian.webresource.api.QueryParams queryParams)
      For supporting web-resources
      Specified by:
      shouldDisplay in interface com.atlassian.webresource.spi.condition.UrlReadingCondition
    • shouldDisplay

      public boolean shouldDisplay(@Nullable Map<String,Object> stringObjectMap)
      For web fragments support
      Specified by:
      shouldDisplay in interface com.atlassian.plugin.web.Condition