public class Image extends ImageResource
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PN_IMAGE_MAP
name of the image map property
|
PN_ALT, PN_HEIGHT, PN_HTML_HEIGHT, PN_HTML_WIDTH, PN_IMAGE_CROP, PN_IMAGE_ROTATE, PN_LINK_URL, PN_MAX_HEIGHT, PN_MAX_WIDTH, PN_MIN_HEIGHT, PN_MIN_WIDTH, PN_WIDTHattrs, NN_FILE, node, PN_DESCRIPTION, PN_FILE_NAME, PN_REFERENCE, PN_TITLE, propertiesRESOURCE_TYPE_NON_EXISTING| Constructor and Description |
|---|
Image(Resource resource)
Creates a new image based on the given resource.
|
Image(Resource resource,
java.lang.String imageName)
Creates a new image based on the given resource.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canDraw()
checks if this image can be drawn.
|
protected void |
doDraw(java.io.PrintWriter w)
Writes this image as tag to the given writer by invoking the following
- calls
ImageResource.getImageTagAttributes()
- prints the link tag if needed
- prints the image tag
- prints the attributes
- closes the image tag
- closes the link tag |
java.lang.String |
getIconPath()
Returns a path to an icon representing the file.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getImageTagAttributes()
Collects the image tag attributes.
|
protected Resource |
getReferencedResource(java.lang.String path)
Returns the resource that is referenced by path.
|
boolean |
hasNoPlaceholder()
Returns the placeholder flag.
|
void |
loadStyleData(Style style)
Loads several definitions from style.
|
void |
setDropTargetId(java.lang.String id)
Sets the drop target id for this image, using the name of the resources
as path.
|
void |
setDropTargetId(java.lang.String id,
java.lang.String classifier)
Sets the drop target id for this image.
|
void |
setNoPlaceholder(boolean noPlaceholder)
Sets the placeholder flag.
|
crop, draw, getAlt, getCropRect, getDoctype, getExtension, getLayer, getRelativeResource, getRotation, getSrc, getTitle, resize, rotate, setAlt, setDoctype, setExtension, setSrcaddAttribute, addCssClass, addQueryParam, get, get, getAttributes, getData, getDescription, getDescription, getFileName, getFileNodePath, getFileReference, getHref, getIconType, getInnerHtml, getItemName, getLastModified, getMimeType, getQuery, getSelector, getString, getSuffix, getTitle, hasContent, init, set, setDescription, setFileName, setFileNodePath, setFileReference, setHref, setInnerHtml, setItemName, setQuery, setSelector, setSuffix, setTitleadaptTo, getChild, getChildren, getName, getParent, getPath, getResource, getResourceMetadata, getResourceResolver, getResourceSuperType, getResourceType, isResourceType, listChildren, toStringpublic static final java.lang.String PN_IMAGE_MAP
public Image(Resource resource)
resource - resource of the imagejava.lang.IllegalArgumentException - if the given resource is not adaptable to node.public Image(Resource resource, java.lang.String imageName)
imageName
is specified. then the respective child resource holds the image
properties.resource - current resourceimageName - name of the image resourcejava.lang.IllegalArgumentException - if the given resource is not adaptable to node.public void setDropTargetId(java.lang.String id,
java.lang.String classifier)
id - the drop target id as configured in edit config.classifier - optional classifierpublic void setDropTargetId(java.lang.String id)
id - the drop target id as configured in edit config.public boolean hasNoPlaceholder()
true if no placeholder for empty content should be
drawn.public void setNoPlaceholder(boolean noPlaceholder)
noPlaceholder - if true no placeholder for empty content
is used.public void loadStyleData(Style style)
Currently, the minimum/maximum width and height are transferred from the given style.
style - style to load definitions fromprotected boolean canDraw()
canDraw in class ImageResourcetrue if hasNoPlaceholder() is false
or the image has content.protected java.util.Map<java.lang.String,java.lang.String> getImageTagAttributes()
ImageResourcegetImageTagAttributes in class ImageResourceprotected void doDraw(java.io.PrintWriter w)
ImageResource.getImageTagAttributes()
- prints the link tag if needed
- prints the image tag
- prints the attributes
- closes the image tag
- closes the link tagdoDraw in class ImageResourcew - the writerpublic java.lang.String getIconPath()
getIconPath in class DownloadResourcenull.protected Resource getReferencedResource(java.lang.String path)
getReferencedResource in class DownloadResourcepath - path to the resource