Class Style
- java.lang.Object
-
- org.zkoss.zk.ui.AbstractComponent
-
- org.zkoss.zul.Style
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl
public class Style extends org.zkoss.zk.ui.AbstractComponentThe 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.
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.
- Author:
- tomyeh
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContent()Returns the content of the style element.java.lang.StringgetMedia()Returns the media dependencies for this style sheet.java.lang.StringgetSrc()Returns the URI of an external style sheet.protected booleanisChildable()Not childable.protected voidrenderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)voidsetContent(java.lang.String content)Sets the content of the style element.voidsetMedia(java.lang.String media)Sets the media dependencies for this style sheet.voidsetSrc(java.lang.String src)Sets the URI of an external style sheet.booleansetVisible(boolean visible)Not allowed.-
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, clone, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, 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, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getPropertyAccess, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, 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, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
-
-
-
Constructor Detail
-
Style
public Style()
-
Style
public Style(java.lang.String src)
- Parameters:
src- the URI of an external style sheet.
-
Style
public Style(java.lang.String src, java.lang.String media)- Parameters:
src- the URI of an external style sheet.media- the media dependencies for the style sheet.- Since:
- 5.0.3
-
-
Method Detail
-
getSrc
public java.lang.String getSrc()
Returns the URI of an external style sheet.Default: null.
-
setSrc
public void setSrc(java.lang.String src)
Sets the URI of an external style sheet.Calling this method implies setContent(null). In other words, the last invocation of
setSrc(java.lang.String)overrides the previoussetContent(java.lang.String), if any.- Parameters:
src- the URI of an external style sheet- See Also:
setContent(java.lang.String)
-
getMedia
public java.lang.String getMedia()
Returns the media dependencies for this style sheet.Default: null.
Refer to media-depedent style sheet for details.
- Since:
- 5.0.3
-
setMedia
public void setMedia(java.lang.String media)
Sets the media dependencies for this style sheet.Refer to media-depedent style sheet for details.
- Parameters:
media- the media dependencies for this style sheet- Since:
- 5.0.3
-
getContent
public java.lang.String getContent()
Returns the content of the style element. By content we mean the CSS rules that will be sent to the client.Default: null.
Deriving class can override this method to return whatever it prefers (ignored if null).
- Since:
- 3.0.0
-
setContent
public void setContent(java.lang.String content)
Sets the content of the style element. By content we mean the CSS rules that will be sent to the client.Calling this method implies setSrc(null). In other words, the last invocation of
setContent(java.lang.String)overrides the previoussetSrc(java.lang.String), if any.- Since:
- 3.0.0
- See Also:
setSrc(java.lang.String)
-
renderProperties
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException- Overrides:
renderPropertiesin classorg.zkoss.zk.ui.AbstractComponent- Throws:
java.io.IOException
-
setVisible
public boolean setVisible(boolean visible)
Not allowed.- Specified by:
setVisiblein interfaceorg.zkoss.zk.ui.Component- Overrides:
setVisiblein classorg.zkoss.zk.ui.AbstractComponent
-
isChildable
protected boolean isChildable()
Not childable.- Overrides:
isChildablein classorg.zkoss.zk.ui.AbstractComponent
-
-