|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.click.util.PageImports
Provides a utility object for rendering a Page's HTML header imports and its control HTML header imports.
A PageImports instance is automatically added to the Velocity Context for Velocity templates, or as a request attribute for JSP pages using the key name "imports".<html> <head> $imports </head> <body> $form <body> </html>"imports" include all javascript and stylesheet imports. PageImports also provides a way of including the javascript and stylesheet separately using the key names "cssImports" and "jsImports". You should follow the performance best practice by importing CSS includes in the head section, then include the JS imports after the html body. For example:
<html> <head> $cssImports </head> <body> $form <br/> $table <body> </html> $jsImportsPlease also see
Page.getHtmlImports()
and
Control.getHtmlImports()
.
Format
Field Summary | |
protected List |
cssImports
The list of CSS import lines. |
protected boolean |
initialized
The page imports initialized flag. |
protected List |
jsImports
The list of JS import lines. |
protected List |
jsScripts
The list of JS script block lines. |
protected Page |
page
The page instance. |
Constructor Summary | |
PageImports(Page page)
Create a page control HTML includes object. |
Method Summary | |
void |
addImport(String value)
Process the given control HTML import line. |
protected void |
addToList(String item,
List list)
Add the given string item to the list if it is not already present. |
protected String |
getAllIncludes()
Return a HTML string of all the page's HTML imports, including: CSS imports, JS imports and JS script blocks. |
protected String |
getCssImports()
Return a HTML string of all the page's HTML CSS imports. |
protected String |
getJsImports()
Return a HTML string of all the page's HTML JS imports and scripts. |
boolean |
isInitialized()
Return true if the page imports have been initialized. |
void |
popuplateRequest(HttpServletRequest request,
Map model)
Populate the specified request with html import keys. |
void |
popuplateTemplateModel(Map model)
Populate the specified model with html import keys. |
protected void |
processPageControls()
Process the Page's set of control HTML head imports. |
void |
setInitialized(boolean initialized)
Set whether the page imports have been initialized. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean initialized
protected List cssImports
protected List jsImports
protected List jsScripts
protected final Page page
Constructor Detail |
public PageImports(Page page)
page
- the page to provide HTML includes forMethod Detail |
public void addImport(String value)
value
- the HTML import line to processpublic boolean isInitialized()
public void setInitialized(boolean initialized)
initialized
- the page imports have been initialized flagpublic void popuplateTemplateModel(Map model)
model
- the model to populate with html import keyspublic void popuplateRequest(HttpServletRequest request, Map model)
request
- the http request to populatemodel
- the model to populate with html import keysprotected String getAllIncludes()
protected String getCssImports()
protected String getJsImports()
protected void processPageControls()
protected void addToList(String item, List list)
item
- the line item to addlist
- the list to add the item to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |