@Tag(value="img") public class Image extends HtmlContainer implements ClickNotifier<Image>
<img>
element.Constructor and Description |
---|
Image()
Creates a new empty image.
|
Image(AbstractStreamResource src,
String alt)
Creates an image with the given stream resource and an alternative text.
|
Image(String src,
String alt)
Creates an image with the given URL and an alternative text.
|
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getAlt()
Gets the alternate text for the image.
|
String |
getSrc()
Gets the image URL.
|
void |
setAlt(String alt)
Sets the alternate text for the image.
|
void |
setSrc(AbstractStreamResource src)
Sets the image URL with the URL of the given
StreamResource . |
void |
setSrc(String src)
Sets the image URL.
|
getTitle, setTitle
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClickListener, addClickShortcut
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
isEnabled, setEnabled
getElement
getCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
addAttachListener
addDetachListener
public Image()
public Image(String src, String alt)
src
- the image URLalt
- the alternate textsetSrc(String)
,
setAlt(String)
public Image(AbstractStreamResource src, String alt)
src
- the resource value, not nullalt
- the alternate textsetSrc(AbstractStreamResource)
,
setAlt(String)
public String getSrc()
public void setSrc(String src)
src
- the image URLpublic void setSrc(AbstractStreamResource src)
StreamResource
.src
- the resource value, not nullpublic void setAlt(String alt)
alt
- the alternate textCopyright © 2021. All rights reserved.