Interface IDrawer<I extends IAnyGroup>
-
- All Superinterfaces:
IAnyGroup<IDrawer<I>>
,IChildable<IDrawer<I>,I>
,IComponent<IDrawer<I>>
,IHtmlBasedComponent<IDrawer<I>>
,IXulElement<IDrawer<I>>
public interface IDrawer<I extends IAnyGroup> extends IXulElement<IDrawer<I>>, IChildable<IDrawer<I>,I>, IAnyGroup<IDrawer<I>>
ImmutableDrawer
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 Classes Modifier and Type Interface Description static class
IDrawer.Builder<I extends IAnyGroup>
Builds instances of typeIDrawer
.static class
IDrawer.Position
Specifies the position to the drawer component.static class
IDrawer.Updater
Builds an updater of typeIDrawer
forUiAgent.smartUpdate(Locator, SmartUpdater)
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.String
getPosition()
Returns the position of this drawer.java.lang.String
getTitle()
Returns the title of this drawer.default java.lang.String
getWidgetClass()
Returns the client widget class.default boolean
isAutodrop()
Returns whether it is opened automatically when the mouse cursor is near the page edge.default boolean
isClosable()
Returns whether it is closeable by user (a button).default boolean
isMask()
Returns whether it is masked when opened.default boolean
isVisible()
Returns whether this component is visible or not.static <I extends IAnyGroup>
IDrawer<I>of(I... children)
Returns the instance with the given any group children.static <I extends IAnyGroup>
IDrawer<I>of(java.lang.Iterable<? extends I> children)
Returns the instance with the given any group children.static <I extends IAnyGroup>
IDrawer<I>of(java.lang.String title)
Returns the instance with the given title.static <I extends IAnyGroup>
IDrawer<I>of(java.lang.String title, I... children)
Returns the instance with the given title and any group children.static <I extends IAnyGroup>
IDrawer<I>of(java.lang.String title, java.lang.Iterable<? extends I> children)
Returns the instance with the given title and any group children.static <I extends IAnyGroup>
IDrawer<I>ofId(java.lang.String id)
Returns the instance with the given id.IDrawer<I>
withAutodrop(boolean autodrop)
Returns a copy ofthis
immutable component with the specifiedautodrop
.IDrawer<I>
withClosable(boolean closable)
Returns a copy ofthis
immutable component with the specifiedclosable
.IDrawer<I>
withMask(boolean mask)
Returns a copy ofthis
immutable component with the specifiedmask
.IDrawer<I>
withPosition(java.lang.String position)
Returns a copy ofthis
immutable component with the specifiedposition
.default IDrawer<I>
withPosition(IDrawer.Position position)
Returns a copy ofthis
immutable component with the specifiedposition
.IDrawer<I>
withTitle(java.lang.String title)
Returns a copy ofthis
immutable component with the specifiedtitle
.-
Methods inherited from interface org.zkoss.stateless.sul.IChildable
getChildren, withChildren, withChildren
-
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
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zkmax.wgt.Drawer"
- Specified by:
getWidgetClass
in interfaceIComponent<I extends IAnyGroup>
-
getTitle
@Nullable java.lang.String getTitle()
Returns the title of this drawer.null
means no title.Default:
null
.
-
withTitle
IDrawer<I> withTitle(@Nullable java.lang.String title)
Returns a copy ofthis
immutable component with the specifiedtitle
.Sets the title of this drawer.
null
means no title.- Parameters:
title
- The title of this drawer.Default:
null
.- Returns:
- A modified copy of the
this
object
-
getPosition
default java.lang.String getPosition()
Returns the position of this drawer. Valid values are"left"
,"right"
,"top"
and"bottom"
.Default:
"right"
.
-
withPosition
IDrawer<I> withPosition(java.lang.String position)
Returns a copy ofthis
immutable 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
this
object
-
withPosition
default IDrawer<I> withPosition(IDrawer.Position position)
Returns a copy ofthis
immutable 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
this
object
-
isMask
default boolean isMask()
Returns whether it is masked when opened.Default:
true
.
-
withMask
IDrawer<I> withMask(boolean mask)
Returns a copy ofthis
immutable 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
this
object
-
isClosable
default boolean isClosable()
Returns whether it is closeable by user (a button).Default:
false
.
-
withClosable
IDrawer<I> withClosable(boolean closable)
Returns a copy ofthis
immutable 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
this
object
-
isAutodrop
default boolean isAutodrop()
Returns whether it is opened automatically when the mouse cursor is near the page edge.Default:
false
.
-
withAutodrop
IDrawer<I> withAutodrop(boolean autodrop)
Returns a copy ofthis
immutable 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
this
object
-
isVisible
default boolean isVisible()
Returns whether this component is visible or not.Default:
false
- Specified by:
isVisible
in interfaceIComponent<I extends IAnyGroup>
-
of
static <I extends IAnyGroup> IDrawer<I> of(java.lang.Iterable<? extends I> children)
Returns the instance with the given any group children.- Parameters:
children
- The children belong to any group- See Also:
IAnyGroup
-
of
static <I extends IAnyGroup> IDrawer<I> of(java.lang.String title)
Returns the instance with the given title.- Parameters:
title
- The title of the drawer- See Also:
IAnyGroup
-
of
static <I extends IAnyGroup> IDrawer<I> of(I... children)
Returns the instance with the given any group children.- Parameters:
children
- The children belong to any group- See Also:
IAnyGroup
-
of
static <I extends IAnyGroup> IDrawer<I> of(java.lang.String title, java.lang.Iterable<? extends I> children)
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:
IAnyGroup
-
of
static <I extends IAnyGroup> IDrawer<I> of(java.lang.String title, I... children)
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:
IAnyGroup
-
-