com.pow2.webgui
Class Widget

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.pow2.webgui.Widget
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
Lister, Tab, TabbedSelector, Window

public abstract class Widget
extends javax.servlet.jsp.tagext.BodyTagSupport

Abstract Widget class.
Extends also BodyTagSupport - in this manner every widget tag subclassing this class can access the basic widget properties.

Author:
Luca Fossato
See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Category cat
          Log4j category
protected  String color
          widget color (#rrggbb format)
protected  StringBuffer content
          widget content
protected  BaseContentProvider contentProvider
          content provider class
protected  String contentProviderName
          content provider name
protected  String drawer
          widget drawer key
protected  String followUp
          widget URI link
protected  String height
          widget height
protected  String id
          widget identifier
protected  String name
          widget name
protected  Widget parentW
          parent Widget.
protected  String title
          widget title
protected  String titleType
          title type; it can be: "text" (default) or "image".
protected  WidgetDrawer widgetDrawer
          widgetDrawer strategy instance
protected  WidgetInfo widgetInfo
          widgetInfo instance
protected  String width
          widget width
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
protected Widget()
          Default protected Constructor.
 
Method Summary
 StringBuffer draw()
          Gets the string representation of this widget.
 String getColor()
          Gets the color attribute of the Widget object
 StringBuffer getContent()
          Gets the content attribute of the Widget object
 BaseContentProvider getContentProvider()
          Gets the contentProvider attribute of the Widget object
 String getContentProviderName()
          Gets the contentProviderName attribute of the Widget object.
 String getDrawer()
          Gets the drawer attribute of the Widget object
 String getFollowUp()
          Gets the followUp attribute of the Widget object.
 String getHeight()
          Gets the height attribute of the Widget object
 String getId()
          Gets the id attribute of the Widget object
 String getName()
          Gets the name attribute of the Widget object
 Widget getParentW()
          Gets the parentW attribute of the Widget object
 String getTitle()
          Gets the title attribute of the Widget object
 String getTitleType()
          Gets the titleType attribute of the Window object
 WidgetDrawer getWidgetDrawer()
          Gets the widgetDrawer attribute of the Widget object
 WidgetInfo getWidgetInfo()
          Gets the widgetInfo attribute of the Widget object
 String getWidth()
          Gets the width attribute of the Widget object
 void setColor(String newColor)
          Sets the color attribute of the Widget object.
 void setContent(StringBuffer newContent)
          Sets the content attribute of the Widget object
 void setContentProvider(String contentProviderName)
          Sets the default contentProvider attribute.
 void setContentProviderName(String contentProviderName)
          Sets the contentProviderName attribute.
 void setDrawer(String newDrawer)
          Sets the drawer attribute of the Widget object
 void setFollowUp(String newFollowUp)
          Sets the followUp attribute of the Widget object.
 void setHeight(String height)
          Sets the height attribute of the Widget object
 void setId(String newId)
          Sets the id attribute of the Widget object
 void setName(String newName)
          Sets the name attribute of the Widget object
 void setParentW(Widget newParentW)
          Sets the parentW attribute of the Widget object
 void setTitle(String newTitle)
          Sets the title attribute of the Widget object
 void setTitleType(String newTitleType)
          Sets the titleType attribute of the Widget object
Supported types are: text image
 void setWidgetDrawer(String drawer)
          Sets the default widgetDrawer attribute, using the input drawer parameter value.
 void setWidgetInfo(WidgetInfo widgetInfo)
          Sets the widgetInfo attribute of the Widget object.
 void setWidth(String width)
          Sets the width attribute of the Widget object
 void updateAttributes(Widget w)
          Update this class attributes using the input Widget attributes values.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

cat

protected static org.apache.log4j.Category cat
Log4j category


color

protected String color
widget color (#rrggbb format)


content

protected StringBuffer content
widget content


contentProvider

protected BaseContentProvider contentProvider
content provider class


contentProviderName

protected String contentProviderName
content provider name


drawer

protected String drawer
widget drawer key


followUp

protected String followUp
widget URI link


height

protected String height
widget height


id

protected String id
widget identifier


name

protected String name
widget name


parentW

protected Widget parentW
parent Widget.
Why parentW and not parent ?
Note that parent attribute overrides the homonymous tag class attribute, generating an erroneous behaviour.


title

protected String title
widget title


titleType

protected String titleType
title type; it can be: "text" (default) or "image".


widgetDrawer

protected WidgetDrawer widgetDrawer
widgetDrawer strategy instance


widgetInfo

protected WidgetInfo widgetInfo
widgetInfo instance


width

protected String width
widget width

Constructor Detail

Widget

protected Widget()
Default protected Constructor.
Use the WidgetFactory to instance a new Widget (sub)class.

Method Detail

setColor

public void setColor(String newColor)
Sets the color attribute of the Widget object.
Use the notation rrggbb where:
rr is the red component (0-ff)
gg is the green component (0-ff)
bb is the blue component (0-ff)

Parameters:
newColor - The new color value

setContent

public void setContent(StringBuffer newContent)
Sets the content attribute of the Widget object

Parameters:
newContent - The new content value.

setContentProvider

public void setContentProvider(String contentProviderName)
                        throws Exception
Sets the default contentProvider attribute.

Parameters:
contentProviderName - the contentProvider name
Throws:
Exception - if any error occurs

setContentProviderName

public void setContentProviderName(String contentProviderName)
Sets the contentProviderName attribute.

Parameters:
contentProviderName - the contentProvider name

setDrawer

public void setDrawer(String newDrawer)
Sets the drawer attribute of the Widget object

Parameters:
newDrawer - The new drawer value

setFollowUp

public void setFollowUp(String newFollowUp)
Sets the followUp attribute of the Widget object.

Parameters:
newFollowUp - The new followUp value

setHeight

public void setHeight(String height)
Sets the height attribute of the Widget object

Parameters:
height - The new height value

setId

public void setId(String newId)
Sets the id attribute of the Widget object

Overrides:
setId in class javax.servlet.jsp.tagext.TagSupport
Parameters:
newId - The new id value

setName

public void setName(String newName)
Sets the name attribute of the Widget object

Parameters:
newName - The new name value

setParentW

public void setParentW(Widget newParentW)
Sets the parentW attribute of the Widget object

Parameters:
newParentW - The new parentW value

setTitle

public void setTitle(String newTitle)
Sets the title attribute of the Widget object

Parameters:
newTitle - The new title value.

setTitleType

public void setTitleType(String newTitleType)
Sets the titleType attribute of the Widget object
Supported types are:

Parameters:
newTitleType - The new titleType value.

setWidgetDrawer

public void setWidgetDrawer(String drawer)
                     throws Exception
Sets the default widgetDrawer attribute, using the input drawer parameter value.

Parameters:
drawer - the drawer name
Throws:
Exception - if any error occurs

setWidgetInfo

public final void setWidgetInfo(WidgetInfo widgetInfo)
Sets the widgetInfo attribute of the Widget object.
Note: this method has got the final modifier.

Parameters:
widgetInfo - The new widgetInfo value

setWidth

public void setWidth(String width)
Sets the width attribute of the Widget object

Parameters:
width - The new width value

getColor

public String getColor()
Gets the color attribute of the Widget object

Returns:
The color value

getContent

public StringBuffer getContent()
Gets the content attribute of the Widget object

Returns:
The content value

getContentProvider

public BaseContentProvider getContentProvider()
Gets the contentProvider attribute of the Widget object

Returns:
The contentProvider value

getContentProviderName

public String getContentProviderName()
Gets the contentProviderName attribute of the Widget object.

Returns:
The contentProviderName value

getDrawer

public String getDrawer()
Gets the drawer attribute of the Widget object

Returns:
The drawer value

getFollowUp

public String getFollowUp()
Gets the followUp attribute of the Widget object.

Returns:
The followUp value

getHeight

public String getHeight()
Gets the height attribute of the Widget object

Returns:
The height value

getId

public String getId()
Gets the id attribute of the Widget object

Overrides:
getId in class javax.servlet.jsp.tagext.TagSupport
Returns:
The id value

getName

public String getName()
Gets the name attribute of the Widget object

Returns:
The name value

getParentW

public Widget getParentW()
Gets the parentW attribute of the Widget object

Returns:
The parentW value

getTitle

public String getTitle()
Gets the title attribute of the Widget object

Returns:
The title value

getTitleType

public String getTitleType()
Gets the titleType attribute of the Window object

Returns:
The titleType value.

getWidgetDrawer

public WidgetDrawer getWidgetDrawer()
Gets the widgetDrawer attribute of the Widget object

Returns:
The widgetDrawer value

getWidgetInfo

public WidgetInfo getWidgetInfo()
Gets the widgetInfo attribute of the Widget object

Returns:
The widgetInfo value

getWidth

public String getWidth()
Gets the width attribute of the Widget object

Returns:
The width value

draw

public StringBuffer draw()
                  throws Exception
Gets the string representation of this widget.
Use the selected widgetDrawer strategy.

Returns:
the string representation of this widget
Throws:
Exception - if any error occurs

updateAttributes

public void updateAttributes(Widget w)
Update this class attributes using the input Widget attributes values.

Parameters:
w - the input widget subclass; must be a tag library class that extends the Widget class


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