uk.co.weft.amazon
Class AmazonWidget
java.lang.Object
uk.co.weft.htform.ResourceConsumerImpl
uk.co.weft.domutil.NodeGeneratorImpl
uk.co.weft.htform.Widget
uk.co.weft.htform.MenuWidget
uk.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
| 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 |
|
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.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 java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
amazon
protected AmazonDescriptor amazon
- The Amazon Descriptor from which I shall fetch options
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 nameprompt - My prompthelp - My help textamazon - The descriptor though which I shall communicate with
Amazon
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 contexttabIndex - 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