All Implemented Interfaces:
Serializable, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IRequestListener, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class Source extends Image
A component which displays localizable image resources within a picture tag. The source tag is the same as the image element, but it is also possible to set the media attribute with setMedia(String media). The second difference is that there is no src attribute, so every ResourceReference and ImageResource is added directly to the srcset attribute.
Author:
Tobias Soloschenko
See Also:
  • Constructor Details

    • Source

      protected Source(String id)
      Creates a source for a picture
      Parameters:
      id - the component id
      See Also:
    • Source

      public Source(String id, ResourceReference... resourceReferences)
      Creates a source for a picture
      Parameters:
      id - the component id
      resourceReferences - the resource references applied to the source in the given order
      See Also:
    • Source

      public Source(String id, PageParameters resourceParameters, ResourceReference... resourceReferences)
      Creates a source for a picture
      Parameters:
      id - the component id
      resourceParameters - the resource parameters applied to the localized image resource
      resourceReferences - the resource references applied to the source in the given order
      See Also:
    • Source

      public Source(String id, IResource... imageResources)
      Creates a source for a picture
      Parameters:
      id - the component id
      imageResources - the image resources applied to the source in the given order
      See Also:
    • Source

      public Source(String id, IModel<?> model)
      Creates a source for a picture
      Parameters:
      id - the component id
      model - the internally used model
      See Also:
    • Source

      public Source(String id, String string)
      Creates a source for a picture
      Parameters:
      id - the component id
      string - the string used as model
      See Also:
  • Method Details