Class PhotonCSS

java.lang.Object
com.helger.photon.app.html.PhotonCSS

@ThreadSafe public final class PhotonCSS extends Object
This class keeps track of all the CSS files that must be included globally or for a single request.
Author:
Philip Helger
  • Field Details

  • Method Details

    • _readCSSIncludes

      public static void _readCSSIncludes(@Nonnull com.helger.commons.io.resource.IReadableResource aRes, @Nonnull CSSResourceSet aTarget)
    • readCSSIncludesForGlobal

      public static void readCSSIncludesForGlobal(@Nonnull com.helger.commons.io.resource.IReadableResource aRes)
    • registerCSSIncludeForGlobal

      public static void registerCSSIncludeForGlobal(@Nonnull com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
      Register a new CSS item for global scope.
      Parameters:
      aCSSPathProvider - The CSS path provider to use. May not be null.
    • registerCSSIncludeForGlobal

      public static void registerCSSIncludeForGlobal(int nIndex, @Nonnull com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
      Register a new CSS item for global scope.
      Parameters:
      nIndex - The index to be used. If the value is < 0 the value is ignored and item is appended.
      aCSSPathProvider - The CSS path provider to use. May not be null.
    • unregisterCSSIncludeForGlobal

      public static void unregisterCSSIncludeForGlobal(@Nonnull com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
      Unregister an existing CSS item for global scope.
      Parameters:
      aCSSPathProvider - The CSS path provider to use. May not be null.
    • unregisterAllCSSIncludesFromGlobal

      public static void unregisterAllCSSIncludesFromGlobal()
      Unregister all existing CSS items from global scope.
    • getAllRegisteredCSSIncludesForGlobal

      @Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsOrderedSet<com.helger.html.resource.css.ICSSPathProvider> getAllRegisteredCSSIncludesForGlobal()
      Returns:
      A non-null set with all CSS paths to be included globally.
    • getAllRegisteredCSSIncludesForGlobal

      public static void getAllRegisteredCSSIncludesForGlobal(@Nonnull Collection<? super com.helger.html.resource.css.ICSSPathProvider> aTarget)
    • hasRegisteredCSSIncludesForGlobal

      public static boolean hasRegisteredCSSIncludesForGlobal()
      Returns:
      true if at least a single CSS path has been registered globally.
    • registerCSSIncludeForThisRequest

      public static void registerCSSIncludeForThisRequest(@Nonnull com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
      Register a new CSS item only for this request
      Parameters:
      aCSSPathProvider - The CSS path provider to use. May not be null.
    • unregisterCSSIncludeFromThisRequest

      public static void unregisterCSSIncludeFromThisRequest(@Nonnull com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
      Unregister an existing CSS item only from this request
      Parameters:
      aCSSPathProvider - The CSS path provider to use. May not be null.
    • unregisterAllCSSIncludesFromThisRequest

      public static void unregisterAllCSSIncludesFromThisRequest()
      Unregister all existing CSS items from this request
    • getAllRegisteredCSSIncludesForThisRequest

      @Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsOrderedSet<com.helger.html.resource.css.ICSSPathProvider> getAllRegisteredCSSIncludesForThisRequest()
      Returns:
      A non-null set with all CSS paths to be included in this request.
    • getAllRegisteredCSSIncludesForThisRequest

      public static void getAllRegisteredCSSIncludesForThisRequest(@Nonnull Collection<? super com.helger.html.resource.css.ICSSPathProvider> aTarget)
    • hasRegisteredCSSIncludesForThisRequest

      public static boolean hasRegisteredCSSIncludesForThisRequest()
      Returns:
      true if at least a single CSS path has been registered for this request only