Interface IImage
- All Superinterfaces:
IDesignElement,IReportElement,IReportItem
Represents a the design of an Image in the scripting environment
-
Field Summary
Fields inherited from interface org.eclipse.birt.report.engine.api.script.element.IReportItem
constants -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the action structure to this data item.Returns a handle to work with the action property, action is a structure that defines a hyperlink.Returns the alternate text of this image.Returns the resource key of the alternate text of this image.getFile()Returns the image file, if the source type is notIMAGE_REF_TYPE_FILEreturn null.Returns the help text of this image item.Returns the resource key of the help text of this image item.Returns the embedded image name that this image refers, if the image source type isIMAGE_REF_TYPE_EMBED.doublegetScale()Returns the image scale.getSize()Returns the image size.Returns the image source type.Returns the type expression of the image item if the image source type isIMAGE_REF_TYPE_EXPR.getURI()Returns the image URI if the image source type isIMAGE_REF_TYPE_URLorIMAGE_REF_TYPE_FILE.getURL()Gets the image url, if the source type is notIMAGE_REF_TYPE_URLreturn null.Returns the value expression of the image if the image source type isIMAGE_REF_TYPE_EXPR.voidsetAltText(String altText) Sets the alternate text of this image.voidsetAltTextKey(String altTextKey) Sets the resource key of the alternate text of this image.voidSets the image file.voidsetHelpText(String helpText) Sets the help text of this image item.voidsetHelpTextKey(String helpTextKey) Sets the resource key of help text of this image item.voidsetImageName(String name) Sets the embedded image name that this image refers, if the image source type isIMAGE_REF_TYPE_EMBED.voidsetScale(double scale) Sets the image scale property.voidSets the image size property.voidReturns the image source type.voidsetTypeExpression(String value) Sets the type expression value.voidDeprecated.Sets the image uri property.voidSets the image url.voidsetValueExpression(String value) Sets the value expression value.Methods inherited from interface org.eclipse.birt.report.engine.api.script.element.IDesignElement
getNamedExpression, getParent, getQualifiedName, getReport, getStyle, getUserProperty, getUserPropertyExpression, setNamedExpression, setUserProperty, setUserPropertyMethods inherited from interface org.eclipse.birt.report.engine.api.script.element.IReportElement
getComments, getCustomXml, getDisplayName, getDisplayNameKey, getName, setComments, setCustomXml, setDisplayName, setDisplayNameKey, setNameMethods inherited from interface org.eclipse.birt.report.engine.api.script.element.IReportItem
addDataBinding, addHideRule, addHighlightRule, getBookmark, getDataBinding, getDataBindings, getHeight, getHideRules, getHighlightRules, getTocExpression, getWidth, getX, getY, removeDataBinding, removeDataBindings, removeHideRule, removeHideRules, removeHighlightRule, removeHighlightRules, setBookmark, setCurrentView, setHeight, setHeight, setTocExpression, setWidth, setWidth, setX, setX, setY, setY
-
Method Details
-
getScale
double getScale()Returns the image scale. The scale factor for the image given as a percentage.- Returns:
- the scale of this image.
-
getSize
String getSize()Returns the image size. The size must be the internal name that is one the following options defined inDesignChoiceConstants:IMAGE_SIZE_SIZE_TO_IMAGEIMAGE_SIZE_SCALE_TO_ITEMIMAGE_SIZE_CLIP
- Returns:
- the internal value of the image size.
-
getAltText
String getAltText()Returns the alternate text of this image.- Returns:
- the alternate text of the image item.
-
setAltText
Sets the alternate text of this image.- Parameters:
altText- the alternate text- Throws:
ScriptException
-
getAltTextKey
String getAltTextKey()Returns the resource key of the alternate text of this image.- Returns:
- the resource key of the alternate text
-
setAltTextKey
Sets the resource key of the alternate text of this image.- Parameters:
altTextKey- the resource key of the alternate text- Throws:
ScriptException
-
getSource
String getSource()Returns the image source type. This is one of the following options defined inDesignChoiceConstants:IMAGE_REF_TYPE_NONEIMAGE_REF_TYPE_URLIMAGE_REF_TYPE_FILEIMAGE_REF_TYPE_EXPRIMAGE_REF_TYPE_EMBED
- Returns:
- the image source type.
-
setSource
Returns the image source type. This is one of the following options defined inDesignChoiceConstants:IMAGE_REF_TYPE_NONEIMAGE_REF_TYPE_URLIMAGE_REF_TYPE_FILEIMAGE_REF_TYPE_EXPRIMAGE_REF_TYPE_EMBED
- Parameters:
source- the image source type.- Throws:
ScriptException- if thesourceis not one of the above.
-
getURI
String getURI()Returns the image URI if the image source type isIMAGE_REF_TYPE_URLorIMAGE_REF_TYPE_FILE.- Returns:
- the image URI if the image source type is
IMAGE_REF_TYPE_URLorIMAGE_REF_TYPE_FILE. Otherwise, returnnull.
-
getTypeExpression
String getTypeExpression()Returns the type expression of the image item if the image source type isIMAGE_REF_TYPE_EXPR.- Returns:
- the type expression, if the image source type is
IMAGE_REF_TYPE_EXPR. Otherwise, returnnull.
-
getValueExpression
String getValueExpression()Returns the value expression of the image if the image source type isIMAGE_REF_TYPE_EXPR.- Returns:
- the value expression, if the image source type is
IMAGE_REF_TYPE_EXPR. Otherwise, returnnull.
-
getImageName
String getImageName()Returns the embedded image name that this image refers, if the image source type isIMAGE_REF_TYPE_EMBED. This is not the same asDesignElementHandle.getName()of this image item.- Returns:
- the embedded image name, if the image source type is
IMAGE_REF_TYPE_EMBED. Otherwise, returnnull.
-
setImageName
Sets the embedded image name that this image refers, if the image source type isIMAGE_REF_TYPE_EMBED. The reference type is automatically set in this method. This is not the same asDesignElementHandle.setName(String).- Parameters:
name- the embedded image name- Throws:
ScriptException- if the property is locked.
-
setURI
Deprecated.Sets the image uri property. The source type is automatically set in this method. WhetherIMAGE_REF_TYPE_FILEorIMAGE_REF_TYPE_URLdepends on the uri to set.- Parameters:
uri- the uri to be set.- Throws:
ScriptException- if the property is locked.
-
setScale
Sets the image scale property. The scale factor for the image given as a percentage. The default is 100%.- Parameters:
scale- the scale value to be set.- Throws:
ScriptException- if the property is locked.
-
setSize
Sets the image size property. The input value is one of the followings defined inDesignChoiceConstants:IMAGE_SIZE_SIZE_TO_IMAGEIMAGE_SIZE_SCALE_TO_ITEMIMAGE_SIZE_CLIP
- Parameters:
size- the size value to be set.- Throws:
ScriptException- if the input size is not one of the above, or if the property is locked.
-
setTypeExpression
Sets the type expression value. The source type is automatically set toIMAGE_REF_TYPE_EXPR.- Parameters:
value- the type expression value.- Throws:
ScriptException- if the property is locked.
-
setValueExpression
Sets the value expression value. The source type is automatically set toIMAGE_REF_TYPE_EXPR.- Parameters:
value- the value expression.- Throws:
ScriptException- if the property is locked.
-
getAction
IAction getAction()Returns a handle to work with the action property, action is a structure that defines a hyperlink.- Returns:
- a handle to the action property, return
nullif the action has not been set on the image. - See Also:
-
ActionHandle
-
getHelpText
String getHelpText()Returns the help text of this image item.- Returns:
- the help text
-
setHelpText
Sets the help text of this image item.- Parameters:
helpText- the help text- Throws:
ScriptException- if the property is locked.
-
getHelpTextKey
String getHelpTextKey()Returns the resource key of the help text of this image item.- Returns:
- the resource key of the help text
-
setHelpTextKey
Sets the resource key of help text of this image item.- Parameters:
helpTextKey- the help text- Throws:
ScriptException- if the property is locked.
-
setURL
Sets the image url. The source type isIMAGE_REF_TYPE_URL, and will automatically set in this method.- Parameters:
url-- Throws:
ScriptException
-
getURL
String getURL()Gets the image url, if the source type is notIMAGE_REF_TYPE_URLreturn null.- Returns:
- image url.
-
setFile
Sets the image file. The source type isIMAGE_REF_TYPE_FILE, and will automatically set in this method.- Parameters:
file-- Throws:
ScriptException
-
getFile
String getFile()Returns the image file, if the source type is notIMAGE_REF_TYPE_FILEreturn null.- Returns:
- image file.
-
addAction
Adds the action structure to this data item.- Parameters:
action- action structure
-