|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.guiseframework.platform.AbstractDepictor<C>
com.guiseframework.platform.AbstractComponentDepictor<C>
com.guiseframework.platform.web.AbstractWebComponentDepictor<C>
C - The type of component being controlled.public abstract class AbstractWebComponentDepictor<C extends Component>
The abstract base class for all application/xhtml+xml depictions.
This implementation knows how to return specialized style IDs for components that are Selectable.
| 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 |
|---|
protected static final java.util.regex.Pattern BODY_START_PATTERN
protected static final java.util.regex.Pattern BODY_END_PATTERN
| Constructor Detail |
|---|
public AbstractWebComponentDepictor()
public AbstractWebComponentDepictor(java.net.URI namespaceURI,
java.lang.String localName)
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.
public AbstractWebComponentDepictor(java.net.URI namespaceURI,
java.lang.String localName,
boolean isEmptyElementAllowed)
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 |
|---|
public WebPlatform getPlatform()
getPlatform in interface Depictor<C extends Component>getPlatform in interface WebDepictor<C extends Component>getPlatform in class AbstractDepictor<C extends Component>public WebDepictContext getDepictContext()
WebPlatform.getDepictContext().
getDepictContext in interface Depictor<C extends Component>getDepictContext in interface WebDepictor<C extends Component>getDepictContext in class AbstractDepictor<C extends Component>java.lang.IllegalStateException - if no depict context can be returned in the current depiction state.public java.net.URI getNamespaceURI(C component)
component - The component for which an element namespace URI should be retrieved.
null if there is no namespace.public java.lang.String getLocalName()
component - The component for which an element local name should be retrieved.
null if this component should not be rendered as an element.public boolean isEmptyElementAllowed(C component)
component - The component being rendered.
public java.lang.String getDepictName()
getDepictName in interface WebComponentDepictor<C extends Component>
public void depict()
throws java.io.IOException
#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.
depict in interface Depictor<C extends Component>depict in class AbstractComponentDepictor<C extends Component>java.io.IOException - if there is an error updating the depiction.#depictBegin(GC, C),
#depictBody(GC, C),
#depictEnd(GC, C)
protected void depictBegin()
throws java.io.IOException
java.io.IOException - if there is an error updating the depiction.
protected void depictBody()
throws java.io.IOException
java.io.IOException - if there is an error updating the depiction.AbstractComponentDepictor.depictChildren()
protected void depictEnd()
throws java.io.IOException
java.io.IOException - if there is an error updating the depiction.protected boolean isMouseListener()
true if the component has at least one mouse listener registered.
component - The component which may be interested in mouse events.
true if the component is interested in mouse events.
protected java.util.Set<java.lang.String> getBaseStyleIDs(java.lang.String prefix,
java.lang.String suffix)
Selectable and is selected, the SELECTED_CLASS is returned.
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.
#getDefaultStyleID(C)
protected java.util.Set<java.lang.String> getBodyStyleIDs(java.lang.String prefix,
java.lang.String suffix)
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.
protected static java.lang.String decorateID(java.lang.String id,
java.lang.String prefix,
java.lang.String suffix)
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.
protected java.util.Set<java.lang.String> addFlowStyleIDs(java.util.Set<java.lang.String> styleIDs,
Flow flow)
styleIDs - The set of style IDs to which the flow IDs should be addedflow - The logical flow, which will be converted into a physical flow and added to the style IDs.
protected java.util.Map<java.lang.String,java.lang.Object> getOuterStyles()
protected Color getColor()
PresentationModel.getTextColor().
protected Color getBackgroundColor()
PresentationModel.getBackgroundColor().
protected java.util.Map<java.lang.String,java.lang.Object> getBodyStyles()
protected void writeIDAttribute(java.lang.String prefix,
java.lang.String suffix)
throws java.io.IOException
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.
java.io.IOException - if there is an error rendering the component.DepictedObject.getDepictID()
protected void writeIDClassAttributes(java.lang.String prefix,
java.lang.String suffix,
java.lang.String... styleIDs)
throws java.io.IOException
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.
java.io.IOException - if there is an error rendering the component.writeIDAttribute(String, String),
getBaseStyleIDs(String, String)
protected void writeBodyIDClassAttributes(java.lang.String prefix,
java.lang.String suffix)
throws java.io.IOException
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.
java.io.IOException - if there is an error rendering the component.DepictedObject.getDepictID(),
getBodyStyleIDs(String, String)
protected void writeErrorMessage()
throws java.io.IOException
java.io.IOException - if there is an error rendering the component.
protected void writeFloatClear()
throws java.io.IOException
java.io.IOException - if there is an error rendering the component.
protected void writeClassAttribute(java.util.Set<java.lang.String> styleIDs)
throws java.io.IOException
styleIDs - The style IDs to write.
java.io.IOException - if there is an error writing the attribute.
protected void writeStyleAttribute(java.util.Map<java.lang.String,java.lang.Object> styles)
throws java.io.IOException
styles - The map of styles to write, each keyed to a CSS style property.
java.io.IOException - if there is an error writing the attribute.
protected void writeDirectionAttribute()
throws java.io.IOException
java.io.IOException - if there is an error writing the attribute.Component.getOrientation(),
#writeDirectionAttribute(GC, C, Orientation)
protected void writeDirectionAttribute(Orientation orientation,
Flow flow)
throws java.io.IOException
orientation - The orientation information for the component.flow - The flow axis which direction is to represent.
java.io.IOException - if there is an error writing the attribute.
protected boolean hasLabelContent()
throws java.io.IOException
hasLabelContent(LabelModel).
true if the component contains some label content, such as an icon or label text.
java.io.IOException
protected boolean hasLabelContent(boolean includeIcon,
boolean includeLabel)
throws java.io.IOException
hasLabelContent(LabelModel, boolean, boolean).
includeIcon - true if the icon should be considered for label content.includeLabel - true if the label text should be considered for label content.
true if the component contains some label content, such as an icon or label text.
java.io.IOException
protected boolean hasLabelContent(LabelModel labelModel)
throws java.io.IOException
hasLabelContent(LabelModel, boolean, boolean).
labelModel - The label model containing the label information.
true if the label model contains some label content, such as an icon or label text.
java.io.IOException
protected boolean hasLabelContent(LabelModel labelModel,
boolean includeIcon,
boolean includeLabel)
throws java.io.IOException
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.
true if the label model contains some label content, such as an icon or label text.
java.io.IOException
protected void writeLabel(java.lang.String forID,
java.lang.String... styleIDs)
throws java.io.IOException
writeLabelContent().
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.
java.io.IOException - if there is an error writing the label.hasLabelContent(),
writeLabelContent()
protected void writeLabelContent()
throws java.io.IOException
writeLabelContent(LabelModel).
java.io.IOException - if there is an error writing the label content.
protected void writeLabelContent(boolean includeIcon,
boolean includeLabel)
throws java.io.IOException
writeLabelContent(LabelModel, boolean, boolean).
includeIcon - true if the icon should be considered for label content.includeLabel - true if the label text should be considered for label content.
java.io.IOException - if there is an error writing the label content.
protected void writeLabelContent(LabelModel labelModel)
throws java.io.IOException
writeLabelContent(LabelModel, PresentationModel).
labelModel - The label model containing the label information.
java.io.IOException - if there is an error writing the label.
protected void writeLabelContent(LabelModel labelModel,
PresentationModel uiModel)
throws java.io.IOException
writeLabelContent(LabelModel, PresentationModel, boolean, boolean).
labelModel - The label model containing the label content.uiModel - The user interface model containing the label styles.
java.io.IOException - if there is an error writing the label.
protected void writeLabelContent(LabelModel labelModel,
boolean includeIcon,
boolean includeLabel)
throws java.io.IOException
writeText(String, ContentType).
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.
java.io.IOException - if there is an error writing the label.
protected void writeLabelContent(LabelModel labelModel,
PresentationModel uiModel,
boolean includeIcon,
boolean includeLabel)
throws java.io.IOException
writeText(String, ContentType).
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.
java.io.IOException - if there is an error writing the label.hasLabelContent(LabelModel, boolean, boolean),
getLabelStyles(LabelModel, PresentationModel),
writeText(String, ContentType)protected final java.util.Map<java.lang.String,java.lang.Object> getLabelStyles()
getLabelStyles(LabelModel) using the component as the label model.
component - The component for which styles should be retrieved.
protected final java.util.Map<java.lang.String,java.lang.Object> getLabelStyles(LabelModel labelModel)
getLabelStyles(LabelModel, PresentationModel) using the component as the UI model.
labelModel - The label model containing the label content.
protected java.util.Map<java.lang.String,java.lang.Object> getLabelStyles(LabelModel labelModel,
PresentationModel uiModel)
labelModel - The label model containing the label content.uiModel - The model containing the label style information.
protected void writeText(java.lang.String text,
com.globalmentor.net.ContentType contentType)
throws java.io.IOException
<body>) stripped away.
text - The text to write.contentType - The content type of the text.
java.io.IOException - if there is an error writing the text.
java.lang.NullPointerException - if the provided text and/or content type is null.
protected void writeParameterInputs(com.globalmentor.model.NameValuePair<java.lang.String,java.lang.String>... parameters)
throws java.io.IOException
parameters - The parameters to write.
java.io.IOException - if there is an error rendering the component.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||