Class StyleSheetList

java.lang.Object
io.sf.carte.doc.style.css.om.StyleSheetList
All Implemented Interfaces:
CSSStyleSheetList<AbstractCSSRule>, Serializable, StyleSheetList

public abstract class StyleSheetList extends Object implements CSSStyleSheetList<AbstractCSSRule>, Serializable
Abstract base implementation class for style sheet lists.
See Also:
  • Constructor Details

    • StyleSheetList

      protected StyleSheetList(int initialCapacity)
  • Method Details

    • getLength

      public int getLength()
      Specified by:
      getLength in interface StyleSheetList
    • item

      public AbstractCSSStyleSheet item(int index)
      Description copied from interface: CSSStyleSheetList
      retrieve a CSSStyleSheet by ordinal index.
      Specified by:
      item in interface CSSStyleSheetList<AbstractCSSRule>
      Specified by:
      item in interface StyleSheetList
      Parameters:
      index - the index in this list.
      Returns:
      the sheet at index, or null if index is less than zero, or greater or equal to the list length.
    • getStyleSheetSets

      public DOMStringList getStyleSheetSets()
    • acceptStyleRuleVisitor

      public void acceptStyleRuleVisitor(Visitor<CSSStyleRule> visitor)
      Description copied from interface: CSSStyleSheetList
      Accept a style rule visitor.

      This method scans all the sheets in this list for style rules and visits them.

      Specified by:
      acceptStyleRuleVisitor in interface CSSStyleSheetList<AbstractCSSRule>
      Parameters:
      visitor - the visitor.
    • acceptDeclarationRuleVisitor

      public void acceptDeclarationRuleVisitor(Visitor<CSSDeclarationRule> visitor)
      Description copied from interface: CSSStyleSheetList
      Accept a declaration rule visitor.

      This method scans all the sheets in this list for declaration rules and visits them.

      Specified by:
      acceptDeclarationRuleVisitor in interface CSSStyleSheetList<AbstractCSSRule>
      Parameters:
      visitor - the visitor.
    • acceptDescriptorRuleVisitor

      public void acceptDescriptorRuleVisitor(Visitor<CSSDeclarationRule> visitor)
      Description copied from interface: CSSStyleSheetList
      Accept a descriptor rule visitor.

      This method scans all the sheets in this list for declaration rules that declare descriptors, and visits them.

      Specified by:
      acceptDescriptorRuleVisitor in interface CSSStyleSheetList<AbstractCSSRule>
      Parameters:
      visitor - the visitor.
    • add

      public void add(AbstractCSSStyleSheet sheet)
      Add the sheet style sheet to this list.
      Parameters:
      sheet - the style sheet.
    • getPreferredStyleSheetSet

      public String getPreferredStyleSheetSet()
      Gets the preferred style sheet set as obtained from the sheets in the list.
      Returns:
      the preferred style sheet set, or the empty string if none is preferred.
    • remove

      public void remove(String title)
      Remove the sheet with the given title from this list.
      Parameters:
      title - the title of the sheet to remove.
    • remove

      public boolean remove(StyleSheet sheet)
      Remove the given sheet from this list.
      Parameters:
      sheet - the sheet to be removed.
      Returns:
      true if this list contained sheet.
    • iterator

      protected Iterator<AbstractCSSStyleSheet> iterator()
    • clear

      protected void clear()
    • needsUpdate

      protected boolean needsUpdate()
    • setNeedsUpdate

      protected void setNeedsUpdate(boolean needsUpdate)
    • update

      protected void update()
    • hasErrorsOrWarnings

      protected abstract boolean hasErrorsOrWarnings()