Interface IDrawer<I extends IAnyGroup>
- All Superinterfaces:
IAnyGroup<IDrawer<I>>,IChildable<IDrawer<I>,,I> IComponent<IDrawer<I>>,IHtmlBasedComponent<IDrawer<I>>,IXulElement<IDrawer<I>>
Drawer component.
A Drawer is a component that acts as a panel but sticks to the boundary of a web page. With this, you can make the page cleaner and put details into the Drawer for a better user experience.
Note: only support browsers that support Flex and CSS Transitions.
Support @Action
| Name | Action Type |
|---|---|
| onOpen | ActionData: OpenData
Denotes user has opened or closed a component. |
Example
In this example we dock a drawer on the right side and put detailed file information into the drawer.
@RichletMapping("/example")
public IComponent example() {
return IVlayout.of(
IButton.of("Show File Info").withAction(this::doOpenDrawer),
IDrawer.ofId("fi").withTitle("File information").withChildren(
IGrid.of(
IRow.of(ILabel.of("Name"), ILabel.of("1.jpg")),
IRow.of(ILabel.of("Size"), ILabel.of("1.8 Megabytes")),
IRow.of(ILabel.of("Dimensions"), ILabel.of("1920x1080"))
)
)
);
}
@Action(type = Events.ON_CLICK)
public void doOpenDrawer(UiAgent uiAgent) {
uiAgent.smartUpdate(Locator.ofId("fi"), new IDrawer.Updater().visible(true));
}
Data-AnimationSpeed
Article: ZUML Reference/ZUML/Namespaces/Client Attribute/Data-AnimationSpeed
This component respects the data-animationspeed attribute.
For example, to change the animation speed, you can apply data-animationspeed attribute.
The valid value can be "slow", "fast" or any integer, same as jQuery.
When you specify 0 as the value, it means no animation.
.withClientAttribute("data-animationspeed", "0");- Author:
- katherine
- See Also:
-
Drawer
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classIDrawer.Builder<I extends IAnyGroup>Builds instances of typeIDrawer.static enumSpecifies the position to the drawer component.static classBuilds an updater of typeIDrawerforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturns the position of this drawer.getTitle()Returns the title of this drawer.default StringReturns the client widget class.default booleanReturns whether it is opened automatically when the mouse cursor is near the page edge.default booleanReturns whether it is closeable by user (a button).default booleanisMask()Returns whether it is masked when opened.default booleanReturns whether this component is visible or not.of(I... children) Returns the instance with the given any group children.Returns the instance with the given any group children.Returns the instance with the given title.Returns the instance with the given title and any group children.Returns the instance with the given title and any group children.Returns the instance with the given id.withAutodrop(boolean autodrop) Returns a copy ofthisimmutable component with the specifiedautodrop.withClosable(boolean closable) Returns a copy ofthisimmutable component with the specifiedclosable.withMask(boolean mask) Returns a copy ofthisimmutable component with the specifiedmask.withPosition(String position) Returns a copy ofthisimmutable component with the specifiedposition.withPosition(IDrawer.Position position) Returns a copy ofthisimmutable component with the specifiedposition.Returns a copy ofthisimmutable component with the specifiedtitle.Methods inherited from interface org.zkoss.stateless.sul.IChildable
getChildren, withChildren, withChildrenMethods 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, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndexMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zkmax.wgt.Drawer"- Specified by:
getWidgetClassin interfaceIComponent<I extends IAnyGroup>
-
getTitle
Returns the title of this drawer.nullmeans no title.Default:
null. -
withTitle
Returns a copy ofthisimmutable component with the specifiedtitle.Sets the title of this drawer.
nullmeans no title.- Parameters:
title- The title of this drawer.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getPosition
Returns the position of this drawer. Valid values are"left","right","top"and"bottom".Default:
"right". -
withPosition
Returns a copy ofthisimmutable component with the specifiedposition.Sets the position of this drawer. Valid values are
"left","right","top"and"bottom".- Parameters:
position- The position of this drawer.Default:
"right".- Returns:
- A modified copy of the
thisobject
-
withPosition
Returns a copy ofthisimmutable component with the specifiedposition.Sets the position of this drawer.
- Parameters:
position- The position of this drawer.Default:
"right".- Returns:
- A modified copy of the
thisobject
-
isMask
default boolean isMask()Returns whether it is masked when opened.Default:
true. -
withMask
Returns a copy ofthisimmutable component with the specifiedmask.Sets whether it is masked when opened.
- Parameters:
mask- Whether it is masked when opened.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isClosable
default boolean isClosable()Returns whether it is closeable by user (a button).Default:
false. -
withClosable
Returns a copy ofthisimmutable component with the specifiedclosable.Sets whether it is closeable by user (a button).
- Parameters:
closable- Whether it is closeable by user (a button).Default:
false.- Returns:
- A modified copy of the
thisobject
-
isAutodrop
default boolean isAutodrop()Returns whether it is opened automatically when the mouse cursor is near the page edge.Default:
false. -
withAutodrop
Returns a copy ofthisimmutable component with the specifiedautodrop.Sets whether it is opened automatically when the mouse cursor is near the page edge.
- Parameters:
autodrop- Whether it is opened automatically.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isVisible
default boolean isVisible()Returns whether this component is visible or not.Default:
false- Specified by:
isVisiblein interfaceIComponent<I extends IAnyGroup>
-
of
Returns the instance with the given any group children.- Parameters:
children- The children belong to any group- See Also:
-
of
Returns the instance with the given title.- Parameters:
title- The title of the drawer- See Also:
-
of
Returns the instance with the given any group children.- Parameters:
children- The children belong to any group- See Also:
-
of
Returns the instance with the given title and any group children.- Parameters:
title- The title of the drawerchildren- The children belong to any group- See Also:
-
of
Returns the instance with the given title and any group children.- Parameters:
title- The title of the drawerchildren- The children belong to any group- See Also:
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-