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

Class ThemeModifier

java.lang.Object
com.vaadin.base.devserver.themeeditor.ThemeModifier
public class ThemeModifier extends Object
  • Constructor Details

  • Method Details

    • isEnabled

      public boolean isEnabled()
    • getState

      public ThemeModifier.State getState()
    • 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

    • 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 -

    • getCssFileName

      protected String getCssFileName()
    • getHeaderText

      protected String getHeaderText()
    • init

      protected ThemeModifier.State init()
    • getFrontendFolder

      protected File getFrontendFolder()
    • getThemeFile

      protected File getThemeFile()
    • 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()
    • getThemeName

      protected String getThemeName(File themes)
    • toCssRule

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

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