Package org.zkoss.stateless.sul

## Interface IA<I extends IAnyGroup>

- All Superinterfaces:
    `IAnyGroup<IA<I>>`, `IChildable<IA<I>,​I>`, `IChildrenOfInputgroup<IA<I>>`, `IComponent<IA<I>>`, `IHtmlBasedComponent<IA<I>>`, `ILabelElement<IA<I>>`, `ILabelImageElement<IA<I>>`, `IXulElement<IA<I>>`

      public interface IA<I extends IAnyGroup>
      extends ILabelImageElement<IA<I>>, IChildable<IA<I>,​I>, IAnyGroup<IA<I>>

  Immutable `A` component

  The A component with its `href` attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URI can address.

  ### Support @Action

  Name | Action Type
  --- | ---
  onFocus | Represents an action triggered when a component has received focus.
  onBlur | Represents an action triggered when a component has lost focus.

  For example, suppose you wants to create a hyperlink, then you can use the IA components as follows.

       @RichletMapping("/example")
       public IComponent example() {
           return IA.of("Visit ZK!").withHref("https://www.zkoss.org");
       }

  Author:
    katherine
  See Also:
    `A`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IA.Builder<I extends IAnyGroup>` | Builds instances of type `IA`.
    `static class` | `IA.Direction` | Insert Adjacent `direction` for `withDir(Direction)`
    `static class` | `IA.Target` | Insert Adjacent `target` for `withTarget(Target)`}
    `static class` | `IA.Updater` | Builds an updater of type `IA` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IA<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
    --- | --- | ---
    `java.lang.String` | `getAutodisable()` | Returns a list of component IDs that shall be disabled when the user clicks this anchor.
    `default java.lang.String` | `getDir()` | Returns the `direction`.
    `java.lang.String` | `getHref()` | Returns the URI that the hyperlink points to.
    `java.lang.String` | `getTarget()` | Returns the target frame or window.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isDisabled()` | Returns whether it is disabled.
    `static <I extends IAnyGroup> IA<I>` | `of​(I... children)` | Returns the instance with the given any group children.
    `static <I extends IAnyGroup> IA<I>` | `of​(java.lang.Iterable<? extends I> children)` | Returns the instance with the given any group children.
    `static <I extends IAnyGroup> IA<I>` | `of​(java.lang.String label)` | Returns the instance with the given label.
    `static <I extends IAnyGroup> IA<I>` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `IA<I>` | `withAutodisable​(java.lang.String autodisable)` | Returns a copy of `this` immutable component with the specified `autodisable`.
    `IA<I>` | `withDir​(java.lang.String dir)` | Returns a copy of `this` immutable component with the specified `dir`.
    `default IA<I>` | `withDir​(IA.Direction dir)` | Returns a copy of `this` immutable component with the specified `dir`.
    `IA<I>` | `withDisabled​(boolean disabled)` | Returns a copy of `this` immutable component with the specified `disabled`.
    `IA<I>` | `withHref​(java.lang.String href)` | Returns a copy of `this` immutable component with the specified `href`.
    `IA<I>` | `withTarget​(java.lang.String target)` | Returns a copy of `this` immutable component with the specified `target`.
    `default IA<I>` | `withTarget​(IA.Target 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, getId, 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.ILabelElement

      `getLabel, withLabel`

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

      `getHoverImage, getIconSclass, getIconSclasses, getIconTooltip, getIconTooltips, getImage, isPreloadImage, withHoverImage, withIconSclass, withIconSclasses, withIconTooltip, withIconTooltips, withImage, withPreloadImage`

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

      `getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip`

- - ### Field Detail

    - #### DEFAULT

          static final IA<IAnyGroup> DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zul.wgt.A"`

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

    - #### getDir

          default java.lang.String getDir()

      Returns the `direction`.

      Default: `"normal"`.

    - #### withDir

          IA<I> withDir​(java.lang.String dir)

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

      Sets the direction to layout with image.

      Parameters:
        `dir` - Either `"normal"` or `"reverse"`.
      Returns:
        A modified copy of the `this` object

    - #### withDir

          default IA<I> withDir​(IA.Direction dir)

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

      Sets the direction to layout with image.

      Parameters:
        `dir` - Either `IA.Direction.NORMAL` or `IA.Direction.REVERSE`.
      Returns:
        A modified copy of the `this` object

    - #### isDisabled

          default boolean isDisabled()

      Returns whether it is disabled.

      Default: `false`.

    - #### withDisabled

          IA<I> withDisabled​(boolean disabled)

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

      Sets whether it is disabled.

      Returns:
        A modified copy of the `this` object

    - #### getAutodisable

          @Nullable
          java.lang.String getAutodisable()

      Returns a list of component IDs that shall be disabled when the user clicks this anchor.

      Default: `null`

    - #### withAutodisable

          IA<I> withAutodisable​(@Nullable
                                java.lang.String autodisable)

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

      Sets a list of component IDs that shall be disabled when the user clicks this anchor.

      To represent the anchor itself, the developer can specify `self`. For example,

           @RichletMapping("/autodisable")
           public IComponent autodisable() {
               return IA.ofId("ok").withLabel("OK").withAutodisable("self,cancel");
           }

      is the same as

           @RichletMapping("/autodisable")
           public IComponent autodisable() {
               return IA.ofId("ok").withLabel("OK").withAutodisable("ok,cancel");
           }

      that will disable both the ok and cancel anchor when a user clicks it.

      The anchor being disabled will be enabled automatically once the client receives a response from the server. In other words, the server doesn't notice if an anchor is disabled with this method.

      However, if you prefer to enable them later manually, you can prefix with '+'. For example,

           @RichletMapping("/autodisable")
           public IComponent autodisable() {
               return IHlayout.of(
                       IA.ofId("ok").withLabel("OK(action)").withAutodisable("self,+cancel").withAction(this::control),
                       IA.ofId("cancel").withLabel("CANCEL")
               );
           }

      Then, you have to enable them manually such as

           @Action(type = Events.ON_BLUR)
           public void control() {
               UiAgent.getCurrent().smartUpdate(Locator.ofId("cancel"), new IA.Updater().disabled(false));
           }

      Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getTarget

          @Nullable
          java.lang.String getTarget()

      Returns the target frame or window.

      Note: It is useful only if `href` (`withHref(java.lang.String)`) is specified.

      Default: `null`.

    - #### withTarget

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

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

      Sets the target frame or window.

      Parameters:
        `target` - The name of the frame or window to hyperlink.
      Returns:
        A modified copy of the `this` object

    - #### withTarget

          default IA<I> withTarget​(IA.Target target)

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

      Sets the target frame or window.

      Parameters:
        `target` - The `IA.Target` of the frame or window to hyperlink.
      Returns:
        A modified copy of the `this` object

    - #### getHref

          @Nullable
          java.lang.String getHref()

      Returns the URI that the hyperlink points to.

      Default: `null`. If `null`, the hyperlink has no function unless you specify the `IComponent.withAction(ActionHandler)`.

    - #### withHref

          IA<I> withHref​(@Nullable
                         java.lang.String href)

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

      Sets the URI that the hyperlink points to. The `href` attribute is not restricted to HTTP-based URLs. For example,

           @RichletMapping("/example")
           public IComponent example() {
               return IA.of("Visit ZK!).withHref(https://www.zkoss.org");
           }

           @RichletMapping("/uri")
           public IComponent uri() {
               return IHlayout.of(
                   IA.of("jump to example (slash)).withHref(/essential_components/ia/example"),
                   IA.of("jump to example).withHref(example")
               );
           }

      If the URI starts with "/", ZK will encode it with the application's context path. Otherwise, the path is relative to the path given by Desktop.getDirectory().
      Returns:
        A modified copy of the `this` object

    - #### of

          static <I extends IAnyGroup> IA<I> of​(java.lang.String label)

      Returns the instance with the given label.
      Parameters:
        `label` - The label of this anchor component.

    - #### of

          static <I extends IAnyGroup> IA<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> IA<I> of​(I... children)

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

    - #### ofId

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

      Returns the instance with the given id.
      Parameters:
        `id` - The id of this anchor component.