objectivehtml.htmlwidget
Class HtmlTableCell

java.lang.Object
  |
  +--objectivehtml.oms.OMSObject
        |
        +--objectivehtml.htmlwidget.HtmlElement
              |
              +--objectivehtml.htmlwidget.HtmlWidget
                    |
                    +--objectivehtml.htmlwidget.HtmlContainerWidget
                          |
                          +--objectivehtml.htmlwidget.HtmlTableCell

public class HtmlTableCell
extends HtmlContainerWidget

This class represents a html table cell (default) or html table header. i.e.

<td ... ><th ... >

This object can either a table cell (default) or table header. To change the object to be a table header call setTableHeader(boolean).

This object can only exist inside a HtmlTable object.

See Also:
setTableHeader(boolean), HtmlTable

Fields inherited from class objectivehtml.htmlwidget.HtmlContainerWidget
m_alChildrenWidgets, m_bAutoEscape, m_sText
 
Fields inherited from class objectivehtml.htmlwidget.HtmlWidget
m_bDestroyed, m_bVisible, m_objHtmlForm, m_objParentWidget
 
Fields inherited from class objectivehtml.htmlwidget.HtmlElement
m_hmAttributes, m_sEndTag, m_sQuoteType, m_sStartTag
 
Constructor Summary
protected HtmlTableCell(HtmlTableRow objParent)
          Constructs an instance of HtmlTableCell.
 
Method Summary
 void appendChild(HtmlWidget objHtmlWidget)
          Overrides the access level to make this method public.
 java.lang.String getAlign()
          Returns the alignment style of this object.
 java.lang.String getBgColor()
          Returns the background color of this object.
 int getColSpan()
          Returns column span of this table cell.
 java.lang.String getHeight()
          Returns the height of this object.
 HtmlTable getHtmlTable()
          Returns a reference to the table that this table cell is contained in.
 int getRowSpan()
          Returns row span of this table cell.
 java.lang.String getVAlign()
          Returns the vertical alignment style of this object.
 java.lang.String getWidth()
          Returns the width of this object.
 void insertChild(HtmlWidget objHtmlWidget, int nPosition)
          Overrides the access level to make this method public.
 boolean isNoWrap()
          Returns true if no-wrap is on, false otherwise.
 boolean isTableHeader()
          Returns whether this is a table header object.
 void setAlign(java.lang.String sAlign)
          Sets the alignment style of this object.
 void setAttribute(java.lang.String sAttribute, java.lang.String sValue)
          Sets a html attribute for this object.
 void setBgColor(java.lang.String sBgColor)
          Sets the background color of this object.
 void setBooleanAttribute(java.lang.String sAttribute, boolean bIsOn)
          Sets a html boolean-attribute for this object.
 void setColSpan(int nColSpan)
          Sets the col span of this table cell.
 void setHeight(java.lang.String sHeight)
          Sets the height of this object.
 void setNoWrap(boolean bNoWrap)
          Sets the table cell to either wrap or to not wrap text.
 void setRowSpan(int nRowSpan)
          Sets the row span of this table cell.
 void setTableHeader(boolean bTableHeader)
          Sets the object to be either table cell or table header.
 void setVAlign(java.lang.String sVAlign)
          Sets the vertical alignment style of this object.
 void setWidth(java.lang.String sWidth)
          Sets the width of this object.
 
Methods inherited from class objectivehtml.htmlwidget.HtmlContainerWidget
addHtmlWidget, destroy, generateUpdateOrder, getChildrenCount, getChildrenWidgets, getChildWidget, getText, indexOfChildWidget, insertHtmlWidget, isAutoEscape, isChildWidget, isValidChildWidget, printHtml, printHtml, removeHtmlWidget, setAttribute, setAutoEscape, setBooleanAttribute, setText, setVisible, swapHtmlWidgets
 
Methods inherited from class objectivehtml.htmlwidget.HtmlWidget
changeParent, changeParent, getClassAttribute, getHtmlForm, getID, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getParent, getStyle, isDestroyed, isVisible, setClassAttribute, setID, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStyle
 
Methods inherited from class objectivehtml.htmlwidget.HtmlElement
genEndTag, genStartTag, genStartTag, getAttribute, getAttributes, getBooleanAttribute, getQuoteType, printHtml, printHtml, printHtml, printHtml, printHtml, printHtml, setQuoteType, toString, toString
 
