com.guiseframework.platform.web
Class AbstractWebComponentDepictor<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>
Type Parameters:
C - The type of component being controlled.
All Implemented Interfaces:
ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>
Direct Known Subclasses:
AbstractDecoratedWebComponentDepictor, AbstractSimpleWebComponentDepictor, AbstractWebFrameDepictor, AbstractWebLayoutComponentDepictor, WebCheckControlDepictor, WebPictureDepictor, WebScrollControlDepictor, WebSliderDepictor, WebTableDepictor

public abstract class AbstractWebComponentDepictor<C extends Component>
extends AbstractComponentDepictor<C>
implements WebComponentDepictor<C>

The abstract base class for all application/xhtml+xml depictions. This implementation knows how to return specialized style IDs for components that are Selectable.

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
protected static java.util.regex.Pattern BODY_END_PATTERN
          The pattern matching the HTML body end tag.
protected static java.util.regex.Pattern BODY_START_PATTERN
          The pattern matching the HTML body start tag.
 
Fields inherited from class com.guiseframework.platform.AbstractComponentDepictor
childPropertyChangeListener
 
Fields inherited from interface com.guiseframework.platform.Depictor
GENERAL_PROPERTY
 
Constructor Summary
AbstractWebComponentDepictor()
          Default constructor with no element representation.
AbstractWebComponentDepictor(java.net.URI namespaceURI, java.lang.String localName)
          Element namespace and local name constructor that doesn't create an empty element, even if there is no content.
AbstractWebComponentDepictor(java.net.URI namespaceURI, java.lang.String localName, boolean isEmptyElementAllowed)
          Element namespace and local name constructor.
 
Method Summary
protected  java.util.Set<java.lang.String> addFlowStyleIDs(java.util.Set<java.lang.String> styleIDs, Flow flow)
          Adds flow style IDs to the given set of style IDs based upon the given flow.
protected static java.lang.String decorateID(java.lang.String id, java.lang.String prefix, java.lang.String suffix)
          Modifies an ID (such as a component ID or a style ID) by adding a prefix and/or suffix as needed.
 void depict()
          Orchestrates the entire depiction process for the given component.
protected  void depictBegin()
          Begins the depiction process.
protected  void depictBody()
          Depicts the body of the component.
protected  void depictEnd()
          Ends the depiction process.
protected  Color getBackgroundColor()
          Determines the background color for rendering the component.
protected  java.util.Set<java.lang.String> getBaseStyleIDs(java.lang.String prefix, java.lang.String suffix)
          Retrieves the base style IDs for the given component.
protected  java.util.Set<java.lang.String> getBodyStyleIDs(java.lang.String prefix, java.lang.String suffix)
          Retrieves the style IDs for the main part of the component.
protected  java.util.Map<java.lang.String,java.lang.Object> getBodyStyles()
          Retrieves the styles for the body element of the component.
protected  Color getColor()
          Determines the color for rendering the component.
 WebDepictContext getDepictContext()
          Retrieves information and functionality related to the current depiction on the web platform.
 java.lang.String getDepictName()
          Determines the identifier to place in the name attribute of the component's XHTML element, if appropriate.
protected  java.util.Map<java.lang.String,java.lang.Object> getLabelStyles()
          Retrieves the styles for the label of the component.
protected  java.util.Map<java.lang.String,java.lang.Object> getLabelStyles(LabelModel labelModel)
          Retrieves the styles for the label of the component.
protected  java.util.Map<java.lang.String,java.lang.Object> getLabelStyles(LabelModel labelModel, PresentationModel uiModel)
          Retrieves the styles for the label of the component.
 java.lang.String getLocalName()
          Determines the local name of the XML element.
 java.net.URI getNamespaceURI(C component)
          Determines the namespace URI of the XML element.
protected  java.util.Map<java.lang.String,java.lang.Object> getOuterStyles()
          Retrieves the styles for the outer element of the component.
 WebPlatform getPlatform()
           
protected  boolean hasLabelContent()
          Determines if the given component has label content.
