Interface IStyle
- All Superinterfaces:
IAnyGroup<IStyle>,IComponent<IStyle>
Style component
The style component used to specify CSS styles for the owner desktop.
Note: a style component can appear anywhere in a page, but it affects all components in the same desktop.
There are two formats when used in a page:
Method 1: Specify the URL of the CSS file
IStyle.ofSrc("my.css");
Method 2: Specify the CSS content directly
IStyle.of(".mycls {border: 1px outset #777;}");
Note: if the src and content attributes are both set, the content
has higher priority.
- Author:
- katherine
- See Also:
-
Style
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIStyle.static classBuilds an updater of typeIStyleforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the content of the style element.getMedia()Returns the media dependencies for this style sheet.getSrc()Returns the URI of an external style sheet.default StringReturns the client widget class.default booleanReturns false by default.static IStyleReturns the instance with the given content.static IStyleReturns the instance with the given id.static IStyleReturns the instance with the given src.withContent(String content) Returns a copy ofthisimmutable component with the specifiedcontent.Returns a copy ofthisimmutable component with the specifiedmedia.Returns a copy ofthisimmutable component with the specifiedsrc.Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zul.utl.Style"- Specified by:
getWidgetClassin interfaceIComponent<IStyle>
-
getMedia
Returns the media dependencies for this style sheet.Default:
null.Refer to media-depedent style sheet for details.
-
withMedia
Returns a copy ofthisimmutable component with the specifiedmedia.Sets the media dependencies for this style sheet.
Refer to media-depedent style sheet for details.
- Parameters:
media- The media dependencies.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getContent
Returns the content of the style element. By content we mean the CSS rules that will be sent to the client.Default:
null. -
withContent
Returns a copy ofthisimmutable component with the specifiedcontent.Sets the content of the style element. By content we mean the CSS rules that will be sent to the client. Note: if calling this with
withSrc(String), thewithContent(String)has higher priority.- Parameters:
content- The CSS content.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getSrc
Returns the URI of an external style sheet.Default:
null. -
withSrc
Returns a copy ofthisimmutable component with the specifiedsrc.Sets the URI of an external style sheet. Note: if calling this with
withContent(String), thewithContent(String)has higher priority.- Parameters:
src- The style URI.Default:
null.- Returns:
- A modified copy of the
thisobject
-
isVisible
default boolean isVisible()Returns false by default.- Specified by:
isVisiblein interfaceIComponent<IStyle>
-
of
Returns the instance with the given content.- Parameters:
content- The style content.
-
ofSrc
Returns the instance with the given src.- Parameters:
src- The style URI.
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-