com.guiseframework.platform.web
Class AbstractDecoratedWebComponentDepictor<C extends Component>

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.AbstractDecoratedWebComponentDepictor<C>
Type Parameters:
C - The type of component being depicted.
All Implemented Interfaces:
ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>
Direct Known Subclasses:
WebFileInputDepictor, WebMessageDepictor, WebResourceCollectDepictor, WebSelectDepictor, WebTabDepictor, WebTextControlDepictor, WebTreeControlDepictor

public abstract class AbstractDecoratedWebComponentDepictor<C extends Component>
extends AbstractWebComponentDepictor<C>

An abstract XHTML component depictor that writes component decorations such as label and error. The component is wrapped in an ourter XHTML <div> element. The body of the component will be preceded by a label and succeeded by an error. The provided element, if any, will be used as the body of the component with the #COMPONENT_BODY_CLASS_SUFFIX ID and style suffix.

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
AbstractDecoratedWebComponentDepictor()
          Default constructor with no element representation for the body.
AbstractDecoratedWebComponentDepictor(java.net.URI namespaceURI, java.lang.String localName)
          Body element namespace and local name constructor that doesn't create an empty element, even if there is no content.
AbstractDecoratedWebComponentDepictor(java.net.URI bodyNamespaceURI, java.lang.String bodyLocalName, boolean isBodyEmptyElementAllowed)
          Body element namespace and local name constructor.
 
Method Summary
protected  void depictBegin()
          Begins the rendering process.
protected  void depictEnd()
          Ends the rendering process.
 java.lang.String getBodyLocalName()
          Determines the local name of the body XML element.
 java.net.URI getBodyNamespaceURI()
          Determines the namespace URI of the body XML element.
 boolean isEmptyBodyElementAllowed()
          Determines whether an empty body element can be created if there is no content.
protected  void writeDecoratorBegin()
          Writes the beginning part of the outer decorator element.
protected  void writeDecoratorEnd()
          Writes the ending part of the outer decorator element.
 
Methods inherited from class com.guiseframework.platform.web.AbstractWebComponentDepictor
addFlowStyleIDs, decorateID, depict, depictBody, getBackgroundColor, getBaseStyleIDs, getBodyStyleIDs, getBodyStyles, getColor, getDepictContext, getDepictName, getLabelStyles, getLabelStyles, getLabelStyles, getLocalName, getNamespaceURI, getOuterStyles, 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, depictChildren, 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

AbstractDecoratedWebComponentDepictor

public AbstractDecoratedWebComponentDepictor()
Default constructor with no element representation for the body.


AbstractDecoratedWebComponentDepictor

public AbstractDecoratedWebComponentDepictor(java.net.URI namespaceURI,
                                             java.lang.String localName)
Body element namespace and local name constructor that doesn't create an empty element, even if there is no content.

Parameters:
namespaceURI - The URI of the XML namespace of the element, or null if there is no namespace.
localName - The local name of the element with no prefix, or null if this component should not be rendered as an element.

AbstractDecoratedWebComponentDepictor

public AbstractDecoratedWebComponentDepictor(java.net.URI bodyNamespaceURI,
                                             java.lang.String bodyLocalName,
                                             boolean isBodyEmptyElementAllowed)
Body element namespace and local name constructor.

Parameters:
bodyNamespaceURI - The URI of the XML namespace of the body element, or null if there is no namespace.
bodyLocalName - The local name of the body element with no prefix, or null if this component should not be rendered as an element.
isBodyEmptyElementAllowed - Whether an empty body element can be created if there is no content.
Method Detail

getBodyNamespaceURI

public java.net.URI getBodyNamespaceURI()
Determines the namespace URI of the body XML element.

Returns:
The URI of the XML namespace of the element, or null if there is no namespace.

getBodyLocalName

public java.lang.String getBodyLocalName()
Determines the local name of the body XML element.

Returns:
The local name of the element with no prefix, or null if this component should not be rendered as an element.

isEmptyBodyElementAllowed

public boolean isEmptyBodyElementAllowed()
Determines whether an empty body element can be created if there is no content.

Returns:
Whether an empty body element can be created if there is no content.
See Also:
getBodyLocalName()

depictBegin

protected void depictBegin()
                    throws java.io.IOException
Begins the rendering process. This version calls writeDecoratorBegin().

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

writeDecoratorBegin

protected void writeDecoratorBegin()
                            throws java.io.IOException
Writes the beginning part of the outer decorator element. This version writes the beginning decorator items, such as the label, if any.

Throws:
java.io.IOException - if there is an error rendering the component.

depictEnd

protected void depictEnd()
                  throws java.io.IOException
Ends the rendering process. This version writes the end of the body element, if there is one, and the ending decorator items, such as the error, if any. This version calls writeDecoratorEnd().

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

writeDecoratorEnd

protected void writeDecoratorEnd()
                          throws java.io.IOException
Writes the ending part of the outer decorator element. This version writes the ending decorator items, such as the error message, if any.

Throws:
java.io.IOException - if there is an error rendering the component.
See Also:
AbstractWebComponentDepictor.writeErrorMessage()


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