com.vaadin.base.devserver.themeeditor.
Class ThemeModifier
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
createEmptyStyleRule
(String selector) Creates empty rule with given selector
protected com.helger.css.decl.CSSStyleRule
createStyleRule
(String selector, String property, String value) protected com.helger.css.decl.CSSStyleRule
findRuleBySelector
(com.helger.css.decl.CascadingStyleSheet styleSheet, com.helger.css.decl.CSSSelector selector) protected com.helger.css.decl.CSSStyleRule
findRuleBySelector
(com.helger.css.decl.CascadingStyleSheet styleSheet, com.helger.css.decl.CSSStyleRule rule) protected com.helger.css.decl.CascadingStyleSheet
getCss()
Returns the content of the theme editor CSS file.
protected String
getCssRules
(List<String> selectors) Retrieves list of
CssRule
for given selectors.protected File
protected String
int
getRuleLocationLine
(String selectorString) Gets location line of rule with given selector
getState()
protected File
protected String
getThemeName
(File themes) protected ThemeModifier.State
init()
protected void
boolean
protected com.helger.css.decl.CSSSelector
parseSelector
(String selector) protected void
removeCssProperty
(com.helger.css.decl.CascadingStyleSheet styleSheet, String selector, String property) protected void
removeProperty
(com.helger.css.decl.CSSStyleRule existingRule, com.helger.css.decl.CSSStyleRule newRule) protected void
replaceClassName
(com.helger.css.decl.CascadingStyleSheet styleSheet, String tagName, String oldClassName, String newClassName) void
replaceClassName
(String tagName, String oldClassName, String newClassName) Replaces classname with new classname in all matching rules.
protected void
setCssProperty
(com.helger.css.decl.CascadingStyleSheet styleSheet, String selector, String property, String value) void
setThemeProperties
(List<CssRule> rules) Performs update of CSS file setting (adding or updating) given
CssRule
.protected void
sortStylesheet
(com.helger.css.decl.CascadingStyleSheet styleSheet) protected CssRule
toCssRule
(com.helger.css.decl.CSSStyleRule rule) protected void
writeStylesheet
(com.helger.css.decl.CascadingStyleSheet styleSheet)
-
Constructor Details
-
ThemeModifier
-
-
Method Details
-
isEnabled
public boolean isEnabled() -
getState
-
setThemeProperties
Performs update of CSS file setting (adding or updating) given
CssRule
.Parameters:
rules
- list ofCssRule
to be added or updated -
getCss
Returns the content of the theme editor CSS file.
Returns:
CSS string
-
getCssRules
Retrieves list of
CssRule
for given selectors.Parameters:
selectors
- list of selectorsReturns:
list of
CssRule
-
replaceClassName
Replaces classname with new classname in all matching rules.
Parameters:
oldClassName
- classname to be replacednewClassName
- new classname -
getRuleLocationLine
Gets location line of rule with given selector
Parameters:
selectorString
-Returns:
line number when located, -1 otherwise
-
createEmptyStyleRule
Creates empty rule with given selector
Parameters:
selector
- -
getCssFileName
-
getHeaderText
-
init
-
getFrontendFolder
-
getThemeFile
-
getStyleSheetFile
-
getCascadingStyleSheet
protected com.helger.css.decl.CascadingStyleSheet getCascadingStyleSheet() -
setCssProperty
-
removeCssProperty
-
writeStylesheet
protected void writeStylesheet(com.helger.css.decl.CascadingStyleSheet styleSheet) -
sortStylesheet
protected void sortStylesheet(com.helger.css.decl.CascadingStyleSheet styleSheet) -
createStyleRule
-
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
-
insertImportIfNotExists
protected void insertImportIfNotExists() -
getThemeName
-
toCssRule
-
parseSelector
-