Class EmbeddedImageHandle
- java.lang.Object
-
- org.eclipse.birt.report.model.api.ElementDetailHandle
-
- org.eclipse.birt.report.model.api.ValueHandle
-
- org.eclipse.birt.report.model.api.StructureHandle
-
- org.eclipse.birt.report.model.api.EmbeddedImageHandle
-
public class EmbeddedImageHandle extends StructureHandle
Represents the handle of an embedded image. The class gives the name and type of the image. Used when an image elementImageItem
gives a name. Each embedded image has the following properties:- Name
- an embedded image has a unique and required name, so the image item can use the image name to identify an embedded image.
- Type
- an embedded image has a choice and required type: bmp, gif, png or x-png.
- Data
- value of the image data in Base64 encoding.
-
-
Field Summary
-
Fields inherited from class org.eclipse.birt.report.model.api.StructureHandle
structContext
-
Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
elementHandle
-
-
Constructor Summary
Constructors Constructor Description EmbeddedImageHandle(SimpleValueHandle valueHandle, int index)
Constructs the handle of embedded image.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getData()
Returns the byte array of image data.java.lang.String
getName()
Returns the embedded image name.java.lang.String
getQualifiedName()
Returns the qualified name of this element.java.lang.String
getType()
Returns the image type.boolean
isLibReference()
Checks whetherEmbeddedImage
has reference to library embedded image.void
setData(byte[] data)
Sets the byte array of image data.void
setName(java.lang.String name)
Sets the embedded image name.void
setType(java.lang.String type)
Sets the image type.-
Methods inherited from class org.eclipse.birt.report.model.api.StructureHandle
drop, getContext, getDefn, getExpressionProperty, getExternalizedValue, getExternalizedValue, getIntProperty, getMember, getProperty, getPropertyDefn, getStringProperty, getStructure, isDesignTime, isLocal, iterator, setDesignTime, setExpressionProperty, setProperty, setPropertySilently
-
Methods inherited from class org.eclipse.birt.report.model.api.ValueHandle
getReference
-
Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
getDesign, getElement, getElementHandle, getModule
-
-
-
-
Constructor Detail
-
EmbeddedImageHandle
public EmbeddedImageHandle(SimpleValueHandle valueHandle, int index)
Constructs the handle of embedded image.- Parameters:
valueHandle
- the value handle for embedded image list of one propertyindex
- the position of this embedded image in the list
-
-
Method Detail
-
getData
public byte[] getData()
Returns the byte array of image data.- Returns:
- the byte array of image data
-
setData
public void setData(byte[] data)
Sets the byte array of image data.- Parameters:
data
- the byte array to set
-
getName
public java.lang.String getName()
Returns the embedded image name. This name is used to identify an embedded image by image item.- Returns:
- the embedded image name
-
setName
public void setName(java.lang.String name) throws SemanticException
Sets the embedded image name. This name is used to identify an embedded image by image item.- Parameters:
name
- the embedded image name to set- Throws:
SemanticException
- value required exception
-
getType
public java.lang.String getType()
Returns the image type. The possible values are defined inDesignChoiceConstants
, and they are:IMAGE_TYPE_IMAGE_JPEG
IMAGE_TYPE_IMAGE_BMP
IMAGE_TYPE_IMAGE_GIF
IMAGE_TYPE_IMAGE_PNG
IMAGE_TYPE_IMAGE_X_PNG
- Returns:
- the image type
-
setType
public void setType(java.lang.String type) throws SemanticException
Sets the image type. The allowed values are defined inDesignChoiceConstants
, and they are:IMAGE_TYPE_IMAGE_JPEG
IMAGE_TYPE_IMAGE_BMP
IMAGE_TYPE_IMAGE_GIF
IMAGE_TYPE_IMAGE_PNG
IMAGE_TYPE_IMAGE_X_PNG
- Parameters:
type
- the image type to set- Throws:
SemanticException
- if the image type is not in the choice list.
-
getQualifiedName
public java.lang.String getQualifiedName()
Returns the qualified name of this element. The qualified name is the name of this element if this element is in module user is editing.- Returns:
- the qualified name of thie element.
-
isLibReference
public boolean isLibReference()
Checks whetherEmbeddedImage
has reference to library embedded image.- Returns:
- if
EmbeddedImage
has reference to library image and the reference is resolved returntrue
else returnfalse
-
-