net.xoetrope.builder.w3c.html.tags
Class Td

java.lang.Object
  extended by net.xoetrope.builder.w3c.html.tags.XHtmlTagHandler
      extended by net.xoetrope.builder.w3c.html.tags.Td

public class Td
extends XHtmlTagHandler

Processing for the html tr, td, th elements

Copyright (c) Xoetrope Ltd., 2002-2006

$Revision: 1.2 $

License: see License.txt


Field Summary
protected  javax.swing.text.html.HTML.Tag tag
           
 
Fields inherited from class net.xoetrope.builder.w3c.html.tags.XHtmlTagHandler
attribSet, builder, children, comp, content, parent, parentComponent, style
 
Constructor Summary
Td(javax.swing.text.html.HTML.Tag t)
          Creates a new instance of Td
 
Method Summary
protected  void addChildren(javax.swing.JPanel table, info.clearthought.layout.TableLayout tableLayout, int[] rowSpans, int rowIdx)
          Add the children of the table element
protected  int addContent(javax.swing.JPanel table, info.clearthought.layout.TableLayout tableLayout, int[] rowSpans, int rowIdx, int colIdx)
          Add the content of the table element
 boolean breaksFlow()
          Does this tag break the flow?
 void endProcessing(XComponentFactory cf)
          The closing tag has been parsed and now the element can calulate its complete setup should it be dependant on its children for any information.
 int getNumCols()
          Get the number of table columns represented by this COL element
protected  Table getTable()
          Find the parent table
 XHtmlTagHandler newInstance(XHtmlBuilder builder, XHtmlTagHandler parent)
          Create a new instance of this object
 void startProcessing(XHtmlBuilder builder, XComponentFactory cf, javax.swing.text.MutableAttributeSet as)
          Process the opening html Img tag/element.
 
Methods inherited from class net.xoetrope.builder.w3c.html.tags.XHtmlTagHandler
addChild, addElement, applyAlignment, applyStyle, decorateAttribute, getAttribute, getChildren, getComponent, getComponentName, getContent, getHeight, getHeight, getLength, getParent, getTextStyleAttributes, getWidth, getWidth, processComment, processCommonAttributes, processText, setBuilder, setComponent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tag

protected javax.swing.text.html.HTML.Tag tag
Constructor Detail

Td

public Td(javax.swing.text.html.HTML.Tag t)
Creates a new instance of Td

Method Detail

newInstance

public XHtmlTagHandler newInstance(XHtmlBuilder builder,
                                   XHtmlTagHandler parent)
Create a new instance of this object

Specified by:
newInstance in class XHtmlTagHandler
Parameters:
builder - the html builder and processor for the document
parent - the parent handler
Returns:
the new handler

startProcessing

public void startProcessing(XHtmlBuilder builder,
                            XComponentFactory cf,
                            javax.swing.text.MutableAttributeSet as)
Process the opening html Img tag/element. Adds a panel for TD elements

Overrides:
startProcessing in class XHtmlTagHandler
Parameters:
builder - the xui builder instance that is processing the html file
cf - the component factory to use for the creation of individual components
as - the attributes of this html tag.

endProcessing

public void endProcessing(XComponentFactory cf)
The closing tag has been parsed and now the element can calulate its complete setup should it be dependant on its children for any information. In the case of a table, the table determines the row and column count from the child elements and cannot calculate its layout till all the children have been initially processed.

Overrides:
endProcessing in class XHtmlTagHandler
Parameters:
cf - the component factory to use for the creation of individual components

getTable

protected Table getTable()
Find the parent table

Returns:
the table handler

getNumCols

public int getNumCols()
Get the number of table columns represented by this COL element

Returns:
the number of columns defined by the span attribute or 1 if a span attribute is not present

addChildren

protected void addChildren(javax.swing.JPanel table,
                           info.clearthought.layout.TableLayout tableLayout,
                           int[] rowSpans,
                           int rowIdx)
Add the children of the table element

Parameters:
table - the table being filled
tableLayout - the layout being used by the table
rowSpans - an array of rowspan values
rowIdx - the current row index

addContent

protected int addContent(javax.swing.JPanel table,
                         info.clearthought.layout.TableLayout tableLayout,
                         int[] rowSpans,
                         int rowIdx,
                         int colIdx)
Add the content of the table element

Parameters:
table - the table being filled
tableLayout - the layout being used by the table
rowSpans - an array of rowspan values
rowIdx - the current row index
colIdx - the current column

breaksFlow

public boolean breaksFlow()
Does this tag break the flow?

Overrides:
breaksFlow in class XHtmlTagHandler
Returns:
true if the flow is broken, otherwsie false