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>>
    Immutable 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
    • Field Detail

      • DEFAULT

        static final IDrawer<IAnyGroup> DEFAULT
        Constant for default attributes of this immutable component.
    • Method Detail

      • getWidgetClass

        default java.lang.String getWidgetClass()
        Returns the client widget class.

        Default: "zkmax.wgt.Drawer"

        Specified by:
        getWidgetClass in interface IComponent<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 of this immutable component with the specified title.

        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 of this immutable component with the specified position.

        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 of this immutable component with the specified position.

        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 of this immutable component with the specified mask.

        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 of this immutable component with the specified closable.

        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 of this immutable component with the specified autodrop.

        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 interface IComponent<I extends IAnyGroup>
      • of

        static <I extends IAnyGroupIDrawer<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 IAnyGroupIDrawer<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 IAnyGroupIDrawer<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 IAnyGroupIDrawer<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 drawer
        children - The children belong to any group
        See Also:
        IAnyGroup
      • of

        static <I extends IAnyGroupIDrawer<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 drawer
        children - The children belong to any group
        See Also:
        IAnyGroup
      • ofId

        static <I extends IAnyGroupIDrawer<I> ofId​(java.lang.String id)
        Returns the instance with the given id.
        Parameters:
        id - The id to identify this component