Class ImageImpl<T>

All Implemented Interfaces:
AttachNotifier, Component, Component.BelongToFrame, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper, HasValueSource<T>, HasContextHelp, HasDebugId, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer, Image<T>, ResourceView, org.springframework.beans.factory.InitializingBean

public class ImageImpl<T> extends AbstractResourceView<JmixImage> implements Image<T>, org.springframework.beans.factory.InitializingBean
  • Field Details

    • IMAGE_STYLENAME

      protected static final String IMAGE_STYLENAME
      See Also:
    • valueSource

      protected ValueSource<T> valueSource
    • valueChangeSubscription

      protected Subscription valueChangeSubscription
    • instanceChangeSubscription

      protected Subscription instanceChangeSubscription
    • scaleMode

      protected Image.ScaleMode scaleMode
    • vClickListener

      protected com.vaadin.event.MouseEvents.ClickListener vClickListener
  • Constructor Details

    • ImageImpl

      public ImageImpl()
  • Method Details

    • createComponent

      protected JmixImage createComponent()
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • initComponent

      protected void initComponent(JmixImage component)
    • setValueSource

      public void setValueSource(@Nullable ValueSource<T> valueSource)
      Description copied from interface: HasValueSource
      Sets value source for component.
      Specified by:
      setValueSource in interface HasValueSource<T>
      Parameters:
      valueSource - value source
    • unbindValueSourceEvents

      protected void unbindValueSourceEvents()
    • bindValueSourceEvents

      protected void bindValueSourceEvents()
    • getValueSource

      @Nullable public ValueSource<T> getValueSource()
      Specified by:
      getValueSource in interface HasValueSource<T>
      Returns:
      currently bound value source
    • updateComponent

      protected void updateComponent()
    • createImageResource

      @Nullable protected Resource createImageResource(@Nullable Object resourceObject)
    • getScaleMode

      public Image.ScaleMode getScaleMode()
      Specified by:
      getScaleMode in interface Image<T>
      Returns:
      image scale mode
    • setScaleMode

      public void setScaleMode(Image.ScaleMode scaleMode)
      Description copied from interface: Image
      Applies the given scale mode to the image.
      Specified by:
      setScaleMode in interface Image<T>
      Parameters:
      scaleMode - scale mode
    • addClickListener

      public Subscription addClickListener(Consumer<Image.ClickEvent> listener)
      Specified by:
      addClickListener in interface Image<T>
    • removeClickListener

      public void removeClickListener(Consumer<Image.ClickEvent> listener)
      Specified by:
      removeClickListener in interface Image<T>
      Parameters:
      listener - a listener to remove