jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.amazon
Class AmazonWidget

java.lang.Object
  extended byuk.co.weft.htform.ResourceConsumerImpl
      extended byuk.co.weft.domutil.NodeGeneratorImpl
          extended byuk.co.weft.htform.Widget
              extended byuk.co.weft.htform.MenuWidget
                  extended byuk.co.weft.amazon.AmazonWidget
All Implemented Interfaces:
java.lang.Cloneable, NodeGenerator, ResourceConsumer

public class AmazonWidget
extends MenuWidget

A widget which links to a thing-to-buy at Amazon


Field Summary
protected  AmazonDescriptor amazon
          The Amazon Descriptor from which I shall fetch options
 
Fields inherited from class uk.co.weft.htform.MenuWidget
defaultSize, eltTag, unsetLabel, UNSETVALUEMAGICTOKEN
 
Fields inherited from class uk.co.weft.htform.Widget
ACTIONCSSCLASS, akprompt, attrs, CONTEXTATTRIBUTESSUFFIX, cssClass, DANGEROUSCSSCLASS, debug, DEFAULTTOKEN, dflt, form, generateAs, GENERATEASHTML, GENERATEASXFORM, GENERATEASXML, help, HELPTOKEN, immutable, ISIMMUTABLETOKEN, ISMANDATORYTOKEN, mandatory, MANDATORYCSSCLASS, maxVisibleSize, name, NAMETOKEN, OPTIONALCSSCLASS, PREVIOUSVALUESUFFIX, prompt, PROMPTTOKEN, size, SIZETOKEN, type, TYPETOKEN
 
Fields inherited from class uk.co.weft.domutil.NodeGeneratorImpl
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
AmazonWidget(java.lang.String name, java.lang.String prompt, java.lang.String help, AmazonDescriptor amazon)
          Creates a new AmazonWidget object.
 
Method Summary
 java.util.Vector getOptions(Context context)
          Specialisation: collect my options from Amazon
 int getTabPlaces(Context context)
          Specialisation: I need two more tab places than my superclass
 void init(Context config)
          Specialisation: set up my Amazon descriptor
 void layout(Context context, int tabIndex)
          Specialisation: layout subwidgets for author and title
protected  void layoutValue(Context context)
          Layout just my value on this output stream
 
Methods inherited from class uk.co.weft.htform.MenuWidget
addOption, clone, generateInnerHTML, generateValue, getHeight, getWidth, preProcess, scriptRequest, setDebug
 
Methods inherited from class uk.co.weft.htform.Widget
generate, generateAttributes, generateAttributes, generateHTML, generateHTMLPrompt, generateXML, getContextAttribute, getCssClass, getHelp, getName, getPrompt, getType, layout, layout, layout, layoutAttribute, layoutAttributes, makeReady, maybeLayout, maybeLayout, onloadRequest, onloadRequest, postProcess, scriptRequest, setAttribute, setContextAttribute, setCssClass, setDefault, setHelp, setImmutable, setMandatory, setMandatory, setName, setPrompt, setSize, setType
 
Methods inherited from class uk.co.weft.domutil.NodeGeneratorImpl
getNamespaceURI, setNamespaceURI
 
Methods inherited from class uk.co.weft.htform.ResourceConsumerImpl
getContextOrResource, getResource, getResourceOrContext, getResourceString, grs, grs
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.co.weft.domutil.NodeGenerator
generate, getName, getNamespaceURI
 

Field Detail

amazon

protected AmazonDescriptor amazon
The Amazon Descriptor from which I shall fetch options

Constructor Detail

AmazonWidget

public AmazonWidget(java.lang.String name,
                    java.lang.String prompt,
                    java.lang.String help,
                    AmazonDescriptor amazon)
Creates a new AmazonWidget object.

Parameters:
name - My name
prompt - My prompt
help - My help text
amazon - The descriptor though which I shall communicate with Amazon
Method Detail

getOptions

public java.util.Vector getOptions(Context context)
                            throws javax.servlet.ServletException
Specialisation: collect my options from Amazon

Overrides:
getOptions in class MenuWidget
Parameters:
context -
Returns:
Throws:
javax.servlet.ServletException
See Also:
MenuWidget.getOptions(uk.co.weft.dbutil.Context)

getTabPlaces

public int getTabPlaces(Context context)
Specialisation: I need two more tab places than my superclass

Overrides:
getTabPlaces in class MenuWidget
Parameters:
context - the context in which I am being laid out
Returns:
the number of tab places I need
See Also:
MenuWidget.getTabPlaces(uk.co.weft.dbutil.Context)

init

public void init(Context config)
          throws InitialisationException
Specialisation: set up my Amazon descriptor

Specified by:
init in interface NodeGenerator
Overrides:
init in class Widget
Parameters:
config - my configuration
Throws:
InitialisationException
See Also:
Widget.init(uk.co.weft.dbutil.Context)

layout

public void layout(Context context,
                   int tabIndex)
            throws DataFormatException,
                   javax.servlet.ServletException,
                   java.io.IOException
Specialisation: layout subwidgets for author and title

Overrides:
layout in class MenuWidget
Parameters:
context - the service context
tabIndex - the base index from which my tab index should be counted
Throws:
DataStoreException
javax.servlet.ServletException
java.io.IOException
DataFormatException
See Also:
Widget.layout(uk.co.weft.dbutil.Context, int)

layoutValue

protected void layoutValue(Context context)
                    throws DataFormatException,
                           javax.servlet.ServletException,
                           java.io.IOException
Layout just my value on this output stream

Overrides:
layoutValue in class MenuWidget
Throws:
DataFormatException
javax.servlet.ServletException
java.io.IOException

jacquard 1.12.0 by The Web Engineering Factory and Toolworks