Class HCStyle

    • Field Detail

      • DEFAULT_TYPE

        public static final com.helger.commons.mime.IMimeType DEFAULT_TYPE
        The default MIME type is text/css
      • DEFAULT_EMIT_AFTER_FILES

        public static final boolean DEFAULT_EMIT_AFTER_FILES
        By default place inline CSS after script files
        See Also:
        Constant Field Values
    • Constructor Detail

      • HCStyle

        public HCStyle()
      • HCStyle

        public HCStyle​(@Nonnull
                       com.helger.css.decl.CascadingStyleSheet aCSS,
                       @Nonnull
                       com.helger.css.writer.CSSWriterSettings aSettings)
      • HCStyle

        public HCStyle​(@Nonnull
                       com.helger.css.decl.CSSDeclarationList aCSS,
                       @Nonnull
                       com.helger.css.writer.CSSWriterSettings aSettings)
    • Method Detail

      • getType

        @Nonnull
        public final com.helger.commons.mime.IMimeType getType()
      • getMedia

        @Nullable
        public final com.helger.css.media.ICSSMediaList getMedia()
      • containsMedium

        public final boolean containsMedium​(@Nullable
                                            com.helger.css.media.ECSSMedium eMedium)
        Check if the passed medium is explicitly specified
        Parameters:
        eMedium - The medium to be checked. May be null.
        Returns:
        true if it is contained, false otherwise
      • getMediaCount

        @Nonnegative
        public final int getMediaCount()
      • hasAnyMedia

        public final boolean hasAnyMedia()
      • hasNoMedia

        public final boolean hasNoMedia()
      • hasNoMediaOrAll

        public final boolean hasNoMediaOrAll()
        Returns:
        true if no explicit media is defined or if ECSSMedium.ALL is contained.
      • setStyleContent

        @Nonnull
        public final HCStyle setStyleContent​(@Nonnull
                                             com.helger.css.decl.CascadingStyleSheet aCSS,
                                             @Nonnull
                                             com.helger.css.writer.CSSWriterSettings aSettings)
      • setStyleContent

        @Nonnull
        public final HCStyle setStyleContent​(@Nonnull
                                             com.helger.css.decl.CSSDeclarationList aCSS,
                                             @Nonnull
                                             com.helger.css.writer.CSSWriterSettings aSettings)
      • getStyleContent

        @Nullable
        public final String getStyleContent()
        Returns:
        The CSS content. May be null.
      • isEmitAfterFiles

        public final boolean isEmitAfterFiles()
      • setEmitAfterFiles

        @Nonnull
        public final HCStyle setEmitAfterFiles​(boolean bEmitAfterFiles)
      • canConvertToMicroNode

        public boolean canConvertToMicroNode​(@Nonnull
                                             IHCConversionSettingsToNode aConversionSettings)
        Description copied from interface: IHCNode
        This method checks whether the node is suitable for conversion to an IMicroNode. If this node cannot be converted, no child node will be converted as well!
        Specified by:
        canConvertToMicroNode in interface IHCNode
        Overrides:
        canConvertToMicroNode in class AbstractHCNode
        Parameters:
        aConversionSettings - The conversion settings to be used
        Returns:
        true if the node can be converted to a node, false otherwise.
      • fillMicroElement

        protected void fillMicroElement​(com.helger.xml.microdom.IMicroElement aElement,
                                        IHCConversionSettingsToNode aConversionSettings)
        Description copied from class: AbstractHCElement
        Set all attributes and child elements of this object
        Overrides:
        fillMicroElement in class AbstractHCElement<HCStyle>
        Parameters:
        aElement - The current micro element to be filled. Never null.
        aConversionSettings - The conversion settings to be used. Never null.