protected  boolean hasLabelContent(boolean includeIcon, boolean includeLabel)
          Determines if the given component has label content.
protected  boolean hasLabelContent(LabelModel labelModel)
          Determines if the given label model has label content.
protected  boolean hasLabelContent(LabelModel labelModel, boolean includeIcon, boolean includeLabel)
          Determines if the given label model has label content.
 boolean isEmptyElementAllowed(C component)
          Returns whether an empty element can be created if there is no content.
protected  boolean isMouseListener()
          Returns whether the component is interested in mouse events.
protected  void writeBodyIDClassAttributes(java.lang.String prefix, java.lang.String suffix)
          Writes ID and class attributes for the body of the component.
protected  void writeClassAttribute(java.util.Set<java.lang.String> styleIDs)
          Writes an XHTML class attribute with the given style IDs.
protected  void writeDirectionAttribute()
          Writes an XHTML direction attribute for the X axis direction only if the given component has an orientation explicitly set.
protected  void writeDirectionAttribute(Orientation orientation, Flow flow)
          Writes an XHTML direction attribute with the direction of the given orientation for the given flow.
protected  void writeErrorMessage()
          Writes a message indicating any errors related to the component.
protected  void writeFloatClear()
          Writes an XHTML element to clear all floats.
protected  void writeIDAttribute(java.lang.String prefix, java.lang.String suffix)
          Writes an ID attribute with the appropriate prefixes and suffixes.
protected  void writeIDClassAttributes(java.lang.String prefix, java.lang.String suffix, java.lang.String... styleIDs)
          Writes ID and class attributes with the appropriate prefixes and suffixes.
protected  void writeLabel(java.lang.String forID, java.lang.String... styleIDs)
          Writes a label element for a component, taking into account the label's content type.
protected  void writeLabelContent()
          Writes the label content of the component, taking into account the label's content type.
protected  void writeLabelContent(boolean includeIcon, boolean includeLabel)
          Writes the label content of the component, taking into account the label's content type.
protected  void writeLabelContent(LabelModel labelModel)
          Writes the label content of the given label model, taking into account the label's content type.
protected  void writeLabelContent(LabelModel labelModel, boolean includeIcon, boolean includeLabel)
          Writes the label content of the given label model, taking into account the label's content type.
protected  void writeLabelContent(LabelModel labelModel, PresentationModel uiModel)
          Writes the label content of the given label model, taking into account the label's content type.
protected  void writeLabelContent(LabelModel labelModel, PresentationModel uiModel, boolean includeIcon, boolean includeLabel)
          Writes the label content of the given label model, taking into account the label's content type.
protected  void writeParameterInputs(com.globalmentor.model.NameValuePair<java.lang.String,java.lang.String>... parameters)
          Writes parameters as hidden, disabled inputs.
protected  void writeStyleAttribute(java.util.Map<java.lang.String,java.lang.Object> styles)
          Writes an XHTML style attribute with the given styles.
protected  void writeText(java.lang.String text, com.globalmentor.net.ContentType contentType)
          Writes text, taking the content type into consideration.
 
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
 

Field Detail

BODY_START_PATTERN

protected static final java.util.regex.Pattern BODY_START_PATTERN
The pattern matching the HTML body start tag.


BODY_END_PATTERN

protected static final java.util.regex.Pattern BODY_END_PATTERN
The pattern matching the HTML body end tag.

Constructor Detail

AbstractWebComponentDepictor

public AbstractWebComponentDepictor()
Default constructor with no element representation.


AbstractWebComponentDepictor

public AbstractWebComponentDepictor(java.net.URI namespaceURI,
                                    java.lang.String localName)
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.

AbstractWebComponentDepictor

public AbstractWebComponentDepictor(java.net.URI namespaceURI,
                                    java.lang.String localName,
                                    boolean isEmptyElementAllowed)
Element namespace and local name constructor.

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.
isEmptyElementAllowed - Whether an empty element can be created if there is no content.
Method Detail

getPlatform

