Interface IBaseStyle<S extends IBaseStyle<S>>

Type Parameters:
S - is the type of a IBaseStyle.
All Superinterfaces:
AttributesRepresentable, IElement, SpecificationRepresentable
All Known Subinterfaces:
ISelectingStyle<S>, ISelectingStyleWithSelectors, IStyle
All Known Implementing Classes:
AbstractSelectingStyle, DeepSelectingStyle, SelectingStyle, Style

public interface IBaseStyle<S extends IBaseStyle<S>> extends IElement
A IBaseStyle can style IStylableElements. A IBaseStyle can distinguish if it would style also the child elements of a given IStylableElement.
Author:
Silvan Wyss
  • Method Details

    • applyToElement

      void applyToElement(IStylableElement<?> element)
      Applies the current IBaseStyle to the given element.
      Parameters:
      element -
    • getAttachingAttributes

      IContainer<String> getAttachingAttributes()
      Returns:
      the attaching attributes of the current IBaseStyle.
    • getSubStyles

      IContainer<? extends ISelectingStyleWithSelectors> getSubStyles()
      Returns:
      the sub styles of the current IBaseStyle.
    • containsAttachingAttributes

      boolean containsAttachingAttributes()
      Returns:
      true if the current IBaseStyle contains attaching attributes, false otherwise.
    • withAdditionalSubStyle

      S withAdditionalSubStyle(ISelectingStyleWithSelectors additionalSubStyle)
      Parameters:
      additionalSubStyle -
      Returns:
      a new IStyle from the current IStyle with the given additionalSubStyle.
      Throws:
      RuntimeException - if the given additionalSubStyle is not valid.
      RuntimeException - if one of the given additionalSubStyles is null.
    • withAdditionalSubStyles

      S withAdditionalSubStyles(ISelectingStyleWithSelectors... additionalSubStyles)
      Parameters:
      additionalSubStyles -
      Returns:
      a new IStyle from the current IStyle with the given additionalSubStyles.
      Throws:
      RuntimeException - if the given additionalSubStyles is null.
      RuntimeException - if one of the given additionalSubStyles is null.
    • withAttachingAttributes

      S withAttachingAttributes(IContainer<String> attachingAttributes)
      Parameters:
      attachingAttributes -
      Returns:
      a new IStyle from the current IStyle with the given attachingAttributes added.
      Throws:
      RuntimeException - if the given attachingAttributes is null.
      RuntimeException - if one of the given attachingAttributes is not valid.
    • withAttachingAttributes

      S withAttachingAttributes(String... attachingAttributes)
      Parameters:
      attachingAttributes -
      Returns:
      a new IStyle from the current IStyle with the given attachingAttributes added.
      Throws:
      RuntimeException - if the given attachingAttributes is null.
      RuntimeException - if one of the given attachingAttributes is not valid.
    • withSubStyles

      S withSubStyles(IContainer<? extends ISelectingStyleWithSelectors> subStyles)
      Parameters:
      subStyles -
      Returns:
      a new IStyle from the current IStyle with the given subStyles added.
      Throws:
      RuntimeException - if the given subStyles is null.
      RuntimeException - if one of the given subStyles is not valid.