edu.washington.cs.supple.wlib.html
Class SimpleHtmlWidget

java.lang.Object
  extended byedu.washington.cs.supple.render.AbstractWidget
      extended byedu.washington.cs.supple.render.SimpleWidget
          extended byedu.washington.cs.supple.wlib.html.SimpleHtmlWidget
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, HtmlWidget, java.beans.PropertyChangeListener, UnwrappedWidget, Widget
Direct Known Subclasses:
AbstractHtmlRadioButtonWidget, CheckboxWidget, HtmlButtonWidget, HtmlListWidget, HtmlTextAreaWidget, HtmlTextFieldWidget, LabelWidget

public abstract class SimpleHtmlWidget
extends SimpleWidget
implements HtmlWidget

Author:
kgajos

Field Summary
 
Fields inherited from class edu.washington.cs.supple.render.AbstractWidget
bag, cost, engaged, object, parent, stateVar, textLabel, type, widgetDescriptor, wrapper
 
Fields inherited from interface edu.washington.cs.supple.render.Widget
MAX_HINT, NO_BORDER, NO_NAME, TOP_LEVEL_WIDGET
 
Constructor Summary
SimpleHtmlWidget(UiObject object)
           
 
Method Summary
 HtmlView doAction(java.lang.String name)
          This method is called when a user clicks an html button.
 ConcreteWidget getConcreteWidget(java.io.Serializable renderingContext, int hints)
          Returns the concrete component (specific to a particular platform)
 java.lang.String getHtmlId()
          Get the unique id used to identify this widget within an HTML document.
 java.awt.Dimension getSize(int hints)
          Returns the size of the widget as rendered with all of the hints specified in the parameter; uses caching wherever possible
 void setParameterValue(java.lang.String name, java.lang.String value)
          This method is called in response to a user changing widget values.
protected abstract  java.awt.Dimension size(int hints)
          Yields the size of the widget.
 
Methods inherited from class edu.washington.cs.supple.render.SimpleWidget
childIterator, getEffortEstimate, hasChildren
 
Methods inherited from class edu.washington.cs.supple.render.AbstractWidget
anotherPropertyChanged, clone, clone, disengage, dismissCurrentView, displayDynamic, engage, equals, executeAction, generateWidgetDescriptor, getBag, getConcreteWidget, getCost, getParent, getPath, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, getWidgetProperties, indexChanged, isEngaged, isEquivalent, legalValuesChanged, likelyValuesChanged, propertyChange, rendersObject, reportActionExecutionEvent, reportValueChangedEvent, setBag, setCost, setEnabled, setParent, setSizeCache, setValue, setWrapper, toString, unwrapWidget, valueChanged
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.washington.cs.supple.wlib.html.HtmlWidget
getHtmlComponent
 
Methods inherited from interface edu.washington.cs.supple.render.Widget
childIterator, clone, clone, disengage, engage, getBag, getConcreteWidget, getCost, getEffortEstimate, getPath, getSizeCache, getTextLabel, getType, getUiObject, getWidgetDescriptor, getWidgetProperties, hasChildren, isEngaged, isEquivalent, setBag, setCost, setEnabled, setParent, setSizeCache, setWrapper, unwrapWidget
 

Constructor Detail

SimpleHtmlWidget

public SimpleHtmlWidget(UiObject object)
Parameters:
object -
Method Detail

getHtmlId

public java.lang.String getHtmlId()
Description copied from interface: HtmlWidget
Get the unique id used to identify this widget within an HTML document.

Specified by:
getHtmlId in interface HtmlWidget

getConcreteWidget

public ConcreteWidget getConcreteWidget(java.io.Serializable renderingContext,
                                        int hints)
Description copied from interface: Widget
Returns the concrete component (specific to a particular platform)

Specified by:
getConcreteWidget in interface Widget
Overrides:
getConcreteWidget in class AbstractWidget

getSize

public java.awt.Dimension getSize(int hints)
Returns the size of the widget as rendered with all of the hints specified in the parameter; uses caching wherever possible

Specified by:
getSize in interface Widget
Overrides:
getSize in class AbstractWidget

size

protected abstract java.awt.Dimension size(int hints)
Yields the size of the widget. Contract stipulates that the size be recomputed, and not taken from the size cache.

Parameters:
hints -
Returns:
freshly computed size of the widget

doAction

public HtmlView doAction(java.lang.String name)
                  throws java.lang.IllegalArgumentException
Description copied from interface: HtmlWidget
This method is called when a user clicks an html button.

Specified by:
doAction in interface HtmlWidget
Returns:
returns the new view associated with the given action, or null (if no view was created)
Throws:
java.lang.IllegalArgumentException

setParameterValue

public void setParameterValue(java.lang.String name,
                              java.lang.String value)
                       throws java.lang.IllegalArgumentException
Description copied from interface: HtmlWidget
This method is called in response to a user changing widget values.

Specified by:
setParameterValue in interface HtmlWidget
Parameters:
name - Name of the parameter
value - the value passed back
Throws:
java.lang.IllegalArgumentException - thrown if the value could not be accepted for some reason