You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.copilot.plugins.themeeditor.

Class ThemeModifier

java.lang.Object
com.vaadin.copilot.plugins.themeeditor.ThemeModifier
public class ThemeModifier extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • setThemeProperties

      public void setThemeProperties(List<CssRule> rules)

      Performs update of CSS file setting (adding or updating) given CssRule.

      Parameters:

      rules - list of CssRule to be added or updated

    • setFont

      public void setFont(String fontName)

      Adds an import rule for the specified font to the theme editor CSS file and updates the Lumo font family theme property. Removes all previous import rules.

      Parameters:

      fontName - the font to use

    • getCss

      public String getCss()

      Returns the content of the theme editor CSS file.

      Returns:

      CSS string

    • getCssRules

      public List<CssRule> getCssRules(List<String> selectors)

      Retrieves list of CssRule for given selectors.

      Parameters:

      selectors - list of selectors

      Returns:

      list of CssRule

    • replaceClassName

      public void replaceClassName(String tagName, String oldClassName, String newClassName)

      Replaces classname with new classname in all matching rules.

      Parameters:

      oldClassName - classname to be replaced

      newClassName - new classname

    • getRuleLocationLine

      public int getRuleLocationLine(String selectorString)

      Gets location line of rule with given selector

      Parameters:

      selectorString -

      Returns:

      line number when located, -1 otherwise

    • createEmptyStyleRule

      public void createEmptyStyleRule(String selector)

      Creates empty rule with given selector

      Parameters:

      selector - Selector to add rule to stylesheet. Null means create the file if not exists

    • getExistingClassNames

      public List<String> getExistingClassNames()

      Returns selectors in the theme editors

      Returns:

      list of class names

    • noStyleSheet

      protected boolean noStyleSheet()
    • getCssFileName

      protected String getCssFileName()
    • getHeaderText

      protected String getHeaderText()
    • getThemeFolder

      protected File getThemeFolder()
    • getStyleSheetFile

      public File getStyleSheetFile()
    • getCascadingStyleSheet

      protected com.helger.css.decl.CascadingStyleSheet getCascadingStyleSheet()
    • setCssProperty

      protected void setCssProperty(com.helger.css.decl.CascadingStyleSheet styleSheet, String selector, String property, String value)
    • removeCssProperty

      protected void removeCssProperty(com.helger.css.decl.CascadingStyleSheet styleSheet, String selector, String property)
    • writeStyleSheet

      protected void writeStyleSheet(com.helger.css.decl.CascadingStyleSheet styleSheet)
    • sortStyleSheet

      protected void sortStyleSheet(com.helger.css.decl.CascadingStyleSheet styleSheet)
    • createStyleRule

      protected com.helger.css.decl.CSSStyleRule createStyleRule(String selector, String property, String value)
    • removeProperty

      protected void removeProperty(com.helger.css.decl.CSSStyleRule existingRule, com.helger.css.decl.CSSStyleRule newRule)
    • findRuleBySelector

      protected com.helger.css.decl.CSSStyleRule findRuleBySelector(com.helger.css.decl.CascadingStyleSheet styleSheet, com.helger.css.decl.CSSStyleRule rule)
    • findRuleBySelector

      protected com.helger.css.decl.CSSStyleRule findRuleBySelector(com.helger.css.decl.CascadingStyleSheet styleSheet, com.helger.css.decl.CSSSelector selector)
    • replaceClassName

      protected void replaceClassName(com.helger.css.decl.CascadingStyleSheet styleSheet, String tagName, String oldClassName, String newClassName)
    • insertImportIfNotExists

      protected void insertImportIfNotExists()
    • toCssRule

      protected CssRule toCssRule(com.helger.css.decl.CSSStyleRule rule)
    • parseSelector

      protected com.helger.css.decl.CSSSelector parseSelector(String selector)