public WebPlatform getPlatform()
Specified by:
getPlatform in interface Depictor<C extends Component>
Specified by:
getPlatform in interface WebDepictor<C extends Component>
Overrides:
getPlatform in class AbstractDepictor<C extends Component>
Returns:
The web platform on which this depictor is depicting ojects.

getDepictContext

public WebDepictContext getDepictContext()
Retrieves information and functionality related to the current depiction on the web platform. This method delegates to WebPlatform.getDepictContext().

Specified by:
getDepictContext in interface Depictor<C extends Component>
Specified by:
getDepictContext in interface WebDepictor<C extends Component>
Overrides:
getDepictContext in class AbstractDepictor<C extends Component>
Returns:
A context for the current depiction.
Throws:
java.lang.IllegalStateException - if no depict context can be returned in the current depiction state.

getNamespaceURI

public java.net.URI getNamespaceURI(C component)
Determines the namespace URI of the XML element.

Parameters:
component - The component for which an element namespace URI should be retrieved.
Returns:
The URI of the XML namespace of the element, or null if there is no namespace.

getLocalName

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

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

isEmptyElementAllowed

public boolean isEmptyElementAllowed(C component)
Returns whether an empty element can be created if there is no content.

Parameters:
component - The component being rendered.
Returns:
Whether an empty element can be created if there is no content.

getDepictName

public java.lang.String getDepictName()
Determines the identifier to place in the name attribute of the component's XHTML element, if appropriate. This is usually the string version of the ID of the component, but some grouped components may use a common name.

Specified by:
getDepictName in interface WebComponentDepictor<C extends Component>
Returns:
An identifier appropriate for the name attribute of the component's XHTML element.

depict

public void depict()
            throws java.io.IOException
Orchestrates the entire depiction process for the given component. Updating child views is delayed until #depictBody(GC, C) A component for an individual component type should usually not override this method, opting instead to override one of the more fine-grained update view methods.

Specified by:
depict in interface Depictor<C extends Component>
Overrides:
depict in class AbstractComponentDepictor<C extends Component>
Throws:
java.io.IOException - if there is an error updating the depiction.
See Also:
#depictBegin(GC, C), #depictBody(GC, C), #depictEnd(GC, C)

depictBegin

protected void depictBegin()
                    throws java.io.IOException
Begins the depiction process. This version renders the beginning XML element information, if there is any, leaving the beginning tag open for attributes. This version writes common XHTML attributes.

Throws:
java.io.IOException - if there is an error updating the depiction.

depictBody

protected void depictBody()
                   throws java.io.IOException
Depicts the body of the component. This version depicts the children of the component. This version increases and decreases the indention level before and after depicting the children, respectively.

Throws:
java.io.IOException - if there is an error updating the depiction.
See Also:
AbstractComponentDepictor.depictChildren()

depictEnd

protected void depictEnd()
                  throws java.io.IOException
Ends the depiction process. This version renders the ending XML element information, if there is any.

Throws:
java.io.IOException - if there is an error updating the depiction.

isMouseListener

protected boolean isMouseListener()
Returns whether the component is interested in mouse events. This version returns true if the component has at least one mouse listener registered.

Parameters:
component - The component which may be interested in mouse events.
Returns:
true if the component is interested in mouse events.

getBaseStyleIDs

protected java.util.Set<java.lang.String> getBaseStyleIDs(java.lang.String prefix,
                                                          java.lang.String suffix)
Retrieves the base style IDs for the given component. This version returns the default style ID and the specified component style ID, if any. If the component is Selectable and is selected, the SELECTED_CLASS is returned.

Parameters:
prefix - The prefix that needs to be added to each, or null if there is no prefix to add.
suffix - The suffix that needs to be added to each, or null if there is no suffix to add.
Returns:
The base style IDs for the component.
See Also:
#getDefaultStyleID(C)

getBodyStyleIDs

protected java.util.Set<java.lang.String> getBodyStyleIDs(java.lang.String prefix,
                                                          java.lang.String suffix)
Retrieves the style IDs for the main part of the component. This version returns the base style IDs, along with any drag source, drag handle, or drop target style IDs.