Methods inherited from class objectivehtml.oms.OMSObject
compareClasses, connect, disconnect, emit, isAlive, setAlive, signal, slot, slot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HtmlTableCell

protected HtmlTableCell(HtmlTableRow objParent)
                 throws InvalidParentWidgetException,
                        InvalidChildWidgetException
Constructs an instance of HtmlTableCell. The only valid parent is a HtmlTableRow.
Parameters:
objParent - the parent for this widget
Throws:
InvalidParentWidgetException - if the specified parent widget is not valid
InvalidChildWidgetException - if the parent widget does not accept this widget as a child
Method Detail

setTableHeader

public void setTableHeader(boolean bTableHeader)
Sets the object to be either table cell or table header.
Parameters:
bTableHeader - true if table header, false if table cell
See Also:
isTableHeader()

isTableHeader

public boolean isTableHeader()
Returns whether this is a table header object.
Returns:
true if table header object, false if table cell
See Also:
setTableHeader(boolean)

getHtmlTable

public HtmlTable getHtmlTable()
Returns a reference to the table that this table cell is contained in.
Returns:
a reference to the table

appendChild

public void appendChild(HtmlWidget objHtmlWidget)
                 throws NotEqualsHtmlFormException,
                        InvalidChildWidgetException
Overrides the access level to make this method public.
Overrides:
appendChild in class HtmlContainerWidget
Parameters:
objHtmlWidget - the widget that is to be appended
Throws:
NotEqualsHtmlFormException - if the widget is not in the same form
InvalidChildWidgetException - if this widget does not accept objHtmlWidget as a child

insertChild

public void insertChild(HtmlWidget objHtmlWidget,
                        int nPosition)
                 throws NotEqualsHtmlFormException,
                        InvalidChildWidgetException
Overrides the access level to make this method public.
Overrides:
insertChild in class HtmlContainerWidget
Parameters:
objHtmlWidget - the widget that is to be appended
nPosition - the position the new child is to inserted (starts from 0)
Throws:
NotEqualsHtmlFormException - if the widget is not in the same form
InvalidChildWidgetException - if this widget does not accept objHtmlWidget as a child

getAlign

public java.lang.String getAlign()
Returns the alignment style of this object.
Returns:
the alignment style of this object
See Also:
setAlign(String)

setAlign

public void setAlign(java.lang.String sAlign)

Sets the alignment style of this object. Suitable values are "left", "center", "right", "justify" and "char".

The html attribute it sets is "align".

If null is specified the attribute is cleared.

Parameters:
sAlign - the alignment style for this widget, if null is specified then this attribute will be cleared
See Also:
getAlign()

getVAlign

public java.lang.String getVAlign()
Returns the vertical alignment style of this object.
Returns:
the vertical alignment style of this object
See Also:
setVAlign(String)

setVAlign

public void setVAlign(java.lang.String sVAlign)

Sets the vertical alignment style of this object. Suitable values are "top", "middle", "bottom" and "baseline".

The html attribute it sets is "valign".

If null is specified the attribute is cleared.

Parameters:
sVAlign - the vertical alignment style for this widget, if null is specified then this attribute will be cleared
See Also:
getVAlign()

getBgColor

public java.lang.String getBgColor()
Returns the background color of this object.
Returns:
the background color of this object
See Also:
setBgColor(String)

setBgColor

public void setBgColor(java.lang.String sBgColor)

Sets the background color of this object. There 16 preset values "black", "silver", "gray", "white", "maroon", "red", "purple", "fushcia", "green", "lime", "olive", "yellow", "navy", "blue", "teal" and "navy". For all other colors you can specify the color in the format SRGB, i.e. #RRGGBB.

The html attribute it sets is "bgcolor".

If null is specified the attribute is cleared.

Parameters:
sBgColor - the background color for this widget, if null is specified then this attribute will be cleared
See Also:
getBgColor()

setNoWrap

public void setNoWrap(boolean bNoWrap)

Sets the table cell to either wrap or to not wrap text.

The html attribute it sets is "wrap".

If false is specified the attribute is cleared.

Parameters:
bNoWrap - true if you do not want wrapping, false if you do want wrapping
See Also:
setBooleanAttribute(String, boolean), isNoWrap()

isNoWrap

public boolean isNoWrap()
Returns true if no-wrap is on, false otherwise.
Returns:
true if no-wrap is on, false otherwise
See Also:
HtmlElement.getBooleanAttribute(String), setNoWrap(boolean)

