Package com.helger.html.hc.html.metadata
Class HCStyle
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<HCStyle>
-
- com.helger.html.hc.html.metadata.HCStyle
-
- All Implemented Interfaces:
com.helger.commons.hierarchy.IHasChildren<IHCNode>,com.helger.commons.hierarchy.IHasChildrenRecursive<IHCNode>,com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>,com.helger.commons.traits.IGenericImplTrait<HCStyle>,IHCElement<HCStyle>,IHCHasCSSClasses<HCStyle>,IHCHasCSSStyles<HCStyle>,IHCHasID<HCStyle>,IHCNode,Serializable
@OutOfBandNode public class HCStyle extends AbstractHCElement<HCStyle>
Represents an HTML <style> element- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_EMIT_AFTER_FILESBy default place inline CSS after script filesstatic com.helger.commons.mime.IMimeTypeDEFAULT_TYPEThe default MIME type is text/css-
Fields inherited from class com.helger.html.hc.html.AbstractHCElement
DEFAULT_HIDDEN, DEFAULT_SPELLCHECK, DEFAULT_TRANSLATE, DEFAULT_UNFOCUSABLE
-
Fields inherited from interface com.helger.html.hc.html.IHCElement
DEFAULT_TABINDEX
-
-
Constructor Summary
Constructors Constructor Description HCStyle()HCStyle(com.helger.css.decl.CascadingStyleSheet aCSS, com.helger.css.writer.CSSWriterSettings aSettings)HCStyle(com.helger.css.decl.CSSDeclarationList aCSS, com.helger.css.writer.CSSWriterSettings aSettings)HCStyle(String sContent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HCStyleaddMedium(com.helger.css.media.ECSSMedium eMedium)booleancanConvertToMicroNode(IHCConversionSettingsToNode aConversionSettings)This method checks whether the node is suitable for conversion to anIMicroNode.booleancontainsMedium(com.helger.css.media.ECSSMedium eMedium)Check if the passed medium is explicitly specifiedprotected voidfillMicroElement(com.helger.xml.microdom.IMicroElement aElement, IHCConversionSettingsToNode aConversionSettings)Set all attributes and child elements of this objectcom.helger.css.media.ICSSMediaListgetMedia()intgetMediaCount()EHCStyleInlineModegetMode()StringgetStyleContent()com.helger.commons.mime.IMimeTypegetType()booleanhasAnyMedia()booleanhasNoMedia()booleanhasNoMediaOrAll()booleanisEmitAfterFiles()HCStyleremoveAllMedia()HCStylesetEmitAfterFiles(boolean bEmitAfterFiles)static voidsetInlineStyle(com.helger.xml.microdom.IMicroNodeWithChildren aElement, String sContent, EHCStyleInlineMode eMode)HCStylesetMedia(com.helger.css.media.ICSSMediaList aMediaList)HCStylesetMode(EHCStyleInlineMode eMode)HCStylesetStyleContent(com.helger.css.decl.CascadingStyleSheet aCSS, com.helger.css.writer.CSSWriterSettings aSettings)HCStylesetStyleContent(com.helger.css.decl.CSSDeclarationList aCSS, com.helger.css.writer.CSSWriterSettings aSettings)HCStylesetStyleContent(String sContent)HCStylesetType(com.helger.commons.mime.IMimeType aType)StringtoString()-
Methods inherited from class com.helger.html.hc.html.AbstractHCElement
addClass, addEventHandler, addStyle, containsClass, containsEventHandler, containsStyle, createMicroElement, customAttrs, finishMicroElement, getAccessKey, getAllClasses, getAllClassesAsString, getAllClassNames, getAllStyles, getAllStylesAsString, getAllStyleValues, getContentEditable, getDirection, getDraggable, getElement, getEventHandler, getEventMap, getID, getLanguage, getRole, getStyleValue, getTabIndex, getTagName, getTitle, getTranslate, hasAnyClass, hasAnyStyle, hasStyle, internalConvertToMicroNode, isHidden, isSpellCheck, isTranslateOff, isTranslateOn, isTranslateUndefined, isUnfocusable, isValidID, onConsistencyCheck, onFinalizeNodeState, prependEventHandler, removeAllClasses, removeAllEventHandler, removeAllStyles, removeClass, removeStyle, setAccessKey, setContentEditable, setDirection, setDraggable, setEventHandler, setHidden, setID, setID, setLanguage, setRole, setSpellCheck, setTabIndex, setTitle, setTranslate, setUnfocusable
-
Methods inherited from class com.helger.html.hc.impl.AbstractHCNode
consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, findFirstChild, findFirstChildMapped, forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getChildAtIndex, getChildCount, getChildren, getFirstChild, getLastChild, getNodeState, getPlainText, hasChildren, internalSetNodeState, onCustomizeNode, onRegisterExternalResources, registerExternalResources
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildren
forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getChildCount, getChildren, hasChildren, hasNoChildren
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenRecursive
forAllChildrenRecursive, forAllChildrenRecursive
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenSorted
findFirstChild, findFirstChildMapped, getAllChildren, getChildAtIndex, getFirstChild, getLastChild
-
Methods inherited from interface com.helger.html.hc.html.IHCElement
setTranslate, withCustomAttrs
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSClasses
addClasses, addClasses, addClasses
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSStyles
addStyle, addStyles, addStyles, addStyles
-
Methods inherited from interface com.helger.html.hc.IHCHasID
ensureID, hasID, hasNoID, setUniqueID
-
Methods inherited from interface com.helger.html.hc.IHCNode
consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, getPlainText, registerExternalResources
-
-
-
-
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
-
-
Method Detail
-
getType
@Nonnull public final com.helger.commons.mime.IMimeType getType()
-
getMedia
@Nullable public final com.helger.css.media.ICSSMediaList getMedia()
-
setMedia
@Nonnull public final HCStyle setMedia(@Nullable com.helger.css.media.ICSSMediaList aMediaList)
-
addMedium
@Nonnull public final HCStyle addMedium(@Nonnull com.helger.css.media.ECSSMedium eMedium)
-
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 benull.- Returns:
trueif it is contained,falseotherwise
-
getMediaCount
@Nonnegative public final int getMediaCount()
-
hasAnyMedia
public final boolean hasAnyMedia()
-
hasNoMedia
public final boolean hasNoMedia()
-
hasNoMediaOrAll
public final boolean hasNoMediaOrAll()
- Returns:
trueif no explicit media is defined or ifECSSMedium.ALLis 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.
-
getMode
@Nonnull public final EHCStyleInlineMode getMode()
-
setMode
@Nonnull public final HCStyle setMode(@Nonnull EHCStyleInlineMode eMode)
-
isEmitAfterFiles
public final boolean isEmitAfterFiles()
-
canConvertToMicroNode
public boolean canConvertToMicroNode(@Nonnull IHCConversionSettingsToNode aConversionSettings)
Description copied from interface:IHCNodeThis method checks whether the node is suitable for conversion to anIMicroNode. If this node cannot be converted, no child node will be converted as well!- Specified by:
canConvertToMicroNodein interfaceIHCNode- Overrides:
canConvertToMicroNodein classAbstractHCNode- Parameters:
aConversionSettings- The conversion settings to be used- Returns:
trueif the node can be converted to a node,falseotherwise.
-
setInlineStyle
public static void setInlineStyle(@Nonnull com.helger.xml.microdom.IMicroNodeWithChildren aElement, @Nullable String sContent, @Nonnull EHCStyleInlineMode eMode)
-
fillMicroElement
protected void fillMicroElement(com.helger.xml.microdom.IMicroElement aElement, IHCConversionSettingsToNode aConversionSettings)Description copied from class:AbstractHCElementSet all attributes and child elements of this object- Overrides:
fillMicroElementin classAbstractHCElement<HCStyle>- Parameters:
aElement- The current micro element to be filled. Nevernull.aConversionSettings- The conversion settings to be used. Nevernull.
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCElement<HCStyle>
-
-