Package org.zkoss.zkmax.zul

## Class Coachmark

- java.lang.Object
- - org.zkoss.zk.ui.AbstractComponent
  - - org.zkoss.zk.ui.HtmlBasedComponent
    - - org.zkoss.zul.impl.XulElement
      - - org.zkoss.zkmax.zul.Coachmark

- All Implemented Interfaces:
    `java.io.Serializable`, `java.lang.Cloneable`, `Component`, `Scope`, `ComponentCtrl`

      public class Coachmark
      extends XulElement

  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.

  Only support browsers that support CSS keyframes. (IE10+, Edge, Chrome, Firefox, Safari)

  Since:
    9.0.0
  Author:
    leon
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent

      `HtmlBasedComponent.ExtraCtrl`

    - ### Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent

      `AbstractComponent.Children, AbstractComponent.ForwardInfo, AbstractComponent.TargetInfo`

  - ### Field Summary

    - ### Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent

      `_zclass`

    - ### Fields inherited from interface org.zkoss.zk.ui.Component

      `APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE`

    - ### Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

      `AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Coachmark()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` | Closes the coachmark.
    `java.lang.String` | `getNext()` | Returns next coachmark id of this coachmark.
    `Coachmark` | `getNextCoachmark()` | Returns next coachmark of this coachmark.
    `java.lang.String` | `getPosition()` | Returns the position of this coachmark.
    `java.lang.String` | `getTarget()` | Returns the target id of this coachmark.
    `void` | `next()` | Close this coachmark and Open the next which is set.
    `void` | `next​(Coachmark coachmark)` | Close this coachmark and Open the one you passed.
    `void` | `open()` | Opens the coachmark.
    `protected void` | `renderProperties​(ContentRenderer renderer)` | Renders the content of this component, excluding the enclosing tags and children.
    `void` | `service​(AuRequest request, boolean everError)` | Processes an AU request.
    `void` | `setNext​(java.lang.String coachmarkId)` | Sets next coachmark id.
    `void` | `setNext​(Coachmark coachmark)` | Sets next coachmark.
    `void` | `setPosition​(java.lang.String position)` | Sets the position of this coachmark.
    `void` | `setTarget​(java.lang.String id)` | Sets the target component id of this coachmark.
    `void` | `setTarget​(Component comp)` | Sets the target component of this coachmark.

    - ### Methods inherited from class org.zkoss.zul.impl.XulElement

      `clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes`

    - ### Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent

      `addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly`

    - ### Methods inherited from class org.zkoss.zk.ui.AbstractComponent

      `addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Coachmark

          public Coachmark()

  - ### Method Detail

    - #### getTarget

          public java.lang.String getTarget()

      Returns the target id of this coachmark.
      Returns:
        String

    - #### setTarget

          public void setTarget​(java.lang.String id)

      Sets the target component id of this coachmark.
      Parameters:
        `id` - the target component id

    - #### setTarget

          public void setTarget​(Component comp)

      Sets the target component of this coachmark.
      Parameters:
        `comp` - the target component

    - #### getPosition

          public java.lang.String getPosition()

      Returns the position of this coachmark.

      Default: after_center.

      Returns:
        String

    - #### setPosition

          public void setPosition​(java.lang.String 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.
      Throws:
        `WrongValueException` - if value is not valid.

    - #### getNext

          public java.lang.String getNext()

      Returns next coachmark id of this coachmark.
      Returns:
        String

    - #### setNext

          public void setNext​(java.lang.String coachmarkId)

      Sets next coachmark id.
      Parameters:
        `coachmarkId` - the next coachmark id.

    - #### setNext

          public void setNext​(Coachmark coachmark)

      Sets next coachmark.
      Parameters:
        `coachmark` - the next coachmark.

    - #### getNextCoachmark

          public Coachmark getNextCoachmark()

      Returns next coachmark of this coachmark.
      Returns:
        Coachmark
      See Also:
        `ComponentNotFoundException`

    - #### open

          public void open()

      Opens the coachmark.

    - #### close

          public void close()

      Closes the coachmark.

    - #### next

          public void next()

      Close this coachmark and Open the next which is set.

    - #### next

          public void next​(Coachmark coachmark)

      Close this coachmark and Open the one you passed.(ignore the next coachmark already set)
      Parameters:
        `coachmark` - the coachmark to open next.

    - #### renderProperties

          protected void renderProperties​(ContentRenderer renderer)
                                   throws java.io.IOException

      Description copied from class: `HtmlBasedComponent`
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
        `renderProperties` in class `XulElement`
      Throws:
        `java.io.IOException`

    - #### service

          public void service​(AuRequest request,
                              boolean everError)

      Description copied from class: `HtmlBasedComponent`
      Processes an AU request.

      Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.

      Specified by:
        `service` in interface `ComponentCtrl`
      Overrides:
        `service` in class `HtmlBasedComponent`
        `everError` - whether any error ever occurred before processing this request.
      See Also:
        `AbstractComponent.setAuService(org.zkoss.zk.au.AuService)`