Package org.zkoss.stateless.sul

## Interface ICoachmark<I extends IAnyGroup>

- All Superinterfaces:
    `IAnyGroup<ICoachmark<I>>`, `IChildable<ICoachmark<I>,​I>`, `IComponent<ICoachmark<I>>`, `IHtmlBasedComponent<ICoachmark<I>>`, `IXulElement<ICoachmark<I>>`

      public interface ICoachmark<I extends IAnyGroup>
      extends IXulElement<ICoachmark<I>>, IAnyGroup<ICoachmark<I>>, IChildable<ICoachmark<I>,​I>

  Immutable `Coachmark` component

  A coachmark component.

  A coachmark is used to attract users' attention to the target component.

  The coachmarks are suitable for guiding user operations, they should be as relevant as possible to the context.

  ### Support @Action

  Name | Action Type
  --- | ---
  onOpen | ActionData: `OpenData` Denotes that the user has opened or closed a component.
  onTargetClick | ActionData: `MouseData` Represents an event caused by a user's click on a highlighted target component.

  Author:
    katherine
  See Also:
    `Coachmark`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `ICoachmark.Builder<I extends IAnyGroup>` | Builds instances of type `ICoachmark`.
    `static class` | `ICoachmark.Position` | Specify a popup's position when attaching to a component.
    `static class` | `ICoachmark.Updater` | Builds an updater of type `ICoachmark` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static ICoachmark<IAnyGroup>` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default java.lang.String` | `getId()` | Returns the ID.
    `default java.lang.String` | `getPosition()` | Returns the position of this coachmark.
    `java.lang.String` | `getTarget()` | Returns the target id of this coachmark.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `static <I extends IAnyGroup> ICoachmark<I>` | `of​(java.lang.String targetId, I... children)` | Returns the instance with the given targetId and any group children.
    `static <I extends IAnyGroup> ICoachmark<I>` | `of​(java.lang.String targetId, java.lang.Iterable<? extends I> children)` | Returns the instance with the given targetId and any group children.
    `static <I extends IAnyGroup> ICoachmark<I>` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `ICoachmark<I>` | `withPosition​(java.lang.String position)` | Returns a copy of `this` immutable component with the specified `position`.
    `default ICoachmark<I>` | `withPosition​(ICoachmark.Position position)` | Returns a copy of `this` immutable component with the specified `position`.
    `ICoachmark<I>` | `withTarget​(java.lang.String target)` | Returns a copy of `this` immutable component with the specified `target`.
    `default ICoachmark` | `withTarget​(IComponent target)` | Returns a copy of `this` immutable component with the specified `target`.

    - ### Methods inherited from interface org.zkoss.stateless.sul.IChildable

      `getChildren, withChildren, withChildren`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IComponent

      `getAction, getActions, getClientAttributes, getMold, getWidgetListeners, getWidgetOverrides, isVisible, 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`

- - ### Field Detail

    - #### DEFAULT

          static final ICoachmark<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.nav.Coachmark"`

      Specified by:
        `getWidgetClass` in interface `IComponent<I extends IAnyGroup>`

    - #### getTarget

          @Nullable
          java.lang.String getTarget()

      Returns the target id of this coachmark.

      Default: `null`

    - #### withTarget

          ICoachmark<I> withTarget​(@Nullable
                                   java.lang.String target)

      Returns a copy of `this` immutable component with the specified `target`.

      Sets the target component id of this coachmark

      Parameters:
        `target` - The target component id of this coachmark

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### withTarget

          default ICoachmark withTarget​(IComponent target)

      Returns a copy of `this` immutable component with the specified `target`.

      Sets the target component of this coachmark

      Parameters:
        `target` - The target component of this coachmark

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getPosition

          default java.lang.String getPosition()

      Returns the position of this coachmark.

      Default: `"after_center"`.

    - #### withPosition

          ICoachmark<I> withPosition​(java.lang.String position)

      Returns a copy of `this` immutable component with the specified `position`.

      Sets the position of this coachmark.

      Valid values for the position attribute are:

      - before_start
        the coachmark appears above the target, aligned to the left.
      - before_center
        the coachmark appears above the target, aligned to the center.
      - before_end
        the coachmark appears above the target, aligned to the right.
      - after_start
        the coachmark appears below the target, aligned to the left.
      - after_center
        the coachmark appears below the target, aligned to the center.
      - after_end
        the coachmark appears below the target, aligned to the right.
      - start_before
        the coachmark appears to the left of the target, aligned to the top.
      - start_center
        the coachmark appears to the left of the target, aligned to the middle.
      - start_after
        the coachmark appears to the left of the target, aligned to the bottom.
      - end_before
        the coachmark appears to the right of the target, aligned to the top.
      - end_center
        the coachmark appears to the right of the target, aligned to the middle.
      - end_after
        the coachmark appears to the right of the target, aligned to the bottom.
      Parameters:
        `position` - The position of this coachmark.

        Default: `"after_center"`.

      Returns:
        A modified copy of the `this` object

    - #### withPosition

          default ICoachmark<I> withPosition​(ICoachmark.Position position)

      Returns a copy of `this` immutable component with the specified `position`.

      Sets the position of this coachmark.

      Valid values for the position attribute are:

      - before_start
        the coachmark appears above the target, aligned to the left.
      - before_center
        the coachmark appears above the target, aligned to the center.
      - before_end
        the coachmark appears above the target, aligned to the right.
      - after_start
        the coachmark appears below the target, aligned to the left.
      - after_center
        the coachmark appears below the target, aligned to the center.
      - after_end
        the coachmark appears below the target, aligned to the right.
      - start_before
        the coachmark appears to the left of the target, aligned to the top.
      - start_center
        the coachmark appears to the left of the target, aligned to the middle.
      - start_after
        the coachmark appears to the left of the target, aligned to the bottom.
      - end_before
        the coachmark appears to the right of the target, aligned to the top.
      - end_center
        the coachmark appears to the right of the target, aligned to the middle.
      - end_after
        the coachmark appears to the right of the target, aligned to the bottom.
      Parameters:
        `position` - The position of this coachmark.

        Default: `"after_center"`.

      Returns:
        A modified copy of the `this` object

    - #### getId

          default java.lang.String getId()

      Description copied from interface: `IComponent`
      Returns the ID.

      Default: `""` (an empty string; it means no ID at all).
      Note: Unlike ZK Component, there is no ID Space in Stateless Component, so the `ID` should be unique within a Desktop Scope, aka a browser page.

      Specified by:
        `getId` in interface `IComponent<I extends IAnyGroup>`

    - #### of

          static <I extends IAnyGroup> ICoachmark<I> of​(java.lang.String targetId,
                                                        java.lang.Iterable<? extends I> children)

      Returns the instance with the given targetId and any group children.
      Parameters:
        `targetId` - The target ID
        `children` - The children belong to any group
      See Also:
        `IAnyGroup`

    - #### of

          static <I extends IAnyGroup> ICoachmark<I> of​(java.lang.String targetId,
                                                        I... children)

      Returns the instance with the given targetId and any group children.
      Parameters:
        `targetId` - The target ID
        `children` - The children belong to any group
      See Also:
        `IAnyGroup`

    - #### ofId

          static <I extends IAnyGroup> ICoachmark<I> ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component