Parameters:
prefix - The prefix that needs to be added to each, or null if there is no prefix to add.
suffix - The suffix that needs to be added to each, or null if there is no suffix to add.
Returns:
The style IDs for the body of the component.

decorateID

protected static java.lang.String decorateID(java.lang.String id,
                                             java.lang.String prefix,
                                             java.lang.String suffix)
Modifies an ID (such as a component ID or a style ID) by adding a prefix and/or suffix as needed.

Parameters:
id - The ID.
prefix - The prefix that needs to be added, or null if there is no prefix to add.
suffix - The suffix that needs to be added, or null if there is no suffix to add.
Returns:
The ID, with prefix and/or suffix added as needed.

addFlowStyleIDs

protected java.util.Set<java.lang.String> addFlowStyleIDs(java.util.Set<java.lang.String> styleIDs,
                                                          Flow flow)
Adds flow style IDs to the given set of style IDs based upon the given flow. The attribute "axisX" or "axisY" will be added to indicate whether physical flow is on the X axis or the Y axis. This attribute "dirLTR" or "dirRTL" will be added to indicate whether flow is left-to-right or right-to-left on the X axis.

Parameters:
styleIDs - The set of style IDs to which the flow IDs should be added
flow - The logical flow, which will be converted into a physical flow and added to the style IDs.
Returns:
The style IDs with the physical flow axis and line direction added.

getOuterStyles

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

Returns:
The styles for the outer element of the component, mapped to CSS property names.

getColor

protected Color getColor()
Determines the color for rendering the component. This version delegates to PresentationModel.getTextColor().

Returns:
The color to use for this component.

getBackgroundColor

protected Color getBackgroundColor()
Determines the background color for rendering the component. This version delegates to PresentationModel.getBackgroundColor().

Returns:
The background color to use for this component.

getBodyStyles

protected java.util.Map<java.lang.String,java.lang.Object> getBodyStyles()
Retrieves the styles for the body element of the component. This version returns the style for background color.

Returns:
The styles for the body element of the component, mapped to CSS property names.

writeIDAttribute

protected void writeIDAttribute(java.lang.String prefix,
                                java.lang.String suffix)
                         throws java.io.IOException
Writes an ID attribute with the appropriate prefixes and suffixes.

Parameters:
prefix - The prefix that needs to be added to each, or null if there is no prefix to add.
suffix - The suffix that needs to be added to each, or null if there is no suffix to add.
Throws:
java.io.IOException - if there is an error rendering the component.
See Also:
DepictedObject.getDepictID()

writeIDClassAttributes

protected void writeIDClassAttributes(java.lang.String prefix,
                                      java.lang.String suffix,
                                      java.lang.String... styleIDs)
                               throws java.io.IOException
Writes ID and class attributes with the appropriate prefixes and suffixes.

Parameters:
prefix - The prefix that needs to be added to each, or null if there is no prefix to add.
suffix - The suffix that needs to be added to each, or null if there is no suffix to add.
styleIDs - Additional style IDs to include, without the given prefix and suffix.
Throws:
java.io.IOException - if there is an error rendering the component.
See Also:
writeIDAttribute(String, String), getBaseStyleIDs(String, String)

writeBodyIDClassAttributes

protected void writeBodyIDClassAttributes(java.lang.String prefix,
                                          java.lang.String suffix)
                                   throws java.io.IOException
Writes ID and class attributes for the body of the component.

Parameters:
prefix - The prefix that needs to be added to each, or null if there is no prefix to add.
suffix - The suffix that needs to be added to each, or null if there is no suffix to add.
Throws:
java.io.IOException - if there is an error rendering the component.
See Also:
DepictedObject.getDepictID(), getBodyStyleIDs(String, String)

writeErrorMessage

protected void writeErrorMessage()
                          throws java.io.IOException
Writes a message indicating any errors related to the component. The error message will be resolved so that any contained resource references will be properly written.

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

writeFloatClear

protected void writeFloatClear()
                        throws java.io.IOException
Writes an XHTML element to clear all floats.

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

