Package com.vaadin.featurepack.ui
Class FImage
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.html.Image
com.vaadin.featurepack.ui.FImage
- All Implemented Interfaces:
ClientConnector,FAbstractClientConnector,FSizeable,FAbstractComponent,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.html.Image>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasAriaLabel,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,Serializable
A Flow component that wraps an
Image and provides legacy API for the
functionality.
Resource handling has changed a lot in Flow, so only ExternalResource
is currently supported.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.ClickNotifier
com.vaadin.flow.component.ClickNotifier.ClickFiltersJsNested classes/interfaces inherited from interface com.vaadin.featurepack.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.DetachEvent, ClientConnector.DetachListenerNested classes/interfaces inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
FAbstractClientConnector.LegacyMethodEventNested classes/interfaces inherited from interface com.vaadin.featurepack.ui.FAbstractComponent
FAbstractComponent.DataKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets this component's alternate text that can be presented instead of the component's normal content for accessibility purposes.Get the latest image source resource that has been given via eithersetSource(Resource)orFImage(String, Resource).voidsetAlternateText(String altText) Sets this component's alternate text that can be presented instead of the component's normal content for accessibility purposes.voidsetHeight(float height, com.vaadin.flow.component.Unit unit) Sets the height of the object.voidSets the height of the component using String presentation.voidSets the height to 100%.voidsetLabelComponent(com.vaadin.flow.component.Component labelComponent) Override this method to attach the labelComponent into your view.voidSets the size to 100% x 100%.voidClears any size settings.voidSets the image source resource.voidsetWidth(float width, com.vaadin.flow.component.Unit unit) Sets the width of the object.voidSets the width of the component using String presentation.voidSets the width to 100%.Methods inherited from class com.vaadin.flow.component.html.Image
getAlt, getSrc, setAlt, setSrc, setSrc, setSrcMethods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitleMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, getUIOrThrow, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
addLegacyAttachListener, addLegacyDetachListener, addListener, addListener, attach, detach, doConnectorOnAttach, doConnectorOnDetach, fireEvent, fireEvent, getAllChildrenIterable, getFListeners, getFlowComponent, getResource, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeListener, removeListener, setResourceMethods inherited from interface com.vaadin.featurepack.ui.FAbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, addStyleNames, beforeClientResponse, getCaption, getComponentError, getData, getDescription, getFErrorIndicator, getFErrorMessage, getFId, getFParent, getIcon, getIconResource, getPrimaryStyleName, getStyleName, isCaptionAsHtml, isImmediate, isResponsive, notifyParentAboutStyleChanges, removeContextClickListener, removeShortcutListener, removeStyleName, removeStyleNames, setCaption, setCaptionAsHtml, setComponentError, setData, setDescription, setDescription, setIcon, setIcon, setIconResource, setImmediate, setLocale, setPrimaryStyleName, setResponsive, setStyleName, setStyleNameMethods inherited from interface com.vaadin.featurepack.server.FSizeable
getFHeight, getFWidth, getHeightUnits, getWidthUnits, setHeightUndefined, setWidthUndefinedMethods inherited from interface com.vaadin.flow.component.HasAriaLabel
getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledBy, setAriaLabelledByMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidthMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
FImage
public FImage()Constructs an emptyFImage. -
FImage
Constructs an emptyFImagewith the provided caption.Note: FImage doesn't attach the caption component out of the box.
- Parameters:
caption- the caption to set
-
FImage
Constructs aFImagewhose content is loaded from the given resource. OnlyExternalResourceis currently supported.Note: FImage doesn't attach the caption component out of the box.
- Parameters:
caption-source- the Source of the embedded image.
-
-
Method Details
-
setSource
Sets the image source resource.- Parameters:
source- the source to set.
-
getSource
Get the latest image source resource that has been given via eithersetSource(Resource)orFImage(String, Resource). If neither method has been called, returnsnull. Other ways of setting the image source don't affect this method.- Returns:
- the latest resource or
null
-
setAlternateText
Sets this component's alternate text that can be presented instead of the component's normal content for accessibility purposes.- Parameters:
altText- A short, human-readable description of this component's content.
-
getAlternateText
Gets this component's alternate text that can be presented instead of the component's normal content for accessibility purposes.- Returns:
- Alternate text
-
setLabelComponent
public void setLabelComponent(com.vaadin.flow.component.Component labelComponent) Override this method to attach the labelComponent into your view.- Specified by:
setLabelComponentin interfaceFAbstractComponent- Parameters:
labelComponent- caption component that has been generated for this image
-
setWidthFull
public void setWidthFull()Description copied from interface:FSizeableSets the width to 100%.- Specified by:
setWidthFullin interfaceFSizeable- Specified by:
setWidthFullin interfacecom.vaadin.flow.component.HasSize
-
setHeight
Description copied from interface:FSizeableSets the height of the component using String presentation.String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size.
The empty string ("") or null will unset the height and set the units to pixels.
See CSS specification for more details.
-
setHeight
public void setHeight(float height, com.vaadin.flow.component.Unit unit) Description copied from interface:FSizeableSets the height of the object. Negative number implies unspecified size (terminal is free to set the size). -
setSizeFull
public void setSizeFull()Description copied from interface:FSizeableSets the size to 100% x 100%.- Specified by:
setSizeFullin interfaceFSizeable- Specified by:
setSizeFullin interfacecom.vaadin.flow.component.HasSize
-
setSizeUndefined
public void setSizeUndefined()Description copied from interface:FSizeableClears any size settings.- Specified by:
setSizeUndefinedin interfaceFSizeable- Specified by:
setSizeUndefinedin interfacecom.vaadin.flow.component.HasSize
-
setHeightFull
public void setHeightFull()Description copied from interface:FSizeableSets the height to 100%.- Specified by:
setHeightFullin interfaceFSizeable- Specified by:
setHeightFullin interfacecom.vaadin.flow.component.HasSize
-
setWidth
Description copied from interface:FSizeableSets the width of the component using String presentation.String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size.
The empty string ("") or null will unset the width and set the units to pixels.
See CSS specification for more details.
-
setWidth
public void setWidth(float width, com.vaadin.flow.component.Unit unit) Description copied from interface:FSizeableSets the width of the object. Negative number implies unspecified size (terminal is free to set the size).
-