Klasse UiImage

java.lang.Object
org.obrel.core.RelatedObject
Alle implementierten Schnittstellen:
org.obrel.core.Relatable

public class UiImage extends UiComponent<String,UiImage>
A component that displays an image and can create click events.
  • Konstruktordetails

    • UiImage

      public UiImage(UiContainer<?> parent, UiImageDefinition<?> image)
      Creates a new instance.
      Parameter:
      parent - The parent container
      image - The initial image
  • Methodendetails

    • caption

      public UiImage caption(String caption)
      Fluent variant of setCaption(String).
      Parameter:
      caption - The image caption
      Gibt zurück:
      This instance
    • getImage

      public UiImageDefinition<?> getImage()
      Returns the image that is displayed by this image component.
      Setzt außer Kraft:
      getImage in Klasse UiComponent<String,UiImage>
      Gibt zurück:
      The image definition
    • onClick

      public final UiImage onClick(Runnable eventHandler)
      Sets the event handler for click events on images.
      Parameter:
      eventHandler - The event handler
      Gibt zurück:
      This instance for concatenation
    • setCaption

      public void setCaption(String caption)
      Sets a caption label to be displayed over the image (if supported by the container layout).
      Parameter:
      caption - The caption label or null for none
    • setImage

      public void setImage(UiImageDefinition<?> image)
      Sets the image to be displayed.
      Parameter:
      image - The image