writeClassAttribute

protected void writeClassAttribute(java.util.Set<java.lang.String> styleIDs)
                            throws java.io.IOException
Writes an XHTML class attribute with the given style IDs.

Parameters:
styleIDs - The style IDs to write.
Throws:
java.io.IOException - if there is an error writing the attribute.

writeStyleAttribute

protected void writeStyleAttribute(java.util.Map<java.lang.String,java.lang.Object> styles)
                            throws java.io.IOException
Writes an XHTML style attribute with the given styles. If no styles are provided, the style attribute is not written.

Parameters:
styles - The map of styles to write, each keyed to a CSS style property.
Throws:
java.io.IOException - if there is an error writing the attribute.

writeDirectionAttribute

protected void writeDirectionAttribute()
                                throws java.io.IOException
Writes an XHTML direction attribute for the X axis direction only if the given component has an orientation explicitly set.

Throws:
java.io.IOException - if there is an error writing the attribute.
See Also:
Component.getOrientation(), #writeDirectionAttribute(GC, C, Orientation)

writeDirectionAttribute

protected void writeDirectionAttribute(Orientation orientation,
                                       Flow flow)
                                throws java.io.IOException
Writes an XHTML direction attribute with the direction of the given orientation for the given flow.

Parameters:
orientation - The orientation information for the component.
flow - The flow axis which direction is to represent.
Throws:
java.io.IOException - if there is an error writing the attribute.

hasLabelContent

protected boolean hasLabelContent()
                           throws java.io.IOException
Determines if the given component has label content. This implementation delegates to hasLabelContent(LabelModel).

Returns:
true if the component contains some label content, such as an icon or label text.
Throws:
java.io.IOException

hasLabelContent

protected boolean hasLabelContent(boolean includeIcon,
                                  boolean includeLabel)
                           throws java.io.IOException
Determines if the given component has label content. This implementation delegates to hasLabelContent(LabelModel, boolean, boolean).

Parameters:
includeIcon - true if the icon should be considered for label content.
includeLabel - true if the label text should be considered for label content.
Returns:
true if the component contains some label content, such as an icon or label text.
Throws:
java.io.IOException

hasLabelContent

protected boolean hasLabelContent(LabelModel labelModel)
                           throws java.io.IOException
Determines if the given label model has label content. This implementation delegates to hasLabelContent(LabelModel, boolean, boolean).

Parameters:
labelModel - The label model containing the label information.
Returns:
true if the label model contains some label content, such as an icon or label text.
Throws:
java.io.IOException

hasLabelContent

protected boolean hasLabelContent(LabelModel labelModel,
                                  boolean includeIcon,
                                  boolean includeLabel)
                           throws java.io.IOException
Determines if the given label model has label content.

Parameters:
labelModel - The label model containing the label information.
includeIcon - true if the icon should be considered for label content.
includeLabel - true if the label text should be considered for label content.
Returns:
true if the label model contains some label content, such as an icon or label text.
Throws:
java.io.IOException

writeLabel

protected void writeLabel(java.lang.String forID,
                          java.lang.String... styleIDs)
                   throws java.io.IOException
Writes a label element for a component, taking into account the label's content type. If no label content is present, no action occurs. This method calls writeLabelContent().

Parameters:
forID - The ID of the element with which this label is associated, or null if the label should not be associated with any particular element.
styleIDs - Additional style IDs to include, without the given prefix and suffix.
Throws:
java.io.IOException - if there is an error writing the label.
See Also:
hasLabelContent(), writeLabelContent()

writeLabelContent

protected void writeLabelContent()
                          throws java.io.IOException
Writes the label content of the component, taking into account the label's content type. Label styles will be written if needed. If no label content is present, no action occurs. This implementation delegates to writeLabelContent(LabelModel).

Throws:
java.io.IOException - if there is an error writing the label content.

writeLabelContent

protected void writeLabelContent(boolean includeIcon,
                                 boolean includeLabel)
                          throws java.io.IOException
