Interface IStyle
-
- All Superinterfaces:
IAnyGroup<IStyle>,IComponent<IStyle>
public interface IStyle extends IAnyGroup<IStyle>
ImmutableStylecomponentThe 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
srcandcontentattributes are both set, thecontenthas higher priority.- Author:
- katherine
- See Also:
Style
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIStyle.BuilderBuilds instances of typeIStyle.static classIStyle.UpdaterBuilds an updater of typeIStyleforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default 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.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisVisible()Returns false by default.static IStyleof(java.lang.String content)Returns the instance with the given content.static IStyleofId(java.lang.String id)Returns the instance with the given id.static IStyleofSrc(java.lang.String src)Returns the instance with the given src.IStylewithContent(java.lang.String content)Returns a copy ofthisimmutable component with the specifiedcontent.IStylewithMedia(java.lang.String media)Returns a copy ofthisimmutable component with the specifiedmedia.IStylewithSrc(java.lang.String src)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 Detail
-
DEFAULT
static final IStyle DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zul.utl.Style"- Specified by:
getWidgetClassin interfaceIComponent<IStyle>
-
getMedia
@Nullable java.lang.String getMedia()
Returns the media dependencies for this style sheet.Default:
null.Refer to media-depedent style sheet for details.
-
withMedia
IStyle withMedia(@Nullable java.lang.String media)
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
@Nullable 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.
-
withContent
IStyle withContent(@Nullable java.lang.String content)
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
@Nullable java.lang.String getSrc()
Returns the URI of an external style sheet.Default:
null.
-
withSrc
IStyle withSrc(@Nullable java.lang.String src)
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
static IStyle of(java.lang.String content)
Returns the instance with the given content.- Parameters:
content- The style content.
-
ofSrc
static IStyle ofSrc(java.lang.String src)
Returns the instance with the given src.- Parameters:
src- The style URI.
-
ofId
static IStyle ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-
-