jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.xhtmlgen
Class ImgListItemGenerator

java.lang.Object
  extended byuk.co.weft.htform.ResourceConsumerImpl
      extended byuk.co.weft.domutil.NodeGeneratorImpl
          extended byuk.co.weft.domutil.MaybeParseGenerator
              extended byuk.co.weft.domutil.ElementGenerator
                  extended byuk.co.weft.xhtmlgen.WithSettableThumbPrefixImpl
                      extended byuk.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.
 
Fields inherited from class uk.co.weft.xhtmlgen.WithSettableThumbPrefixImpl
setThumbPrefixChildren, thumbPrefix
 
Fields inherited from class uk.co.weft.domutil.ElementGenerator
childrenAndContent, generators, keyname, mapping, storename, token
 
Fields inherited from class uk.co.weft.domutil.MaybeParseGenerator
embeddedMarkup
 
Fields inherited from class uk.co.weft.domutil.NodeGeneratorImpl
debug, name, namespaceURI
 
Fields inherited from class uk.co.weft.htform.ResourceConsumerImpl
resourceBundleName
 
Fields inherited from interface uk.co.weft.domutil.NodeGenerator
NAMESPACEURIMAGICTOKEN
 
Fields inherited from interface uk.co.weft.htform.ResourceConsumer
RESOURCEBUNDLEMAGICTOKEN
 
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.
 
Method Summary
 Node generate(Document doc, Context context)
          generate a node (necessarily a li) representing one item in the list.
 
Methods inherited from class uk.co.weft.xhtmlgen.WithSettableThumbPrefixImpl
addThumbPrefixChild, setThumbPrefix
 
Methods inherited from class uk.co.weft.domutil.ElementGenerator
addGenerator, doinit, fetchDetail, generate, generate, getTokenValue, init, register, setChildrenAndContent
 
Methods inherited from class uk.co.weft.domutil.MaybeParseGenerator
allowEmbeddedMarkup, maybeParse
 
Methods inherited from class uk.co.weft.domutil.NodeGeneratorImpl
getName, getNamespaceURI, setDebug, setNamespaceURI
 
Methods inherited from class uk.co.weft.htform.ResourceConsumerImpl
getContextOrResource, getResource, getResourceOrContext, getResourceString, grs, grs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.co.weft.domutil.NodeGenerator
getName, getNamespaceURI, setDebug
 

Field Detail

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.

Constructor Detail

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.
Method Detail

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

jacquard 1.12.0 by The Web Engineering Factory and Toolworks