|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectechopointng.ui.util.ImageManager
public class ImageManager
ImageManager is used to manage ImageReference
's within the EPNG code.
The base nextapp.echo2.webcontainer.image.ImageRenderSupport does not do a simple enough job of managing images as it uses a component based lookup in a callback to implement image serving.
This ImageManager class will allow URI's for images to be
generated as well as IMG HTML tag elements to be created without needing the
component as the lookup context.
All that is needed is the ImageReference itself.
And instance of this class can be used to store images against a logical name
via the setImage() and getImage() methods.
ImageManager implements RenderState and hence can be stored
against a given renderer per component.
| Nested Class Summary | |
|---|---|
static interface |
ImageManager.ImageReferenceURIHandler
|
| Constructor Summary | |
|---|---|
ImageManager()
Constructs a ImageManager |
|
| Method Summary | |
|---|---|
void |
addImage(ImageReference imageReference)
Adds the ImageReference to the ImageManager
via its renderId. |
static org.w3c.dom.Element |
createImgE(RenderContext rc,
CssStyle cssStyle,
ImageReference imageRef)
This will create an 'img' element for the specified ImageReference. |
static org.w3c.dom.Element |
createImgE(RenderContext rc,
ImageReference imageRef)
This will create an 'img' element for the specified ImageReference. |
static org.w3c.dom.Element |
createImgEFromProperty(RenderContext rc,
Component component,
java.lang.String propertyName)
|
static org.w3c.dom.Element |
createImgEFromProperty(RenderContext rc,
CssStyle cssStyle,
Component component,
java.lang.String propertyName)
Creates an IMG tag by using extracting the value of the named property from the component. |
static void |
deregisterURIHandler(ImageManager.ImageReferenceURIHandler handler)
Deregisters a ImageReferenceURIHandler from the static set
of handlers |
ImageReference |
getImage(java.lang.String imageId)
Returns an ImageReference from the
ImageManager by imageId |
static java.lang.String |
getURI(RenderContext rc,
Component component,
java.lang.String propertyName)
This returns the URI that can be used to serve up the specified property if its an ImageReference or FillImage value. |
static java.lang.String |
getURI(RenderContext rc,
ImageReference imageReference)
This returns the URI that can be used to serve up the specified ImageReference. |
static void |
registerURIHandler(ImageManager.ImageReferenceURIHandler handler)
Registers a ImageReferenceURIHandler to the static set of
handlers |
void |
removeAllImages()
Removes all ImageReferences from the
ImageManager |
void |
removeImage(ImageReference imageReference)
Removes the ImageReference from the
ImageManager via its renderId. |
void |
setImage(java.lang.String imageId,
ImageReference imageReference)
Stores an ImageReference into the
ImageManager using a given imageId. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageManager()
ImageManager
| Method Detail |
|---|
public static void registerURIHandler(ImageManager.ImageReferenceURIHandler handler)
ImageReferenceURIHandler to the static set of
handlers
handler - -
the handler to addpublic static void deregisterURIHandler(ImageManager.ImageReferenceURIHandler handler)
ImageReferenceURIHandler from the static set
of handlers
handler - -
the handler to deregister
public static java.lang.String getURI(RenderContext rc,
ImageReference imageReference)
rc - -
the RenderContext to useimageReference - -
the ImageReference in question
public static java.lang.String getURI(RenderContext rc,
Component component,
java.lang.String propertyName)
rc - the RenderContext to usecomponent - -
the component to look up render properties inpropertyName - -
the name of the property
public static org.w3c.dom.Element createImgE(RenderContext rc,
ImageReference imageRef)
This assumes that the image URI is based on the ImageReference.getRenderId().
rc - -
the RenderContext to useimageRef - -
the ImageReference in question. This must not be null.
public static org.w3c.dom.Element createImgE(RenderContext rc,
CssStyle cssStyle,
ImageReference imageRef)
This assumes that the image URI is based on the ImageReference.getRenderId().
If the CssStyle passsed in is non null, then it will be used to set extra 'img' tag styles such a "border:none;width:x;height:y". It will only set these properties if they are not already set in the style.
rc - -
the RenderContext to usecssStyle - -
a CssStyle to use on the 'img' tag. Can be nullimageRef - -
the ImageReference in question. This must not be null.
public static org.w3c.dom.Element createImgEFromProperty(RenderContext rc,
CssStyle cssStyle,
Component component,
java.lang.String propertyName)
rc - -
the RenderingContext to usecssStyle - -
the CssStyle to use if applicable.component - -
the component whose property will be looked uppropertyName - -
the name of the property
public static org.w3c.dom.Element createImgEFromProperty(RenderContext rc,
Component component,
java.lang.String propertyName)
createImgEFromProperty(RenderContext, CssStyle,
Component, String)
public void setImage(java.lang.String imageId,
ImageReference imageReference)
ImageReference into the
ImageManager using a given imageId.
imageId - -
the id to use to store the ImageReferenceimageReference - -
the ImageReference to storepublic ImageReference getImage(java.lang.String imageId)
ImageReference from the
ImageManager by imageId
imageId - -
the id used to store the ImageReference in the
ImageManager.
ImageReference or nullpublic void addImage(ImageReference imageReference)
ImageReference to the ImageManager
via its renderId.
imageReference - -
the ImageReference to add. If this is null then
nothing happens.public void removeImage(ImageReference imageReference)
ImageReference from the
ImageManager via its renderId.
imageReference - -
the ImageReference to removepublic void removeAllImages()
ImageReferences from the
ImageManager
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||