All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.forms.FormCardResource

java.lang.Object
   |
   +----w3c.tools.store.AttributeHolder
           |
           +----w3c.tools.store.Resource
                   |
                   +----w3c.jigsaw.resources.HTTPResource
                           |
                           +----w3c.jigsaw.resources.FilteredResource
                                   |
                                   +----w3c.jigsaw.resources.FileResource
                                           |
                                           +----w3c.jigsaw.forms.PostableResource
                                                   |
                                                   +----w3c.jigsaw.forms.FormCardResource

public class FormCardResource
extends PostableResource

Constructor Index

 o FormCardResource(FormResource, FormCardHandler, String, String)
Create a new form card.

Method Index

 o addButton(String)
Add a new button.
 o addField(FormFieldInterface)
Add a new field to this form.
 o delete()
Mark this card as removed.
 o dump(HtmlGenerator)
Dump this card into the given HtmlGenerator.
 o get(Request)
Get this form card entity.
 o getName()
Get this card name.
 o getTitle()
Get this card title.
 o handle(Request, URLDecoder)
Handle a post to this card.
 o isDeleted()
Is this card deleted ?
 o lookup(LookupState, LookupResult)
Our own lookup, to implement multiple buttons:
 o lookupField(String)
Lookup a field in this card.
 o removeField(String)
remove the field whose name is given.
 o rename(String)
 o reset()
Reset this form card.
 o setOkLabel(String)
Set the Ok button label.
 o setResetLabel(String)
Set the reset button label.
 o updateField(String, String)
Update the field whose name is given, with the provided value.

Constructors

 o FormCardResource
 protected FormCardResource(FormResource form,
                            FormCardHandler handler,
                            String name,
                            String title)
Create a new form card. Users of the package should create new form cards through the form object itself.

Parameters:
form - The form we are attached to.
handler - This card form handler.
name - This card's name,
title - The card displayed title.

Methods

 o delete
 public synchronized void delete()
Mark this card as removed.

Overrides:
delete in class HTTPResource
 o isDeleted
 public synchronized boolean isDeleted()
Is this card deleted ?

 o setOkLabel
 public void setOkLabel(String label)
Set the Ok button label.

Parameters:
label - The label to use for the commit button.
 o setResetLabel
 public void setResetLabel(String label)
Set the reset button label.

Parameters:
label - The label to use for the reset button.
 o lookup
 public boolean lookup(LookupState ls,
                       LookupResult lr) throws HTTPException
Our own lookup, to implement multiple buttons:

Overrides:
lookup in class FilteredResource
 o getName
 public String getName()
Get this card name.

 o rename
 public void rename(String name)
 o getTitle
 public String getTitle()
Get this card title.

Overrides:
getTitle in class HTTPResource
 o dump
 protected void dump(HtmlGenerator g)
Dump this card into the given HtmlGenerator.

Parameters:
into - The HtmlGenerator to dump ourself into.
 o addField
 public void addField(FormFieldInterface field)
Add a new field to this form.

Parameters:
field - The field to add.
 o addButton
 public void addButton(String label)
Add a new button. Button click are simulated, the form handler will get notified of them through the notifyButtonClick callback.

Parameters:
label - The button name.
 o removeField
 public void removeField(String name)
remove the field whose name is given.

Parameters:
name - The name of the field to remove.
 o reset
 public void reset()
Reset this form card. Remove all the fields and all the buttons defined for this card.

 o lookupField
 public FormFieldInterface lookupField(String name)
Lookup a field in this card.

Parameters:
name - The name of the field to look for.
Returns:
An instance of FormFieldInterface or null if none was found.
 o updateField
 protected void updateField(String name,
                            String value) throws FormFieldException
Update the field whose name is given, with the provided value.

Parameters:
name - The field name.
value - The new value for this field.
Throws: HTTPException
If the field couldn't be set.
 o get
 public Reply get(Request request) throws HTTPException
Get this form card entity. This dumps the whole form (including the card button controlers).

Parameters:
request - The request to handle.
Returns:
A Reply instance.
Throws: HTTPException
If the request couldn't be handled.
Overrides:
get in class PostableResource
 o handle
 public synchronized Reply handle(Request request,
                                  URLDecoder data) throws HTTPException
Handle a post to this card. This method is synchronized so that only one thread of control executes the sequence of notifyBeginProcessing, notifyEndProcessing and notifyChange.

Parameters:
client - The clien tthat issued the request.
request - The request to fullfill.
data - The form data.
Throws: HTTPException
If the form processing erred.
Overrides:
handle in class PostableResource

All Packages  Class Hierarchy  This Package  Previous  Next  Index