edu.washington.cs.supple.wlib
Class AbstractWidgetFactory

java.lang.Object
  extended byedu.washington.cs.supple.wlib.AbstractWidgetFactory
All Implemented Interfaces:
java.io.Serializable, WidgetFactory
Direct Known Subclasses:
DesktopWidgetFactory, DesktopWidgetFactory, HtmlWidgetFactory, OriginalWidgetFactory, ShortcutExperimentWidgetFactory, TestWidgetFactory, TouchWidgetFactory, WapWidgetFactory

public abstract class AbstractWidgetFactory
extends java.lang.Object
implements WidgetFactory, java.io.Serializable

AbstractWidgetFactory provides a base for building widget factories...

Author:
dbc1
See Also:
Serialized Form

Constructor Summary
AbstractWidgetFactory()
           
 
Method Summary
 Widget getWidget(UiObject uiObject, WidgetDescriptor descriptor)
          Create a widget from a widget descriptor.
protected  Widget wrapWidget(Widget w)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.washington.cs.supple.render.WidgetFactory
getWidgets
 

Constructor Detail

AbstractWidgetFactory

public AbstractWidgetFactory()
Method Detail

wrapWidget

protected Widget wrapWidget(Widget w)

getWidget

public Widget getWidget(UiObject uiObject,
                        WidgetDescriptor descriptor)
                 throws java.lang.Exception
Create a widget from a widget descriptor. This default implementation uses reflection to find an appropriate constructor: if the widget descriptor has no properties it will look for a constructor for the descriptor's widget class that takes a UiObject. Otherwise it will look for one that takes UiObject, WidgetDescriptor, and WidgetFactory.

Specified by:
getWidget in interface WidgetFactory
Throws:
java.lang.Exception