public class Style
extends org.zkoss.zk.ui.AbstractComponent
Note: a style component can appear anywhere in a ZUML page, but it affects all components in the same desktop.
There are two 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>
Note: if the src and content properties are both set, the later one overrides the previous one.
Constructor and Description |
---|
Style() |
Style(String src) |
Style(String src,
String media) |
Modifier and Type | Method and Description |
---|---|
String |
getContent()
Returns the content of the style element.
|
String |
getMedia()
Returns the media dependencies for this style sheet.
|
String |
getSrc()
Returns the URI of an external style sheet.
|
protected boolean |
isChildable()
Not childable.
|
boolean |
isDynamic()
Deprecated.
As of release 5.0.0, it is decided automatically.
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
setContent(String content)
Sets the content of the style element.
|
void |
setDynamic(boolean dynamic)
Deprecated.
As of release 5.0.0, it is decided automatically.
|
void |
setMedia(String media)
Sets the media dependencies for this style sheet.
|
void |
setSrc(String src)
Sets the URI of an external style sheet.
|
boolean |
setVisible(boolean visible)
Not allowed.
|
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, clone, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getExtraCtrl, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getPropertyAccess, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, invalidatePartial, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
public Style()
public Style(String src)
src
- the URI of an external style sheet.public void setDynamic(boolean dynamic)
public boolean isDynamic()
public String getSrc()
Default: null.
public void setSrc(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.
src
- the URI of an external style sheetsetContent(java.lang.String)
public String getMedia()
Default: null.
Refer to media-depedent style sheet for details.
public void setMedia(String media)
Refer to media-depedent style sheet for details.
media
- the media dependencies for this style sheetpublic String getContent()
Default: null.
Deriving class can override this method to return whatever it prefers (ignored if null).
public void setContent(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.
setSrc(java.lang.String)
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException
renderProperties
in class org.zkoss.zk.ui.AbstractComponent
IOException
public boolean setVisible(boolean visible)
setVisible
in interface org.zkoss.zk.ui.Component
setVisible
in class org.zkoss.zk.ui.AbstractComponent
protected boolean isChildable()
isChildable
in class org.zkoss.zk.ui.AbstractComponent
Copyright © 2020. All rights reserved.