com.guiseframework.platform.web
Class WebTableDepictor<C extends Table>

java.lang.Object
  extended by com.guiseframework.platform.AbstractDepictor<C>
      extended by com.guiseframework.platform.AbstractComponentDepictor<C>
          extended by com.guiseframework.platform.web.AbstractWebComponentDepictor<C>
              extended by com.guiseframework.platform.web.WebTableDepictor<C>
Type Parameters:
C - The type of component being depicted.
All Implemented Interfaces:
ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>

public class WebTableDepictor<C extends Table>
extends AbstractWebComponentDepictor<C>

Strategy for rendering a table component as an XHTML <table> element.

Author:
Garret Wilson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.guiseframework.platform.AbstractComponentDepictor
AbstractComponentDepictor.DepictedCompositeComponentListener
 
Nested classes/interfaces inherited from class com.guiseframework.platform.AbstractDepictor
AbstractDepictor.DepictedPropertyChangeListener
 
Field Summary
 
Fields inherited from class com.guiseframework.platform.web.AbstractWebComponentDepictor
BODY_END_PATTERN, BODY_START_PATTERN
 
Fields inherited from class com.guiseframework.platform.AbstractComponentDepictor
childPropertyChangeListener
 
Fields inherited from interface com.guiseframework.platform.Depictor
GENERAL_PROPERTY
 
Constructor Summary
WebTableDepictor()
          Default constructor using the XHTML <table> element.
 
Method Summary
protected  void depictBegin()
          Begins the rendering process.
protected  void depictBody()
          Renders the body of the component.
protected  void depictChildren()
          Updates the views of any children.
protected  void depictEnd()
          Ends the rendering process.
protected  java.util.Map<java.lang.String,java.lang.Object> getLabelStyles(LabelModel labelModel, PresentationModel uiModel)
          Retrieves the styles for the label of the component.
protected  java.util.Map<java.lang.String,java.lang.Object> getOuterStyles()
          Retrieves the styles for the outer element of the component.
protected
<T> void
updateCellView(TableModel tableModel, int rowIndex, TableColumnModel<T> column)
          Updates the view of a column.
protected
<T> void
updateHeaderView(TableModel tableModel, TableColumnModel<T> column)
          Updates the view of a column header.
 
Methods inherited from class com.guiseframework.platform.web.AbstractWebComponentDepictor
addFlowStyleIDs, decorateID, depict, getBackgroundColor, getBaseStyleIDs, getBodyStyleIDs, getBodyStyles, getColor, getDepictContext, getDepictName, getLabelStyles, getLabelStyles, getLocalName, getNamespaceURI, getPlatform, hasLabelContent, hasLabelContent, hasLabelContent, hasLabelContent, isEmptyElementAllowed, isMouseListener, writeBodyIDClassAttributes, writeClassAttribute, writeDirectionAttribute, writeDirectionAttribute, writeErrorMessage, writeFloatClear, writeIDAttribute, writeIDClassAttributes, writeLabel, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeParameterInputs, writeStyleAttribute, writeText
 
Methods inherited from class com.guiseframework.platform.AbstractComponentDepictor
depictChild, depictedObjectPropertyChange, getDepictedCompositeComponentListener, getErrorMessage, installed, processEvent, uninstalled
 
Methods inherited from class com.guiseframework.platform.AbstractDepictor
getDepictedObject, getDepictedPropertyChangeListener, getIgnoredProperties, getModifiedProperties, getSession, isDepicted, setDepicted, setPropertyModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.guiseframework.platform.Depictor
getDepictedObject, getSession, installed, isDepicted, processEvent, setDepicted, uninstalled
 

Constructor Detail

WebTableDepictor

public WebTableDepictor()
Default constructor using the XHTML <table> element.

Method Detail

getOuterStyles

protected java.util.Map<java.lang.String,java.lang.Object> getOuterStyles()
Retrieves the styles for the outer element of the component. This version combines the body styles with the outer styles.

Overrides:
getOuterStyles in class AbstractWebComponentDepictor<C extends Table>
Returns:
The styles for the outer element of the component, mapped to CSS property names.
See Also:
AbstractWebComponentDepictor.getBodyStyles()

depictBegin

protected void depictBegin()
                    throws java.io.IOException
Begins the rendering process.

Overrides:
depictBegin in class AbstractWebComponentDepictor<C extends Table>
Throws:
java.io.IOException - if there is an error rendering the component.

depictBody

protected void depictBody()
                   throws java.io.IOException
Renders the body of the component.

Overrides:
depictBody in class AbstractWebComponentDepictor<C extends Table>
Throws:
java.io.IOException - if there is an error rendering the component.
See Also:
AbstractComponentDepictor.depictChildren()

depictChildren

protected void depictChildren()
                       throws java.io.IOException
Updates the views of any children.

Overrides:
depictChildren in class AbstractComponentDepictor<C extends Table>
Throws:
java.io.IOException - if there is an error updating the child views.
See Also:
DepictContext.State#UPDATE_VIEW

updateHeaderView

protected <T> void updateHeaderView(TableModel tableModel,
                                    TableColumnModel<T> column)
                         throws java.io.IOException
Updates the view of a column header.

Type Parameters:
T - The type of value contained in the cells of the column.
Parameters:
tableModel - The component model.
column - The cell column.
Throws:
java.io.IOException - if there is an error updating the cell view.

getLabelStyles

protected java.util.Map<java.lang.String,java.lang.Object> getLabelStyles(LabelModel labelModel,
                                                                          PresentationModel uiModel)
Retrieves the styles for the label of the component. This method will be used both for the table caption and for each column header, distinguished by the UI model passed. If a column is being rendered, this version adds border styles.

Overrides:
getLabelStyles in class AbstractWebComponentDepictor<C extends Table>
Parameters:
labelModel - The label model containing the label content.
uiModel - The model containing the label style information.
Returns:
The styles for the label of the component, mapped to CSS property names.

updateCellView

protected <T> void updateCellView(TableModel tableModel,
                                  int rowIndex,
                                  TableColumnModel<T> column)
                       throws java.io.IOException
Updates the view of a column.

Type Parameters:
T - The type of value contained in the cells of the column.
Parameters:
tableModel - The component model.
rowIndex - The zero-based cell row index.
column - The cell column.
Throws:
java.io.IOException - if there is an error updating the cell view.

depictEnd

protected void depictEnd()
                  throws java.io.IOException
Ends the rendering process.

Overrides:
depictEnd in class AbstractWebComponentDepictor<C extends Table>
Throws:
java.io.IOException - if there is an error rendering the component.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.