@Tag(value="img") public class Image extends HtmlContainer
<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, setTitleaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, addComponentAsFirst, addComponentAtIndex, remove, removeAllisEnabled, setEnabledgetElementgetHeight, getWidth, setHeight, setSizeFull, setSizeUndefined, setWidthaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameaddAttachListeneraddDetachListenerpublic 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 © 2018. All rights reserved.