|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zul.Style
public class Style
The style component used to specify CSS styles for the owner desktop.
Note: a style component can appear anywhere in a ZUML page, but it affects all components in the same desktop.
Note: If isDynamic() is false, the HTML STYLE
or LINK tag is generated to represent this component.
Due to IE's limitation, there is no effect if
the style component is added or removed dynamically
and if isDynamic() is false.
If isDynamic() is true, this component can be added and removed
dynamically and the rules will be attached and detached accordingly.
Note: in this case, the link is generated when this component
is initialized at the client, so the style will be loaded to
the client after all components are initialized.
There are three formats when used in a ZUML page:
Method 1: Specify the URL of the CSS file
<style src="my.css"/>
Method 2: Specify the CSS directly
<style>
.mycls {
border: 1px outset #777;
}
</style>
Method 3: Specify the CSS by use of the content
property (setContent(java.lang.String)).
<style>
<attribute name="content">
.mycls {
border: 1px outset #777;
}
</attribute>
</style>
Note: if the src and content properties are both set, the content property is ignored.
| Nested Class Summary | |
|---|---|
protected class |
Style.ExtraCtrl
A utility class to implement AbstractComponent.getExtraCtrl(). |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
AbstractComponent.Children |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
_visible |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
Style()
|
|
Style(java.lang.String src)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getContent()
Returns the content of the style element. |
java.lang.String |
getOuterAttrs()
Returns the attributes for generating the HTML tags. |
java.lang.String |
getSrc()
Returns the URI of an external style sheet. |
boolean |
isChildable()
Not childable. |
boolean |
isDynamic()
Returns whether to load an external Style Sheet dynamically. |
protected java.lang.Object |
newExtraCtrl()
Used by AbstractComponent.getExtraCtrl() to create extra controls. |
void |
redraw(java.io.Writer out)
Redraws this component. |
void |
setContent(java.lang.String content)
Sets the content of the style element. |
void |
setDynamic(boolean dynamic)
Sets whether to load an external Style Sheet dynamically. |
void |
setSrc(java.lang.String src)
Sets the URI of an external style sheet. |
boolean |
setVisible(boolean visible)
Not allowd. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Style()
public Style(java.lang.String src)
src - the URI of an external style sheet.| Method Detail |
|---|
public void setDynamic(boolean dynamic)
Default: false.
setDynamic in interface StyleisDynamic()public boolean isDynamic()
Due to IE's limitation, there is no effect if
the style component is added or removed dynamically
and if isDynamic() is false.
If isDynamic() is true, this component can be added and removed
dynamically and the rules will be attached and detached accordingly.
Note: in this case, the HTML LINK tag is generated when this component
is initialized at the client, so the style will be loaded to
the client after all components are initialized.
Default: false.
isDynamic in interface Stylepublic java.lang.String getSrc()
Default: null.
getSrc in interface Stylepublic void setSrc(java.lang.String src)
Calling this method implies setContent(null).
In other words, the last invocation of setSrc(java.lang.String) overrides
the previous setContent(java.lang.String), if any.
setSrc in interface Stylesrc - the URI of an external style sheetsetContent(java.lang.String)public java.lang.String getContent()
Default: null.
getContent in interface Stylepublic void setContent(java.lang.String content)
Calling this method implies setSrc(null).
In other words, the last invocation of setContent(java.lang.String) overrides
the previous setSrc(java.lang.String), if any.
setContent in interface StylesetSrc(java.lang.String)public java.lang.String getOuterAttrs()
public boolean setVisible(boolean visible)
setVisible in interface ComponentsetVisible in class AbstractComponentpublic boolean isChildable()
isChildable in interface ComponentisChildable in class AbstractComponentprotected java.lang.Object newExtraCtrl()
AbstractComponentAbstractComponent.getExtraCtrl() to create extra controls.
It is used only by component developers.
Default: return null.
To provide extra controls, it is simpler to override this method
instead of AbstractComponent.getExtraCtrl().
By use of AbstractComponent.newExtraCtrl(), you don't need to care of
cloning and serialization.
newExtraCtrl in class AbstractComponent
public void redraw(java.io.Writer out)
throws java.io.IOException
AbstractComponentAbstractComponent.getMoldURI() to retrieve the mold
to redraw. The mold is either an URI (String) or a
ComponentRenderer instance.
Execution.include(java.io.Writer, java.lang.String, java.util.Map, int) to generate
the output.ComponentRenderer instance, ComponentRenderer.render(org.zkoss.zk.ui.Component, java.io.Writer)
is called to generate the output.
redraw in interface Componentredraw in class AbstractComponentjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||