uk.co.weft.xhtmlgen
Class ImgListItemGenerator
java.lang.Object
uk.co.weft.htform.ResourceConsumerImpl
uk.co.weft.domutil.NodeGeneratorImpl
uk.co.weft.domutil.MaybeParseGenerator
uk.co.weft.domutil.ElementGenerator
uk.co.weft.xhtmlgen.WithSettableThumbPrefixImpl
uk.co.weft.xhtmlgen.ImgListItemGenerator
- All Implemented Interfaces:
- NodeGenerator, ResourceConsumer, WithSettableThumbPrefix
- public class ImgListItemGenerator
- extends WithSettableThumbPrefixImpl
A list item generator which generates an item whose content is an image.
- Version:
- $Revision: 1.7.4.1 $
- Author:
- $author$
|
Field Summary |
boolean |
withThumbs
whether or not I should add a thumbnail URL on the lowsrc attribute. |
|
Constructor Summary |
ImgListItemGenerator()
constructor for a image list item generator. |
ImgListItemGenerator(java.lang.String thumbPrefix)
constructor for an image list item generator which knows about
thumbnails. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
withThumbs
public boolean withThumbs
- whether or not I should add a thumbnail URL on the lowsrc attribute.
Bit of a hack, especially seeing lowsrc isn't officially there anyway.
Depends on there being thumbnails in the relative place indicated by
thumbPrefix.
ImgListItemGenerator
public ImgListItemGenerator()
- constructor for a image list item generator.
ImgListItemGenerator
public ImgListItemGenerator(java.lang.String thumbPrefix)
- constructor for an image list item generator which knows about
thumbnails.
- Parameters:
thumbPrefix - the thumbnail prefix to use.
generate
public Node generate(Document doc,
Context context)
throws GenerationException,
DOMException
- generate a node (necessarily a
li) representing one item
in the list. Separated out into a separate method for ease of
specialisation. This method constructs a node of the general form
<li><img src="childKey"
alt="childIdent"/></li>. Over-ride it if
your needs are different.
- Specified by:
generate in interface NodeGenerator- Overrides:
generate in class ElementGenerator
- Parameters:
doc - the document within which the node will be created.context - the service context
- Returns:
- a list item element, or null if none should be generated.
- Throws:
GenerationException - may throw a GenerationException if the
generation cannot be completed.
DOMException - will be passed through if Xerces barfs