Interface ILineitem<I extends IAnyGroup>

All Superinterfaces:
IAnyGroup<ILineitem<I>>, IChildable<ILineitem<I>,I>, IComponent<ILineitem<I>>, IHtmlBasedComponent<ILineitem<I>>, IXulElement<ILineitem<I>>

public interface ILineitem<I extends IAnyGroup> extends IXulElement<ILineitem<I>>, IChildable<ILineitem<I>,I>, IAnyGroup<ILineitem<I>>
Immutable Lineitem component

Lineitem is the child of Linelayout, it can contain up to 2 components inside.

Author:
katherine
See Also:
  • Lineitem
  • Field Details

    • DEFAULT

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

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zkmax.layout.Lineitem"

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

      @Nullable String getPointStyle()
      Returns the CSS style for the point.

      Default: null

    • withPointStyle

      ILineitem<I> withPointStyle(@Nullable String pointStyle)
      Returns a copy of this immutable component with the specified pointStyle.

      Sets the pointStyle.

      Parameters:
      pointStyle - Sets the pointStyle.

      Default: null.

      Returns:
      A modified copy of the this object
    • getPointIconSclass

      @Nullable String getPointIconSclass()
      Returns the iconSclass name of this point.
    • withPointIconSclass

      ILineitem<I> withPointIconSclass(@Nullable String pointIconSclass)
      Returns a copy of this immutable component with the specified pointIconSclass.

      Sets the pointIconSclass name of the point.

      Parameters:
      pointIconSclass - Sets the pointStyle.

      Default: null.

      Returns:
      A modified copy of the this object
    • getFrontSpace

      @Nullable String getFrontSpace()
      Returns the spacing with the previous lineitem.
    • withFrontSpace

      ILineitem<I> withFrontSpace(@Nullable String frontSpace)
      Returns a copy of this immutable component with the specified frontSpace.

      Sets the spacing with the previous lineitem.

      Parameters:
      frontSpace - the spacing with the previous lineitem. (such as "5px" or "5em"). If null or empty (""), the default spacing is used (i.e., controlled by CSS alone).

      Default: null.

      Returns:
      A modified copy of the this object
    • getBackSpace

      @Nullable String getBackSpace()
      Returns the spacing with the next lineitem.
    • withBackSpace

      ILineitem<I> withBackSpace(@Nullable String backSpace)
      Returns a copy of this immutable component with the specified backSpace.

      Sets the spacing with the next lineitem.

      Parameters:
      backSpace - the spacing with the next lineitem. (such as "5px" or "5em"). If null or empty (""), the default spacing is used (i.e., controlled by CSS alone).

      Default: null.

      Returns:
      A modified copy of the this object
    • isPointVisible

      default boolean isPointVisible()
      Returns whether the point is visible.

      Default: true.

    • withPointVisible

      ILineitem<I> withPointVisible(boolean pointVisible)
      Returns a copy of this immutable component with the specified pointVisible.

      Sets whether the point is visible.

      Parameters:
      pointVisible - Whether the point is visible.

      Default: true.

      Returns:
      A modified copy of the this object
    • isOpposite

      default boolean isOpposite()
      Returns whether the first child is displayed in the first area(left/top).

      Default: false.

    • withOpposite

      ILineitem<I> withOpposite(boolean opposite)
      Returns a copy of this immutable component with the specified opposite.

      Sets whether the first child is displayed in the first area(left/top).

      Parameters:
      opposite - Whether the first child is displayed in the first area(left/top).

      Default: true.

      Returns:
      A modified copy of the this object
    • getPointImageSrc

      @Nullable String getPointImageSrc()
      Returns the source URI of the point image.

      Default: null.

    • withPointImageSrc

      ILineitem<I> withPointImageSrc(@Nullable String pointImageSrc)
      Returns a copy of this immutable component with the specified pointImageSrc.

      Sets the source URI of the point image.

      Note: the withPointImageContent(org.zkoss.image.Image) is higher priority if both methods are specified.

      Parameters:
      pointImageSrc - The source URI of the point image.

      Default: null.

      Returns:
      A modified copy of the this object
    • getPointImageContent

      @Nullable org.zkoss.image.Image getPointImageContent()
      Returns the content set by withPointImageContent(org.zkoss.image.Image).

      Note: it won't fetch what is set through by withPointImageSrc(String). It simply returns what is passed to withPointImageContent(org.zkoss.image.Image).

    • withPointImageContent

      ILineitem<I> withPointImageContent(@Nullable org.zkoss.image.Image pointImageContent)
      Returns a copy of this immutable component with the specified pointImageContent.

      Sets the content directly.

      Default: null.

      Calling this method implies withPointImageSrc is useless. In other words, The withPointImageContent(org.zkoss.image.Image) priority is higher than calling the withPointImageSrc(String), if any.

      Parameters:
      pointImageContent - The image to display.
      Returns:
      A modified copy of this object
      See Also:
    • withPointImageContent

      default ILineitem<I> withPointImageContent(@Nullable RenderedImage image)
      Returns a copy of this immutable component with the specified image.

      Sets the content directly with the rendered image. It actually encodes the rendered image to an PNG image (Image) with Images.encode(java.lang.String, java.awt.image.RenderedImage, float, boolean), and then invoke withPointImageContent(org.zkoss.image.Image)}.

      If you want more control such as different format, quality, and naming, you can use Images directly.

      Parameters:
      image - The image to display.
      Returns:
      A modified copy of this object
    • of

      static <I extends IAnyGroup> ILineitem<I> of(Iterable<? extends I> children)
      Returns the instance with the given any group children (only up to two children).
      Parameters:
      children - The children belong to any group
      See Also:
    • of

      static <I extends IAnyGroup> ILineitem<I> of(I... children)
      Returns the instance with the given any group children (only up to two children).
      Parameters:
      children - The children belong to any group
      See Also:
    • ofPointIconSclass

      static <I extends IAnyGroup> ILineitem<I> ofPointIconSclass(String pointIconSclass)
      Returns the instance with the given pointIconSclass.
      Parameters:
      pointIconSclass - The sclass name of the point icon.
    • ofPointImageSrc

      static <I extends IAnyGroup> ILineitem<I> ofPointImageSrc(String src)
      Returns the instance with the given pointImageSrc.
      Parameters:
      src - The source URI of the point background image.
    • ofId

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