|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.click.element.Element org.apache.click.element.ResourceElement org.apache.click.element.CssImport
public class CssImport
Provides a Css HEAD element for importing external Cascading Stylesheet files using the <link> tag.
Example usage:public class MyPage extends Page { public List getHeadElements() { // We use lazy loading to ensure the CSS import is only added the // first time this method is called. if (headElements == null) { // Get the head elements from the super implementation headElements = super.getHeadElements(); CssImport cssImport = new CssImport("/css/style.css"); headElements.add(cssImport); } return headElements; } }The cssImport instance will be rendered as follows (assuming the context path is myApp):
<link type="text/css" rel="stylesheet" href="/myApp/css/style.css"/>
Field Summary |
---|
Fields inherited from class org.apache.click.element.ResourceElement |
---|
IF_IE, IF_IE7, IF_LESS_THAN_IE7, IF_LESS_THAN_IE9, IF_LESS_THAN_OR_EQUAL_TO_IE7 |
Constructor Summary | |
---|---|
CssImport()
Constructs a new Css import element. |
|
CssImport(String href)
Construct a new Css import element with the specified href attribute. |
|
CssImport(String href,
boolean useApplicationVersionIndicator)
Construct a new Css import element with the specified href attribute. |
|
CssImport(String href,
String versionIndicator)
Construct a new Css import element with the specified href attribute and version indicator. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
String |
getHref()
Return the href attribute. |
String |
getTag()
Returns the Css import HTML tag: <link>. |
int |
hashCode()
|
boolean |
isUnique()
This method always return true because Css import must be unique based on its href attribute. |
void |
render(HtmlStringBuffer buffer)
Render the HTML representation of the CssImport element to the specified buffer. |
void |
setHref(String href)
Sets the href attribute. |
Methods inherited from class org.apache.click.element.ResourceElement |
---|
getConditionalComment, getVersionIndicator, isRenderId, setConditionalComment, setRenderId, setVersionIndicator |
Methods inherited from class org.apache.click.element.Element |
---|
appendAttributes, getAttribute, getAttributes, getContext, getId, hasAttribute, hasAttributes, setAttribute, setId, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CssImport()
version indicator
will automatically be set to the
application version indicator
.
public CssImport(String href)
version indicator
will automatically be set to the
application version indicator
.
Please note if the given href begins with a
"/" character the href will be prefixed with the web
application context path.
href
- the Css import href attributepublic CssImport(String href, boolean useApplicationVersionIndicator)
version indicator
will automatically be set to the
application version indicator
.
Please note if the given href begins with a
"/" character the href will be prefixed with the web
application context path.
href
- the Css import href attributeuseApplicationVersionIndicator
- indicates whether the version
indicator will automatically be set to the application version indicatorpublic CssImport(String href, String versionIndicator)
href
- the Css import href attributeversionIndicator
- the version indicator to add to the href pathMethod Detail |
---|
public String getTag()
getTag
in class Element
public boolean isUnique()
isUnique
in class ResourceElement
ResourceElement.isUnique()
public void setHref(String href)
href
- the new href attributepublic String getHref()
public void render(HtmlStringBuffer buffer)
render
in class ResourceElement
buffer
- the buffer to render output topublic boolean equals(Object o)
equals
in class Object
o
- the object with which to compare this instance with
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |