org.apache.commons.jelly.tags.swing
Class TitledBorderTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.swing.BorderTagSupport
          extended byorg.apache.commons.jelly.tags.swing.TitledBorderTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag

public class TitledBorderTag
extends BorderTagSupport

Creates a titled border. The border will either be exported as a variable defined by the 'var' attribute or will be set on the parent widget's border property

Version:
$Revision: 155420 $
Author:
James Strachan

Field Summary
private  javax.swing.border.Border border
           
private  java.awt.Color color
           
private  java.awt.Font font
           
private static org.apache.commons.logging.Log log
          The Log to which logging calls will be made.
private  java.lang.String title
           
private  java.lang.String titleJustification
           
private  java.lang.String titlePosition
           
 
Fields inherited from class org.apache.commons.jelly.tags.swing.BorderTagSupport
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
TitledBorderTag()
           
 
Method Summary
protected  int asTitleJustification(java.lang.String text)
           
protected  int asTitlePosition(java.lang.String text)
           
protected  javax.swing.border.Border createBorder()
          Factory method to create a new Border instance.
 void doTag(org.apache.commons.jelly.XMLOutput output)
           
 void setColor(java.awt.Color color)
          Sets the color of the title for this border.
 void setFont(java.awt.Font font)
          Sets the Font to be used by the title.
 void setTitle(java.lang.String title)
          Sets the title text for this border.
 void setTitleJustification(java.lang.String titleJustification)
          Sets the justification of the title.
 void setTitlePosition(java.lang.String titlePosition)
          Sets the position of the title.
 
Methods inherited from class org.apache.commons.jelly.tags.swing.BorderTagSupport
setVar
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
The Log to which logging calls will be made.


title

private java.lang.String title

titleJustification

private java.lang.String titleJustification

titlePosition

private java.lang.String titlePosition

border

private javax.swing.border.Border border

font

private java.awt.Font font

color

private java.awt.Color color
Constructor Detail

TitledBorderTag

public TitledBorderTag()
Method Detail

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.MissingAttributeException,
                  org.apache.commons.jelly.JellyTagException
Specified by:
doTag in interface org.apache.commons.jelly.Tag
Overrides:
doTag in class BorderTagSupport
Throws:
org.apache.commons.jelly.MissingAttributeException
org.apache.commons.jelly.JellyTagException

setColor

public void setColor(java.awt.Color color)
Sets the color of the title for this border. Can be set via a nested tag.


setFont

public void setFont(java.awt.Font font)
Sets the Font to be used by the title. Can be set via a nested tag.


setTitle

public void setTitle(java.lang.String title)
Sets the title text for this border.


setTitleJustification

public void setTitleJustification(java.lang.String titleJustification)
Sets the justification of the title. The String is case insensitive. Possible values are {LEFT, CENTER, RIGHT, LEADING, TRAILING}


setTitlePosition

public void setTitlePosition(java.lang.String titlePosition)
Sets the position of the title. The String is case insensitive. Possible values are {ABOVE_TOP, TOP, BELOW_TOP, ABOVE_BOTTOM, BOTTOM, BELOW_BOTTOM}


createBorder

protected javax.swing.border.Border createBorder()
Factory method to create a new Border instance.

Specified by:
createBorder in class BorderTagSupport

asTitleJustification

protected int asTitleJustification(java.lang.String text)
Returns:
the enumeration for the title justification

asTitlePosition

protected int asTitlePosition(java.lang.String text)
Returns:
the enumeration for the title position