public class Image extends AbstractComponent
ACTIVE, browserMode, DEFAULT, ID, IE, INVISIBLE, isSensitive, label, NS, ON_BLUR, ON_CHANGE, ON_CLICK, ON_DBLCLICK, ON_FOCUS, ON_KEY_DOWN, ON_KEY_PRESS, ON_KEY_UP, ON_LOAD, ON_MOUSE_DOWN, ON_MOUSE_MOVE, ON_MOUSE_OUT, ON_MOUSE_UP, ON_RESET, ON_SELECT, ON_SUBMIT, ON_UNLOAD, parent, parentElem, READONLY, root, viewMode
LABELLEDBY
Constructor and Description |
---|
Image()
Constructs a new empty image.
|
Image(String src)
Constructor with image url
|
Image(String src,
String alt)
Constructor with image url
|
Image(String name,
String src,
int width,
int height,
String alt)
Constructor with image url
|
Image(String src,
String alt,
String styleClass)
Constructor with image url
|
Modifier and Type | Method and Description |
---|---|
String |
getAltText() |
int |
getBorder() |
Object |
getContent() |
int |
getHeight() |
String |
getSource() |
String |
getText() |
int |
getWidth() |
void |
setAltText(String alt)
sets the alternative text - attribute "title"
if image is rendered this text is the tooltip text
else it is the alternative text instead of the image
|
void |
setBorder(int border)
sets the thickness of the border around the displayed image
|
void |
setContent(Object o)
sets the content of the component
|
void |
setSize(int width,
int height)
sets the size of the image
|
void |
setSource(String src)
sets the source of the image
|
void |
setText(String text)
sets the text
|
addClass, clone, create, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, init, removeAttribute, removeClass, setActionListener, setAttribute, setBrowserMode, setClass, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setName, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toggleClass, toString
public Image()
public Image(String src)
src
- the image urlpublic Image(String src, String alt)
src
- the image urlalt
- the alternative textpublic Image(String src, String alt, String styleClass)
src
- the image urlalt
- the alternative textstyleClass
- the name of a CSS classpublic void setSize(int width, int height)
width
- - the width of the imageheight
- - the height of the imagepublic int getWidth()
public int getHeight()
public void setAltText(String alt)
alt
- - the alternative textpublic String getAltText()
public void setSource(String src)
src
- - the sourcepath of the image filepublic String getSource()
public void setBorder(int border)
border
- - the thickness of the borderpublic int getBorder()
public void setText(String text)
text
- - the text Stringpublic String getText()
public void setContent(Object o)
setContent
in interface Component
setContent
in class AbstractComponent
o
- any object where the string representation is used for renderingpublic Object getContent()
getContent
in interface Component
getContent
in class AbstractComponent
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.