Writes the label content of the component, taking into account the label's content type. Label styles will be written if needed. If no label content is present, no action occurs. This implementation delegates to writeLabelContent(LabelModel, boolean, boolean).

Parameters:
includeIcon - true if the icon should be considered for label content.
includeLabel - true if the label text should be considered for label content.
Throws:
java.io.IOException - if there is an error writing the label content.

writeLabelContent

protected void writeLabelContent(LabelModel labelModel)
                          throws java.io.IOException
Writes the label content of the given label model, taking into account the label's content type. Label styles will be written if needed. If no label content is present, no action occurs. This method delegates to writeLabelContent(LabelModel, PresentationModel).

Parameters:
labelModel - The label model containing the label information.
Throws:
java.io.IOException - if there is an error writing the label.

writeLabelContent

protected void writeLabelContent(LabelModel labelModel,
                                 PresentationModel uiModel)
                          throws java.io.IOException
Writes the label content of the given label model, taking into account the label's content type. Label styles will be written if needed. If no label content is present, no action occurs. This method delegates to writeLabelContent(LabelModel, PresentationModel, boolean, boolean).

Parameters:
labelModel - The label model containing the label content.
uiModel - The user interface model containing the label styles.
Throws:
java.io.IOException - if there is an error writing the label.

writeLabelContent

protected void writeLabelContent(LabelModel labelModel,
                                 boolean includeIcon,
                                 boolean includeLabel)
                          throws java.io.IOException
Writes the label content of the given label model, taking into account the label's content type. Label styles will be written if needed. If no label content is present, no action occurs. This method delegates to writeText(String, ContentType).

Parameters:
labelModel - The label model containing the label content.
includeIcon - true if the icon should be considered for label content.
includeLabel - true if the label text should be considered for label content.
Throws:
java.io.IOException - if there is an error writing the label.

writeLabelContent

protected void writeLabelContent(LabelModel labelModel,
                                 PresentationModel uiModel,
                                 boolean includeIcon,
                                 boolean includeLabel)
                          throws java.io.IOException
Writes the label content of the given label model, taking into account the label's content type. Label styles will be written if needed. If no label content is present, no action occurs. This method delegates to writeText(String, ContentType).

Parameters:
labelModel - The label model containing the label information.
uiModel - The UI model containing the label style information.
includeIcon - true if the icon should be considered for label content.
includeLabel - true if the label text should be considered for label content.
Throws:
java.io.IOException - if there is an error writing the label.
See Also:
hasLabelContent(LabelModel, boolean, boolean), getLabelStyles(LabelModel, PresentationModel), writeText(String, ContentType)

getLabelStyles

protected final java.util.Map<java.lang.String,java.lang.Object> getLabelStyles()
Retrieves the styles for the label of the component. This version delegates to getLabelStyles(LabelModel) using the component as the label model.

Parameters:
component - The component for which styles should be retrieved.
Returns:
The styles for the label of the component, mapped to CSS property names.

getLabelStyles

protected final java.util.Map<java.lang.String,java.lang.Object> getLabelStyles(LabelModel labelModel)
Retrieves the styles for the label of the component. This version delegates to getLabelStyles(LabelModel, PresentationModel) using the component as the UI model.

Parameters:
labelModel - The label model containing the label content.
Returns:
The styles for the label of the component, mapped to CSS property names.

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.

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.

writeText

protected void writeText(java.lang.String text,
                         com.globalmentor.net.ContentType contentType)
                  throws java.io.IOException
Writes text, taking the content type into consideration. XHTML text, for example, will first have its outer elements (including <body>) stripped away.

Parameters:
text - The text to write.
contentType - The content type of the text.
Throws:
java.io.IOException - if there is an error writing the text.
java.lang.NullPointerException - if the provided text and/or content type is null.

writeParameterInputs

protected void writeParameterInputs(com.globalmentor.model.NameValuePair<java.lang.String,java.lang.String>... parameters)
                             throws java.io.IOException
Writes parameters as hidden, disabled inputs.

Parameters:
parameters - The parameters to write.
Throws:
java.io.IOException - if there is an error rendering the component.


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