getWidth

public java.lang.String getWidth()
Returns the width of this object.
Returns:
the width of this object
See Also:
setWidth(String)

setWidth

public void setWidth(java.lang.String sWidth)

Sets the width of this object. There are 2 formats that can be used. The first is to give a precise pixel value, e.g. "400", meaning the object will attempt to be 400 pixels wide. The second is to give a percentage, this means the object will attempt to occupy that percentage of the available space to it. e.g. "80%", meaning the object will attempt to occupy 80 percent of the width space that is available to it.

The html attribute it sets is "width".

If null is specified the attribute is cleared.

Parameters:
sWidth - the width size for this widget, if null is specified then this attribute will be cleared
See Also:
getWidth()

getHeight

public java.lang.String getHeight()
Returns the height of this object.
Returns:
the height of this object
See Also:
setHeight(String)

setHeight

public void setHeight(java.lang.String sHeight)

Sets the height of this object. There are 2 formats that can be used. The first is to give a precise pixel value, e.g. "400", meaning the object will attempt to be 400 pixels high. The second is to give a percentage, this means the object will attempt to occupy that percentage of the available space to it. e.g. "80%", meaning the object will attempt to occupy 80 percent of the height space that is available to it.

The html attribute it sets is "height".

If null is specified the attribute is cleared.

Parameters:
sHeight - the height size for this widget, if null is specified then this attribute will be cleared
See Also:
getHeight()

getRowSpan

public int getRowSpan()
Returns row span of this table cell. It will return 1 if the attribute has not been set.
Returns:
the number of rows spanned
See Also:
HtmlElement.getAttribute(String), setRowSpan(int)

setRowSpan

public void setRowSpan(int nRowSpan)

Sets the row span of this table cell. When the row span is greater than 1 this table cell will occupy the space of its neighbouring table cells (to the right of itself). e.g. If the row span is 3, then the table cell will occupy the space of the next 2 table cells on its right. For the table cells that are spanned over they will become hidden.

The html attribute it sets is "rowspan".

If 0 or less is specified the attribute is cleared.

Parameters:
nRowSpan - the row span
See Also:
getRowSpan(), setColSpan(int), HtmlTable.updateVisibility()

getColSpan

public int getColSpan()
Returns column span of this table cell. It will return 1 if the attribute has not been set.
Returns:
the number of columns spanned
See Also:
HtmlElement.getAttribute(String), setColSpan(int)

setColSpan

public void setColSpan(int nColSpan)

Sets the col span of this table cell. When the col span is greater than 1 this table cell will occupy the space of its neighbouring table cells (that is below itself). e.g. If the col span is 3, then the table cell will occupy the space of the next 2 table cells underneath itself. For the table cells that are spanned over they will become hidden.

The html attribute it sets is "colspan".

If 0 or less is specified the attribute is cleared.

Parameters:
nColSpan - the col span
See Also:
getColSpan(), setRowSpan(int), HtmlTable.updateVisibility()

setAttribute

public void setAttribute(java.lang.String sAttribute,
                         java.lang.String sValue)
                  throws InvalidAttributeException

Sets a html attribute for this object. The name of the attribute is case-insensitive.

Calls parent version of the method but stops the "rowspan" or "colspan" attribute being changed! If "rowspan" or "colspan" is specified then an InvalidAttributeException is thrown.

Overrides:
setAttribute in class HtmlElement
Parameters:
sName - the name of the attribute
sValue - the value of the attribute, if null is specified then the attribute will be cleared
Throws:
InvalidAttributeException - if the name is not valid
See Also:
setBooleanAttribute(String, boolean)

setBooleanAttribute

public void setBooleanAttribute(java.lang.String sAttribute,
                                boolean bIsOn)
                         throws InvalidAttributeException

Sets a html boolean-attribute for this object. The name of the attribute is case-insensitive.

Calls parent version of the method but stops the "rowspan" or "colspan" attribute being changed! If "rowspan" or "colspan" is specified then an InvalidAttributeException is thrown.

Overrides:
setBooleanAttribute in class HtmlElement
Parameters:
sName - the name of the attribute
bIsOn - true if attribute should be set, if false is specified then the attribute is cleared
Throws:
InvalidAttributeException - if the name is not valid
See Also:
setAttribute(String, String)