Class Style
java.lang.Object
ch.nolix.system.element.base.AbstractElement
ch.nolix.system.style.model.Style
- All Implemented Interfaces:
IElement, IBaseStyle<IStyle>, IStyle
- Author:
- Silvan Wyss
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyToElement(IStylableElement<?> element) Applies the currentIBaseStyleto the given element.final booleanstatic Stylestatic StylefromSpecification(INode<?> specification) final IContainer<String> IContainer<INode<?>> final IContainer<? extends ISelectingStyleWithSelectors> withAttachingAttributes(IContainer<String> attachingAttributes) final IStylewithAttachingAttributes(String... attachingAttributes) static StylewithAttachingAttributesAndSubStyles(IContainer<String> attachingAttributes, IContainer<? extends ISelectingStyleWithSelectors> subStyles) final IStylewithSubStyle(ISelectingStyleWithSelectors subStyle, ISelectingStyleWithSelectors... subStyles) withSubStyles(IContainer<? extends ISelectingStyleWithSelectors> subStyles) Methods inherited from class AbstractElement
equals, getSpecification, hashCode, toStringMethods inherited from interface IBaseStyle
containsAttachingAttributes, getAttachingAttributes, getSubStyles, withAttachingAttributes, withSubStyleMethods inherited from interface IElement
getSpecification, toFormatedString, toXml
-
Field Details
-
EMPTY
-
-
Method Details
-
fromFile
- Parameters:
filePath-- Returns:
- a new standard specification from the file with the given file path.
- Throws:
RuntimeException- if the given file path is not valid.RuntimeException- if the file with the given file path does not represent a standard configuration.
-
fromSpecification
- Parameters:
specification-- Returns:
- a new
Stylefrom the given specification. - Throws:
RuntimeException- if the given specification is not valid.
-
withAttachingAttributesAndSubStyles
public static Style withAttachingAttributesAndSubStyles(IContainer<String> attachingAttributes, IContainer<? extends ISelectingStyleWithSelectors> subStyles) - Parameters:
attachingAttributes-subStyles-- Returns:
- a new
Stylewith the given attachingAttributes and subStyles.
-
getAttributes
- Specified by:
getAttributesin interfaceIElement- Returns:
- the attributes of the current
IElement.
-
applyToElement
Applies the currentIBaseStyleto the given element.- Specified by:
applyToElementin interfaceIBaseStyle<IStyle>- Parameters:
element-
-
withAttachingAttributes
- Specified by:
withAttachingAttributesin interfaceIBaseStyle<IStyle>- Parameters:
attachingAttributes-- Returns:
- a new
IStylefrom the currentIStylewith the given attachingAttributes added.
-
withStyle
-
withSubStyles
- Specified by:
withSubStylesin interfaceIBaseStyle<IStyle>- Parameters:
subStyles-- Returns:
- a new
IStylefrom the currentIStylewith the given subStyles added.
-
getAttachingAttributes
- Specified by:
getAttachingAttributesin interfaceIBaseStyle<S extends IBaseStyle<S>>- Returns:
- the attaching attributes of the current
IBaseStyle.
-
getSubStyles
- Specified by:
getSubStylesin interfaceIBaseStyle<S extends IBaseStyle<S>>- Returns:
- the sub styles of the current
IBaseStyle.
-
containsAttachingAttributes
public final boolean containsAttachingAttributes()- Specified by:
containsAttachingAttributesin interfaceIBaseStyle<S extends IBaseStyle<S>>- Returns:
- true if the current
IBaseStylecontains attaching attributes, false otherwise.
-
withAttachingAttributes
- Specified by:
withAttachingAttributesin interfaceIBaseStyle<S extends IBaseStyle<S>>- Parameters:
attachingAttributes-- Returns:
- a new
IStylefrom the currentIStylewith the given attachingAttributes added.
-
withSubStyle
public final IStyle withSubStyle(ISelectingStyleWithSelectors subStyle, ISelectingStyleWithSelectors... subStyles) - Specified by:
withSubStylein interfaceIBaseStyle<S extends IBaseStyle<S>>- Parameters:
subStyle-subStyles-- Returns:
- a new
IStylefrom the currentIStylewith the given subStyle and subStyles added.
-