Interface ResourceView

All Superinterfaces:
Component, Component.HasCaption, Component.HasDescription, HasContextHelp, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer
All Known Subinterfaces:
BrowserFrame, Image<T>
All Known Implementing Classes:
AbstractResourceView, BrowserFrameImpl, ImageImpl

A class that implements this interface is intended for viewing different resources, e.g. UrlResource, FileResource, etc.
  • Method Details

    • getSource

      @Nullable Resource getSource()
      Returns:
      Resource instance
    • setSource

      @StudioElementsGroup(caption="Resource", xmlElement="resource", icon="io/jmix/ui/icon/element/resource.svg") void setSource(@Nullable Resource resource)
      Sets the given Resource to the component.
      Parameters:
      resource - Resource instance
    • setSource

      <R extends Resource> R setSource(Class<R> type)
      Creates the resource with the given type and sets it to the component.
      Type Parameters:
      R - Resource inheritor
      Parameters:
      type - resource class to be created
      Returns:
      new resource instance
    • setAlternateText

      @StudioProperty void setAlternateText(@Nullable String alternateText)
      Sets this component's alternate text that can be presented instead of the component's normal content for accessibility purposes.
      Parameters:
      alternateText - a short, human-readable description of this component's content
    • getAlternateText

      @Nullable String getAlternateText()
      Gets this component's alternate text that can be presented instead of the component's normal content for accessibility purposes.
      Returns:
      alternate text
    • addSourceChangeListener

      Subscription addSourceChangeListener(Consumer<ResourceView.SourceChangeEvent> listener)
      Adds a listener that will be notified when a source is changed.