com.pow2.webgui
Class WidgetFactory

java.lang.Object
  extended by com.pow2.webgui.WidgetFactory

public class WidgetFactory
extends Object

Widget Factory class.

Author:
Luca Fossato

Method Summary
 boolean containsWidgetInfo(String key)
          Test if the WidgetFactory hashmap contains the WidgetInfo object having the input key.
 Widget getWidget(String key)
          Get a Widget object.
static WidgetFactory instance()
          Get the instance of WidgetFactory class.
 void removeWidgetInfo(String key)
          Remove the widgetInfo object having the input key from the WidgetFactory hashmap.
 void setWidgets(String propsFile)
          Register all the widget prototypes declared into the input properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static WidgetFactory instance()
Get the instance of WidgetFactory class.

Returns:
the instance of WidgetFactory class

containsWidgetInfo

public boolean containsWidgetInfo(String key)
Test if the WidgetFactory hashmap contains the WidgetInfo object having the input key.

Parameters:
key - the widgetInfo key
Returns:
true if the widget map contains the widgetInfo object having the input key; false otherwise

removeWidgetInfo

public void removeWidgetInfo(String key)
Remove the widgetInfo object having the input key from the WidgetFactory hashmap.

Parameters:
key - the prototype key.

getWidget

public Widget getWidget(String key)
                 throws Exception
Get a Widget object.

Parameters:
key - the key used to retrieve an instance of the registered widget from the factory hashmap
Returns:
the Widget object
Throws:
Exception - if any error occurs

setWidgets

public void setWidgets(String propsFile)
                throws Exception
Register all the widget prototypes declared into the input properties file.

Parameters:
propsFile - The new prototypes value
Throws:
Exception - if any error occurs


Copyright © 2002-2005 Power Of Two S.r.l. All Rights Reserved.