public class DojoI18nDependencyRule extends DojoDependencyRule
In order to prevent CSS resources being unnecessarily imported we can specify CSS files relevant to a widget in its JavaScript file.
This DojoDependencyRule allows us to check for requested CSS dependencies so that we can dynamically include them when we build
the page. The definition should be written as follows:
cssRequirements: [{cssFile:"./css/LeftAndRight.css",mediaType:"screen"}],
TODO: We could aim to support different aggregation groups as well.
| Constructor and Description |
|---|
DojoI18nDependencyRule() |
| Modifier and Type | Method and Description |
|---|---|
WebFrameworkConfigElement |
getWebFrameworkConfigElement() |
String |
getWidgetNamePatternString() |
int |
getWidgetNameTargetGroup() |
protected void |
processDependency(String dependency,
String sourcePath,
String sourceContents,
Matcher matcher,
DojoDependencies dependencies)
Overrides the default implementation to retrieve both the CSS dependency path and the
media type that the CSS path should be used against.
|
void |
setWebFrameworkConfigElement(WebFrameworkConfigElement webFrameworkConfigElement) |
void |
setWidgetNamePatternString(String widgetNamePatternString) |
void |
setWidgetNameTargetGroup(int widgetNameTargetGroup) |
addJavaScriptDependency, addNonAmdJavaScriptDependency, getDeclarationRegex, getDeclarationRegexPattern, getDependencyHandler, getDependencyRegex, getDependencyRegexPattern, getDojoDependencyHandler, getTargetGroup, getTokens, processRegexRules, replaceTokens, setDeclarationRegex, setDependencyHandler, setDependencyRegex, setDojoDependencyHandler, setTargetGroupprotected void processDependency(String dependency, String sourcePath, String sourceContents, Matcher matcher, DojoDependencies dependencies)
Overrides the default implementation to retrieve both the CSS dependency path and the media type that the CSS path should be used against.
processDependency in class DojoDependencyRuledependency - The dependency as specified in the file being processedsourcePath - The source where the file was being processedsourceContents - TODOdependencies - The current DojoDependencies object for source file being processedpublic String getWidgetNamePatternString()
public void setWidgetNamePatternString(String widgetNamePatternString)
public int getWidgetNameTargetGroup()
public void setWidgetNameTargetGroup(int widgetNameTargetGroup)
public WebFrameworkConfigElement getWebFrameworkConfigElement()
public void setWebFrameworkConfigElement(WebFrameworkConfigElement webFrameworkConfigElement)
Copyright © 2005–2016 Alfresco Software. All rights reserved.