Package org.zkoss.stateless.sul

## Interface IBarcode

- All Superinterfaces:
    `IAnyGroup<IBarcode>`, `IComponent<IBarcode>`, `IHtmlBasedComponent<IBarcode>`, `IXulElement<IBarcode>`

      public interface IBarcode
      extends IXulElement<IBarcode>, IAnyGroup<IBarcode>

  Immutable `Barcode` component

  A barcode is a component to handle 1D and 2D barcode image.

  Author:
    katherine
  See Also:
    `Barcode`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IBarcode.Builder` | Builds instances of type `IBarcode`.
    `static class` | `IBarcode.Updater` | Builds an updater of type `IBarcode` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IBarcode` | `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 int` | `getBarWidth()` | Returns the width of single bar (only for 1D barcode).
    `default boolean` | `getDisplayValue()` | Returns the visibility of the value of barcode component (only for 1D barcode).
    `default int` | `getFontSize()` | Returns the fontSize of barcode (only for 1D barcode).
    `default java.lang.String` | `getType()` | Returns the encoded and decoded type of this component.
    `default java.lang.String` | `getValue()` | Returns the value of the barcode image.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `static IBarcode` | `of​(java.lang.String value)` | Returns the instance with the given value
    `static IBarcode` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `static IBarcode` | `ofType​(java.lang.String type, java.lang.String value)` | Returns the instance with the given type and value
    `IBarcode` | `withBarWidth​(int barWidth)` | Returns a copy of `this` immutable component with the specified `barWidth`.
    `IBarcode` | `withDisplayValue​(boolean displayValue)` | Returns a copy of `this` immutable component with the specified `displayValue`.
    `IBarcode` | `withFontSize​(int fontSize)` | Returns a copy of `this` immutable component with the specified `fontSize`.
    `IBarcode` | `withType​(java.lang.String type)` | Returns a copy of `this` immutable component with the specified `type`.
    `IBarcode` | `withValue​(java.lang.String value)` | Returns a copy of `this` immutable component with the specified `value`.

    - ### 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.IXulElement

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

- - ### Field Detail

    - #### DEFAULT

          static final IBarcode DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zkmax.barcode.Barcode"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IBarcode>`

    - #### getType

          default java.lang.String getType()

      Returns the encoded and decoded type of this component. The built-in types are
      - CODE family: CODE39, CODE128, CODE128A, CODE128B, CODE128C
      - EAN family: EAN13, EAN8, EAN5, EAN2
      - ITF family: ITF14, ITF
      - MSI family: MSI, MSI10, MSI11, MSI1010, MSI1110
      - others: UPC, PHARMACODE , CODABAR, QR
      Some types have character and length limit. You can check it at https://en.wikipedia.org/wiki/Barcode

      Default: `"CODE128"`.

      Returns:
        A value of the barcode current type.

    - #### withType

          IBarcode withType​(java.lang.String type)

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

      Sets the encoded and decoded type of this component. The built-in types are

      - CODE family: CODE39, CODE128, CODE128A, CODE128B, CODE128C
      - EAN family: EAN13, EAN8, EAN5, EAN2
      - ITF family: ITF14, ITF
      - MSI family: MSI, MSI10, MSI11, MSI1010, MSI1110
      - others: UPC, PHARMACODE , CODABAR, QR
      Some types have character and length limit. You can check it at https://en.wikipedia.org/wiki/Barcode
      Parameters:
        `type` - The encoded and decoded type of this component.

        Default: `"CODE128"`.

      Returns:
        A modified copy of the `this` object

    - #### getDisplayValue

          default boolean getDisplayValue()

      Returns the visibility of the value of barcode component (only for 1D barcode).

      Default: `false`.

    - #### withDisplayValue

          IBarcode withDisplayValue​(boolean displayValue)

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

      Sets the visibility of the value of barcode component (only for 1D barcode).

      Parameters:
        `displayValue` - The visibility of the value of barcode component

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### getValue

          default java.lang.String getValue()

      Returns the value of the barcode image.

      Default: `""`.

    - #### withValue

          IBarcode withValue​(java.lang.String value)

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

      Sets the value of the barcode image.

      Parameters:
        `value` - The value of the barcode image.

        Default: `""`.

      Returns:
        A modified copy of the `this` object

    - #### getFontSize

          default int getFontSize()

      Returns the fontSize of barcode (only for 1D barcode).

      Default: `10`.

    - #### withFontSize

          IBarcode withFontSize​(int fontSize)

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

      Sets the fontSize of barcode (only for 1D barcode).

      Parameters:
        `fontSize` - The fontSize of barcode (only for 1D barcode).

        Default: `10`.

      Returns:
        A modified copy of the `this` object

    - #### getBarWidth

          default int getBarWidth()

      Returns the width of single bar (only for 1D barcode).

      Default: `2`.

    - #### withBarWidth

          IBarcode withBarWidth​(int barWidth)

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

      Sets the width of single bar (only for 1D barcode).

      Parameters:
        `barWidth` - The width of single bar (only for 1D barcode).

        Default: `2`.

      Returns:
        A modified copy of the `this` object

    - #### of

          static IBarcode of​(java.lang.String value)

      Returns the instance with the given value
      Parameters:
        `value` - The value of the component

    - #### ofType

          static IBarcode ofType​(java.lang.String type,
                                 java.lang.String value)

      Returns the instance with the given type and value
      Parameters:
        `type` - The encoded or decoded type of the component.
        `value` - The value of the component

    - #### ofId

          static IBarcode ofId​(java.lang.String id)

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